1
votes

Why my keyword

Push
    [Arguments]    ${element}
    Wait Until Element Is Visible    ${element}
    Click Element    ${element}

doesn't always work? I have a test file where I'm using it about 50 times. There is only one element

<button id="x" ...>

which doesn't work always with the Push keyword. Pushing the element should generate extra text field to the screen. Maybe every second push button x is working correctly. When pushing the button x fails I can see in the screenshot that the button is hoovered, but there is not an extra text field y generated from pushing the button. The error message is that element y is not found in the page and also in the screenshot the element y is not in the page. In the error situation the test waits 20 seconds for the element.

How to fix the situation? Or is there bug with our application?? When I run our application manually there is never problem with the functionality.

What is difference between the keywords Wait Until Element Is Visible and Wait Until Element Is Clickable?

I tried also with Wait Until Element Is Clickable and also with it the test is not always working (the element y is not found in the page).

1
What does "doesn't work" mean in this context? Does selenium register the click but nothing happens? Do you get an "element not clickable" error? Something else?Bryan Oakley
I edited my questionSakke

1 Answers

1
votes

This issue might be related to a few things depending on how the page loads. A few suggestions from my own work:

  1. Set a slight selenium speed of maybe 0.01s or so and see if it improves execution. I have noticed that in chrome that sometimes execution is a little to quick and it causes flaky tests.

  2. If you page contains JavaScript it’s best to wait until they are finished completing. I use a library for this we developed in house that extends the seleniumLibrary that I will link below. It also includes keywords like ‘Wait for and Click...’ and such that makes scenarios like above a lot cleaner to write.

https://github.com/Accruent/zoomba

Note that it requires python 3 but if you go back some real sees you can get a python 2 version but it’s not maintained anymore.