Reputation: 47
I keep getting this error when i run my cucumber test from Jenkins. My test is perfectly fine when i run it from eclipse. what am i doing wrong in Jenkins?
[31mFailed scenarios:[0m [31mGapLogin.feature:3 [0m# Scenario: Login to Gap
1 Scenarios ([31m1 failed[0m) 3 Steps ([31m1 failed[0m, [36m2 skipped[0m) 0m22.931s
org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":".//*[@id='_GAPLogin_WAR_GAPLoginportlet_:userregform:userid']"} Command duration or timeout: 15.10 seconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58' System info: host: 'B02176', ip: '10.105.129.9', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_79' *** Element info: {Using=xpath, value=.//[@id='_GAPLogin_WAR_GAPLoginportlet_:userregform:userid']} Session ID: af49b00e-63c7-4710-b253-04410d0a8b61 Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities [{platform=WINDOWS, acceptSslCerts=true, javascriptEnabled=true, cssSelectorsEnabled=true, databaseEnabled=true, browserName=firefox, handlesAlerts=true, nativeEvents=false, webStorageEnabled=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=46.0}] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:363) at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:500) at org.openqa.selenium.By$ByXPath.findElement(By.java:361) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:355) at main.java.GapDefinition.LogintoGap(GapDefinition.java:27) at ?.Given I loged in To Gap website(GapLogin.feature:4) Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":".//[@id='_GAPLogin_WAR_GAPLoginportlet_:userregform:userid']"} For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58' System info: host: 'B02176', ip: '10.105.129.9', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_79' Driver info: driver.version: unknown at .FirefoxDriver.prototype.findElementInternal_(file:///C:/Windows/TEMP/anonymous8675081044043132780webdriver-profile/extensions/[email protected]/components/driver-component.js:10770) at .fxdriver.Timer.prototype.setTimeout/<.notify(file:///C:/Windows/TEMP/anonymous8675081044043132780webdriver-profile/extensions/[email protected]/components/driver-component.js:625)
:cucumber FAILED
FAILURE: Build failed with an exception.
Where: Build file 'C:\Program Files (x86)\Jenkins\jobs\GapLogin\workspace\build.gradle' line: 14
What went wrong: Execution failed for task ':cucumber'.
Process 'command 'C:\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 28.997 secs Build step 'Invoke Gradle script' changed build result to FAILURE Build step 'Invoke Gradle script' marked build as failure Finished: FAILURE
Upvotes: 0
Views: 877
Reputation: 4323
Your first problem is a NoSuchElementException. It is a Selenium exception. Selenium is unable to locate an element.
I would trouble shoot this issue from the perspective that your ci server is different from your local environment and Theresienstadt causing the problem.
Upvotes: 1