The first click opens the select box, but the second click always fails.
My thougt was that i have to first click on the select to open it, second click on Option 3
I can see that the select is clicked, because it opens up.
I trid the forec=true in click
The Error i am getting is:
Error: locator.click: Element is not visible
=========================== logs ===========================
waiting for locator(‘xpath=//html/body/select/option[3]’)
locator resolved to option value=“1” 1 /option
attempting click action
waiting for element to be visible, enabled and stable
forcing action
element is visible, enabled and stable
scrolling into view if needed
I also tried to set the focus on the Option.
But I always get the ‘Element is not visible’ Error.
I have no clue what the problem is.
Thanks
Hi Dave,
if i try
Select Options By xpath=//select index 3
nothing happens.
I would expect that option 3 gets selected but nothing.
Maybe i don’t understand Select Option By.
Just read the Documentation there it says:
Returns list of options which keyword was able to select. The type of list item matches to attribute definition. Example if attribute equals to label returned list contains label values. Or in case of index it contains list of selected indexes.<
If you don’t want to use Select Option By, try this approach:
Click Element //*[@value=“3”]
If that works, I recommend using a variable to make it more reusable.
For example:
Click Element //*[@value=“${variable}”]
Another option could be by text:
Click Element //*[text(),“${variable}”]