A keyword successfully executed, although it is not

Dear colleagues,

I faced some strange problem (first I have to say, that I am a beginner with Robot Framework). So I have the following test cases:

*** Settings ***
Library SeleniumLibrary

*** Test Cases ***
open browser https://url.com/ chrome
maximize browser window
input text xpath=//input[@id=‘CompanyLoginId’] 1
input text xpath=//input[@id=‘UsernameLogin’] 2
input text xpath=//input[@id=‘PasswordLogin’] 3
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=(//span[text() = ‘Open’])[1]//…//parent::tr//td[not(text())][4] timeout=5s

open context menu xpath=(//span[text() = ‘Open’])[1]//…//parent::tr//td[not(text())][4]
click element xpath=/html/body/ul[3]/li[2]

The first test case is successful. It logs in and opens the page where the 2nd test case starts. The latter just opens some context menu and clicks one of its items. On the 2nd test case there is this problem. The Open context menu keyword is successful, although it does not open it. I integrated Capture Page Screenshot keyword and I can see, that this context menu is not opened (I also tried to scroll down the page - the context menu seems really to be not opened - and not like to be outside of the visible area).

The screenshot from the execution looks like that:

On the marked place the context menu should appear (at least my selector (//span[text() = ‘Open’])[1]//…//parent::tr//td[not(text())][4] finds this place when I enter it in the Inspect tool).

As a result the next keyword of course fails, since the context menu is not in place:

ElementNotInteractableException: Message: element not interactable

What I tried:

  • I tried to use a lot of long sleeps before and after the Open context menu keyword
  • Locally this test case works perfectly - the problem is in place when executing it in Jenkins

Does somebody has an idea?