Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
sairoshan
Posts : 3
Join date : 2011-07-01

selecting dropdown list using selenium Empty selecting dropdown list using selenium

Fri Jul 01, 2011 8:53 pm
I am using selenium in Firefox. My application is having a ajax drop
down
list with autosuggestion option from where i need to select
data.
When I
start typing in the text area, autosuggest control provides
similar options
available in the list.
I need to select the populated option from the list
can anyone please help me
out writing java selenium code for the same, its
urgent.
Thanks,
avatar
sairoshan
Posts : 3
Join date : 2011-07-01

selecting dropdown list using selenium Empty Re: selecting dropdown list using selenium

Fri Jul 01, 2011 8:56 pm
//driver is the FirefoxDriver

protected void selectlist() throws Exception {

String str = "text to be selected";
for (int i=0; i Thread.sleep(300);
driver.findElementById("input_text").sendKeys(""+str.charAt(i));
}
Thread.sleep(200);

http://driver.findElementById("input_dealer").setSelected();
http://Thread.sleep(300);
http://driver.getKeyboard().pressKey(Keys.DOWN);
http://Thread.sleep(300);
http://driver.getKeyboard().pressKey(Keys.ENTER);
http://driver.getKeyboard().releaseKey(Keys.ENTER);

i tried above options but in vain

}
avatar
Arthur
Active particpant
Active particpant
Posts : 23
Join date : 2011-05-23
Location : Pune

selecting dropdown list using selenium Empty Re: selecting dropdown list using selenium

Mon Jul 04, 2011 3:55 pm
Use the following code that i tried on google page
sel = self.selenium
sel.open("http://www.google.co.in/")
sel.type_keys("q", "vi")
time.sleep(2)
sel.key_down("q", "\\40")
sel.key_up("q", "\\40")
sel.key_press("q", "\\13")


this is python code please convert and try to use.
Sponsored content

selecting dropdown list using selenium Empty Re: selecting dropdown list using selenium

Back to top
Permissions in this forum:
You cannot reply to topics in this forum