Problems selecting an entity of a drop-down menu

Hello all,

I have a case, where I have to select one of the items of a drop-down menu. I tried many things, but so far I am not able to select the item.

So the test case looks like that:

*** Settings ***
Library SeleniumLibrary

*** Test Cases ***
open browser chrome
maximize browser window
input text xpath=//input[@id=‘CompanyLoginId’] x
input text xpath=//input[@id=‘UsernameLogin’] y
input text xpath=//input[@id=‘PasswordLogin’] z
click element xpath=//button[@id=‘btn_submit_login’]
Wait Until Element Is Visible xpath=//[@id=“m_aside_left_offcanvas_toggle”] timeout=5s
click element xpath=//
Wait Until Element Is Visible xpath=//[@id=“m_ver_menu”]/ul/li[2] timeout=5s
click element xpath=//
Wait Until Element Is Visible xpath=//[@id=“searchRow”]/div/div[2]/span timeout=5s
click element xpath=//
input text xpath=//[@id=“searchRow”]/div/div[2]/span/span[1]/span/span/input Tageseintritt
Press Keys xpath=//
[@id=“searchRow”]/div/div[2]/span/span[1]/span/span/input ENTER

And the element to be found so:

So in the first test case it logs in and selects some context menu. In the second test case it clicks on a field, where a drop-down menu should appear. In this menu I have to select the first element (with the text “Tageseintritt” - it’s German for “a day ticket”). What I tried:

  • Just find its selector - does not work, the drop-down menu disappears as soon as I do a right click on it. I tried to open the Inspect tool first, then click on the drop-down, but the solely thing I see, that when I am hovering on the drop-down menu and moving between its items, something has being changed in the parent element (the value of one of attributes)
  • As you see in the test case, the Press Keys keyword - does not work. It writes an error, that this keyword does not exist and suggests the keyword Press Key instead
  • Instead of the Press Keys keyword the following one: Select From List By Value xpath=//*[@id=“searchRow”]/div/div[2]/span Tageseintritt - does not work, it does not find this list
  • Instead of Press Keys keyword the following one: Click Element xpath=//a[contains(text(),‘Tageseintritt’)] - also finds no element with this label

Could I try something more?


You can inspect the drop-down menu by setting the “Emulate a focused page” on at the Rendering menu of the browser’s developer tools.

Press Keys is new in SeleniumLibrary 3.3. Maybe you should update the library to newer version?