My tests run well on my windows machine but fail on jenkins

Hello all,

I encounter a problem that I can’t understand. The tests pass on my Windows machine but fail on jenkins.

I use a Katalon docker that uses a Linux version. The tests have always worked well except recently where I have an XPath error. Here is the error :

2024-06-03 20:57:22.808 ERROR c.runtime.formatter.CucumberReporter     - ❌ I sign contract with OTP code for "adhoc" mode FAILED.
Reason:
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id='sendMode']"}
  (Session info: chrome=125.0.6422.112)
For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'cc927024c839', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.0-101-generic', java.version: '1.8.0_402'
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 125.0.6422.112, chrome: {chromedriverVersion: 125.0.6422.141 (4b1e8393712..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:46527}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
Session ID: 33492117e189b4dbb98cc70aa5ccf8e4
*** Element info: {Using=xpath, value=//*[@id='sendMode']}
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
	at com.kms.katalon.selenium.driver.CChromeDriver.execute(CChromeDriver.java:19)
	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:323)
	at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:428)
	at org.openqa.selenium.By$ByXPath.findElement(By.java:353)
	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:315)
	at org.openqa.selenium.support.events.EventFiringWebDriver.lambda$new$1(EventFiringWebDriver.java:105)
	at com.sun.proxy.$Proxy13.findElement(Unknown Source)
	at org.openqa.selenium.support.events.EventFiringWebDriver.findElement(EventFiringWebDriver.java:194)
	at org.openqa.selenium.WebDriver$findElement$0.call(Unknown Source)
	at common.PopupUtilsSteps.i_select_mode_to_resend_otp(PopupUtilsSteps.groovy:611)
	at common.PopupUtilsSteps$i_select_mode_to_resend_otp$5.call(Unknown Source)
	at common.MailUtilsSteps.I_get_otp_code_from_email(MailUtilsSteps.groovy:91)
	at common.MailUtilsSteps$I_get_otp_code_from_email.call(Unknown Source)
	at common.PopupUtilsSteps.I_sign_contract_with_otp_code(PopupUtilsSteps.groovy:531)
	at ✽.I sign contract with OTP code for "adhoc" mode(/katalon/katalon/source/Include/features/campaigns_with_templates.feature:39)

driver.findElement(By.xpath(“//*[@id=‘sendMode’]”)).sendkeys…etc

Thank you all for your help,

MTO

1 Like

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.

Thanks!

Maybe in Docker we have an issue with certificate that cause the web page could not be loaded and hence web element not be found

Thank you for your suggestion. I will try it and get you informed.