I need to set value to primefaces or JSF selectOneMenu using webdriver.
I am able to achieve this using index but could not set value directly.
The following code is working with Index:
driver.findElement(By.name("LNSYNDGLP0_SL_CCY_editableInput")).click();
driver.findElement(By.xpath("//div[@id='LNSYNDGLP0_SL_CCY_panel']/ul/li[7]")).click();
Could anybody please suggest a way to achieve setting value to selectonemenu using Selenium webdriver?
You can use the [text()='item value']
selector in XPath to select the element by its node value.
driver.findElement(By.xpath("//div[@id='LNSYNDGLP0_SL_CCY_panel']/ul/li[text()='item value']")).click();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With