Using Selenium FirefoxDriver Code to test Ajax dropdown and submit it
Only two days back i have started working in selenium test using firefox driver and yes!!! your guess is correct im in a fix (dont know its a big or a small as im new to this).
I have been assigned to code Selenium test cases to automate the web application browsing
i am using Eclipse IDE and Application runs in firefox.
In that application we have a textbox where data gets populated.It has been developed using Ajax.
Now i can type on that box, that box displays the result in the list too(just like Google search,OR,just like when you开发者_运维问答 suggest tag to your Questions in stack overflow) but i cant select it and submit.
Tried everything but in vain :(
Waiting for a MASTER to Solve it.
Please reply Thanks with anticipation
This is what i tried:
protected void selectDropdoen() throws Exception {
String str = "text to select";
for (int i=0; i<str.length(); i++) {
Thread.sleep(300);
driver.findElementById("input_dealer").sendKeys(""+str.charAt(i));
}
driver.findElementById("input_dealer").setSelected();
driver.getKeyboard().pressKey(Keys.ENTER);
}
Can any one please explain using selenium object to call waitForCondition() function. I am using FireFoxDriver object in my program. Thanks
protected void selectDropdown() throws Exception {
String str = "text to select";
driver.findElement(By.id("input_dealer")).sendKeys(str, Keys.RETURN);
}
精彩评论