c# - Accessing JQuery Auto complete with Selenium Webdriver -
i trying html of jquery autocomplete after word typed in. decided seek selenium webdriver.
i had read of documentation , think got couple of issue.
1) i'ts not finding search suggestions although pretty sure selecting right
2) don't know how html string iwebelement.
here code doesn't work:
iwebdriver driver = new firefoxdriver(); driver.navigate().gotourl("https://site.xxx/"); iwebelement query = driver.findelement(by.name("stext")); query.sendkeys("iphone"); // point works, set wait in here incase takes few seconds load webdriverwait wait = new webdriverwait(driver, timespan.fromseconds(2)); // seems come empty in developer tools chrome can see iwebelement results = driver.findelement(by.classname("ac_results"));
can see going wrong?
on result phone call add together .text(); end text value of element. java syntax.
string val = driver.findelement(by.classname("ac_results")).text();
or
webelement driver.findelement(by.classname("ac_results")); string val = we.text();
c# selenium-webdriver
No comments:
Post a Comment