Technical Project Lead @ Huawei Technologies

My photo
Bangalore/Hyderabad, Karnataka/Andhra Pradesh, India
Have an overall 13 + yrs of experience Currently working as an Senior Architect.Expertise in design,implementation of Automation frameworks for Opensource automation tools like Selenium,Jmeter, Webdriver,Appium, Robotium Expertise in integrating Test & ALM Management tools like Rally,Qmetry,JIRA-Zephyr with Automation frameworks Expertise in design and developmenet Mobile Automation frameworks for tools like Appium, Robotium Remote Control,Cucumber BDD,Manual Testing

Followers

Wednesday, September 1, 2010

How to select a value from dropdown??

    static SeleniumServer server;
    static Selenium selenium;
    public void testSelectValueFromDropDown() throws InterruptedException
    {
        //Start the server
        try {
            server.start();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            System.out.println("Failed to start the server");
            e.printStackTrace();
        }
        //Stop the server
        server.stop();
      
        //Start the selenium session
        selenium = new DefaultSelenium
                                   ("localhost",4444,"*firefox","http://www.google.com");
        selenium.start();
        selenium.open("");
   
        //click on Advanced Search Window
        selenium.click("link=Advanced Search");
       
        //Select  results from results dropdown
        selenium.select("name=num", "50 results");           
       
        //Stop & close the selenium browsers
        selenium.close();
        selenium.stop();
    }

No comments:

Post a Comment