Test case passes locally, but fails on Jenkins

5,110 views
Skip to first unread message

Patrick Meurer

unread,
Jan 19, 2017, 6:55:27 AM1/19/17
to robotframe...@googlegroups.com
When I run the test locally using RIDE/Firefox, it passes 100% of the time.
When I push them to Jenkins, they fail with "Element locator '//div[@class='Select-menu-outer']' did not match any elements after 1 minute"

Here is what the code looks like:

Open Browser <URL>
Wait Until Element Is Visible    //div[@class='modal-content']   
Focus    //div[@class='Select-input ']/input   
Input Text    //div[@class='Select-input ']/input    ${city}
sleep    3 seconds   
Wait Until Element Is Visible    //div[@class='Select-menu-outer']    timeout=60 seconds
Click Element    //div[@data-reactid='.5.1.0.0.$=10.0.0.0.0.1.0.0.2.0.$option-${city}']   
Wait Until Page Contains Element    //tr[@data-resultid]    timeout=5 seconds    error="No offers where shown on the hitlist"


Any ideas why I cannot make it work on Jenkins?

Bryan Oakley

unread,
Jan 19, 2017, 9:37:42 AM1/19/17
to robotframework-users
Did you look at the screenshot that the seleinum library takes? Does the page look correct?


On Thu, Jan 19, 2017 at 5:55 AM, 'Patrick Meurer' via robotframework-users <robotframe...@googlegroups.com> wrote:
When I run the test locally using RIDE/Firefox, it passes 100% of the time.
When I push them to Jenkins, they fail with "Element locator ' did not match any elements after 1 minute"


Here is what the code looks like:

Open Browser <URL>
Wait Until Element Is Visible    //div[@class='modal-content']   
Focus    //div[@class='Select-input ']/input   
Input Text    //div[@class='Select-input ']/input    ${city}
sleep    3 seconds   
Wait Until Element Is Visible    //div[@class='Select-menu-outer']    timeout=60 seconds
Click Element    //div[@data-reactid='.5.1.0.0.$=10.0.0.0.0.1.0.0.2.0.$option-${city}']   
Wait Until Page Contains Element    //tr[@data-resultid]    timeout=5 seconds    error="No offers where shown on the hitlist"


Any ideas why I cannot make it work on Jenkins?

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Rafael Silva

unread,
Jan 19, 2017, 10:18:48 AM1/19/17
to robotframework-users
Hi!

Try use 'Id' and increase timeout:

Wait Until Element Is Visible    Id=XXXX    timeout=120


...and start test on Jenkins but see the test running, not just the results. And look with attention this step.


good look

Paolo De Grazia

unread,
Jan 19, 2017, 6:10:48 PM1/19/17
to robotframework-users
The way I would investigate it:
1) Start an X session on the jenkins machine
Ssh -X your.machine.address
2) run your test via command line IN THE BACKGROUND (test will be run in a background thread,thus not blocking any other ongoing task)

Pybot mytestcase.txt & (notice the & is to run the task in the background)
3) see what is actually going on on the test case
Sometimes these problems are just related to a difference in Firefox and the selenium library,make sure your configuration is the same as the one you have on your machine or experiment with different versions,you might just find a trade off


Good testing!

Gu Ru

unread,
Jan 21, 2017, 7:18:29 AM1/21/17
to robotframework-users
Its a cat and mouse game. Runing UI test in background and fixing with delays those false positive cases in that remote box, to me is waste of ones energy

If i have tested things based on my local, in foreground, a UI test, I would do same set up, in the remote box, from where UI test are to be executed

Reply all
Reply to author
Forward
0 new messages