firefox - Primefaces selectOneMenu with Selenium webdriver does not select the item + Java -
i need set value on p:selectonemenu during selenium test having problem set value. here code used that:
{ driver.findelement(by.id("myform:meselection_label")).click(); driver.findelement(by.xpath("//div[@id='myform:meselection_panel']/div[2]/ul/li[text() = 'mytext']")).click(); }
problem not select selection, tried use index on li (e.g. /li[2]) second item. when run test shows dropdown list , can see elements in not select element. , yes, have converter on object. tried selenium ide , put xpath in there same above , works fine, in test case in java not select element @ all.
i searched net , forums not find solutions it. seams people had problems no answers posted on these questions.
here pom.xml dependencies testing:
{ <dependency> <groupid>org.seleniumhq.selenium.client-drivers</groupid> <artifactid>selenium-java-client-driver</artifactid> <version>1.0.2</version> <scope>test</scope> </dependency> <dependency> <groupid>org.seleniumhq.selenium</groupid> <artifactid>selenium-java</artifactid> <version>2.40.0</version> </dependency> <dependency> <groupid>org.seleniumhq.selenium</groupid> <artifactid>selenium-firefox-driver</artifactid> <version>2.40.0</version> </dependency> }
any appreciated.
for select lists need create selenium select object.
webelement = find element(by.cssselector("whatever select is")) select s = new select(we); s.selectbyvalue("value select")
pseudo code didn't test it
Comments
Post a Comment