How to select from DropDown

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to select from DropDown

satyendra
Hello All,
                In my web page, i am trying to select an option from drop down..
                for that i am trying with following:
          Select selectBox = new Select(Globals.driver.findElement(By.xpath("XPATH of the dropdown")));
          selectBox.selectByValue("value to select");

               but this is giving following error:
org.openqa.selenium.support.ui.UnexpectedTagNameException: Element should have been "select" but was "input"

           Can anybody please suggest  what is wrong with my code, or any more info is required to debug..

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: How to select from DropDown

softwaretestingforum
Administrator
This does not seem training session question. You should post it here - http://www.seleniumtests.com/p/selenium-2-forum.html
~ seleniumtests.com