0
votes

I've been having a persistent reliability issue when running Cucumber\Watir-Webdriver (Ruby) tests on a TeamCity build agent.

When running the 96-step suite against the CI web app server from a local machine, all tests run green, but running the same tests against the same environment using a Build Agent produces a rash of intermittent errors such as:

Selenium::WebDriver::Error::NoSuchElementError: Unable to locate element: 

Using the WW and PageObject waiting methods just produces intermittent timeouts such as:

Watir::Wait::TimeoutError: timed out after 30 seconds

It's incredibly hard to debug this as it's an intermittent problem with a lead time of about 20 minutes for feedback. In order to improve it, we've upped the RAM on the build agent's host and increased the heap memory available to the Build Agent's process to 4G using the TEAMCITY_SERVER_MEM_OPTS environment variable. This doesn't seem to have helped.

1
Can you post an example step definition for each of these failures? - Johnson
I'll try to do this, but the step defs themselves won't tell you much - they drive an automation library that we've written using WW - Rogue_Leader

1 Answers

0
votes

Is it running at the same resolution?

My team ran into an issue where the build server was running at a different (smaller) resolution than our machines, so it would fail to find an element due to the smaller resolution. The element would be outside the browser window.

We solved this by setting the browser's size to a specific value every time the driver is created so if it would fail on the build machine it would fail on ours as well.