Unable to Enter data in combobox via Actions class | Selenium Forum
M
Posted on 27/03/2016
i have a combobox....n am suppose to enter data in this combobox & later select a value out of listings....
------------------------------------------------------------------------------------------------------

My code is this....

WebElement SearchGrp=w.findElement(By.xpath("//div[@role='combobox' and @aria-label='Search Facebook']"));
Actions A = new Actions(driver);
A.moveToElement(SearchGrp).build();
A.sendKeys("<grpName>").build().perform();
w.manage().timeouts().pageLoadTimeout(30, TimeUnit.MILLISECONDS);
//A.click(w.findElement(By.xpath("///ul[@id='facebar_typeahead_view_list']/li/span/a/span/span[2]/span/span[2]/span/span[1]"))).build().perform();

[b:3s62hs54]Issue:[/b:3s62hs54]: Anything wrong with code here?
I try to fill in data into combobox & data is put somewherre else.
If i dont use Actions class ,<grpName> goes into appropriate combobox.....

Reference: Have attached pic for reference.

M
Replied on 29/03/2016

i'm not sure what you're trying to do?


M
Replied on 29/03/2016

I enter a fb grp name in the combobox (search facebook) & hit enter...Now it will show a list of predictions(results)...
I need to go click on one of the items in the presdictions.....

Am trying to use Select class , but i get the error message as i posted above...


M
Replied on 30/03/2016

try to find the dynamic xpath for the object instead of select statement.