1

I'm trying to setup automatic Selenium tests with Jenkins on a Linux server. The problem is that all tests fail with:

org.openqa.selenium.TimeoutException: Timed out after 60 seconds waiting for visibility of element located by By.linkText

Each test fails with the fist element expected. Jenkins has the Xvfb plugin installed, and from the console messages it seems to work:

Xvfb starting$ /usr/bin/Xvfb :1 -screen 0 1024x768x24

I tried to increase the timeout, but it seems its not that the problem. The tests run fine on windows and on a linux system with display.

The problem is I don't have direct access to the server, so I'm trying to explore all possibilities before I make requests to the sys admins.

To run the tests are used two projects, both seem to deploy fine, but when the tests start its like one project (the backend) is not deployed and some URLs are not found, from here the timeout exception. I'm not very sure how Jenkins behaves in this case, and if it starts one project at a time.

Any ideas? Thanks a lot!

Dani
  • 11
  • 4
  • is this the first command in your test - looking for an element by link.text? – Kaloyan Roussev Jul 30 '13 at 09:26
  • Yes, its waiting for the visibility of element "Login", which I suppose never gets displayed because of the 404 Not Found exceptions. The problem is when trying to access some URL from the back-end I get the 404 exception. I don't understand why the URL is not available... – Dani Jul 30 '13 at 10:01
  • I have the same problem now - its looking for a link that IS there and when I run the tests on Windows its fine, but on the server it cant find this link, in the middle of the test case. Pretty annoying. Have you found a soluition yet? – Kaloyan Roussev Aug 02 '13 at 10:11
  • Sorry, not yet, I will surely post the solution, if I ever find one... – Dani Aug 06 '13 at 08:45
  • well, I solved my problem by completely rewriting the tests from 0, using different methods and different identifiers (ID instead of name, or the other way around) :) – Kaloyan Roussev Aug 06 '13 at 08:55
  • @Dani: Do you now know why the URL is not available?? Have u checked the proxy and the firewall. Firewall was the culprit in my case. – Atul KS Jan 27 '20 at 21:04

1 Answers1

0

To check if the application under test is running when tests try to access it, you can connect to the test machine via ssh, and take screenshot at the moment when the test runs:

xwd -root | convert xwd:- capture.png

http://inspirated.com/2007/04/02/howto-use-xwd-for-screenshots

ikostenko
  • 21
  • 2