Trying to choose an option from a dropdown list but can't use Select nor arrow keys...

435 views
Skip to first unread message

Ice Tea

unread,
Jun 20, 2018, 12:22:58 AM6/20/18
to Selenium Users
https://stackoverflow.com/questions/50939687/unable-to-click-option-in-dropdown-list-selenium

Problem as stated in the question, these are the errors I get (included so people can find this post when they get the same error in the future) but the full explanation is in the link above >< 

Using Firefox:
ElementNotInteractableException:  Element <option> could not be scrolled into view


Using Chrome: 
ElementNotVisibleException: element not visible: Element is not currently visible and may not be manipulated

total QA

unread,
Jun 20, 2018, 1:13:55 AM6/20/18
to Selenium Users
Hi,

Make sure you select the option only once you click on the Select element.
Please find the Logic mentioned below:

<select id="Day">
<option value="">1</option>
<option value="">2</option>
</select>

Before selecting the option try this way

driver.findElement(By.id("Day")).click();//Let the list is activated..
Go for selection now..new Select(driver.findElement(By.id("Day")).selectByVisibleText("1");

Regards,
Message has been deleted

Ice Tea

unread,
Jun 20, 2018, 2:28:32 AM6/20/18
to Selenium Users
Unforunately I get this error...
AttributeError: 'Select' object has no attribute 'click'

In fact when I hover over the select section in the element tag of the developer tools, I don't see anything highlighted on the actual page..

total QA

unread,
Jun 20, 2018, 5:03:07 AM6/20/18
to Selenium Users
Can you check there is an arrow available for the Listbox. Get the properties of the arrow and click on it.

Regards,

Ice Tea

unread,
Jun 20, 2018, 11:41:58 PM6/20/18
to Selenium Users
I elaborated in the Stack Overflow post but not here but... I can click on the list. I just can't select the option. Is there a way I can click on the option without the Select module?

total QA

unread,
Jun 21, 2018, 2:03:33 AM6/21/18
to Selenium Users
Yes it can be done. by Taking the Xpath of the Option available in the Listbox.

Regards,
Reply all
Reply to author
Forward
0 new messages