0

I have the following method that keeps failing in Jenkins but working fine locally.

try:
    WebDriverWait(driver.instance, 20).until(ec.element_to_be_clickable((By.XPATH, continue_button))).click()
except StaleElementReferenceException:
    driver.instance.refresh()
    WebDriverWait(driver.instance, 20).until(ec.element_to_be_clickable((By.XPATH, continue_button))).click()

Locally, even without try-catch it works without a problem.

Here is the stack trace in Jenkins

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7ff3d85a3a30>
response = {'status': 404, 'value': '{"value":{"error":"stale element reference","message":"stale element reference: element is n...\\n#17 0x56252ecdf308 \\u003Cunknown>\\n#18 0x56252ecf9a6d \\u003Cunknown>\\n#19 0x7f9690448609 \\u003Cunknown>\\n"}}'}

Looking forward to your help.

DZR
  • 195
  • 1
  • 2
  • 12

1 Answers1

0

Verify that the slave is bringing up the browser, then try running the tests on the slave to test that they run correctly.

There are times when the slaves are started without a graphical environment and the tests are executed without it, causing certain actions to fail

Alex Bravo
  • 25
  • 3