Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting null pointer exception when running in jenkins #528

Closed
OmerCeliker opened this issue Sep 14, 2016 · 5 comments
Closed

Getting null pointer exception when running in jenkins #528

OmerCeliker opened this issue Sep 14, 2016 · 5 comments

Comments

@OmerCeliker
Copy link

Your help or direction is appreciated to solving the issue.
The steps to generate the issue is to run "mvn clean verify"
When maven is run from command line it seems to work okay.
when maven is run from jenkins it is not working.

Thanks.

serenity.properties

Define the default driver

webdriver.driver=phantomjs
phantom.binary.path=/usr/bin/phantomjs
webdriver.provided.type=PhantomJSDriver

phantomjs.binary.path=./phantomjs

phantomjs.binary.path=.\phantomjs.exe

#29

webdriver.driver=firefox

webdriver.firefox.bin=C:\Program Files (x86)\Mozilla Firefox\firefox.exe

webdriver.driver=iexplorer

webdriver.ie.driver=C:\Development\Tools\IEDriverServer.exe

webdriver.driver=chrome

webdriver.chrome.driver=C:\Development\Tools\chromedriver.exe

restart.browser.each.scenario=true
webdriver.timeouts.implicitlywait=30000
story.timeout.in.secs=10000
serenity.take.screenshots=FOR_FAILURES
serenity.verbose.steps=false
serenity.report.show.manual.tests=false
untrusted.certificates=true
serenity.timeout=15000

Appears at the top of the reports

serenity.project.name = Demo Project

Root package for any JUnit acceptance tests

serenity.test.root=net.thucydides.showcase.junit.features

Customise your riequirements hierarchy

serenity.requirement.types=feature, story

Run the tests without calling webdriver - useful to check your JBehave wireing

serenity.dry.run=true

Customise browser size

serenity.browser.height = 1200

serenity.browser.width = 1200

Jenkins script

export JAVA_HOME=/opt/jdk1.8.0_65
export PATH=/opt/jdk1.8.0_65/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:$PATH
export PHANTOMJS_BINARY_PATH=/usr/local/bin
export PHANTOMJS_EXECUTABLE_PATH_PROPERTY=/usr/local/bin
set
phantomjs -v
phantomjs ./github.js
ls -ltr github.png

mvn clean verify

serenity_1

serenity_2

@OmerCeliker
Copy link
Author

the stack trace

TEST STARTED: Submitting login form with user and password

Given the user is on the login form page (FAILED)
(java.lang.NullPointerException)
When the user types 'XXXX' in User Name, types 'XXXXX!' in Password, the user clicks login (NOT PERFORMED)
Then the user should see the 'Account Management' in next screen (NOT PERFORMED)

java.lang.NullPointerException
at org.nslc.cm.serenity.bdd.steps.scenariosteps.LoginScenarioSteps.open_login_page(LoginScenarioSteps.java:25)
at org.nslc.cm.serenity.bdd.steps.scenariosteps.LoginScenarioSteps$$EnhancerByCGLIB$$c0d128c0.CGLIB$open_login_page$0()
at org.nslc.cm.serenity.bdd.steps.scenariosteps.LoginScenarioSteps$$EnhancerByCGLIB$$c0d128c0$$FastClassByCGLIB$$875e054e.invoke()
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at net.thucydides.core.steps.StepInterceptor.invokeMethod(StepInterceptor.java:369)
at net.thucydides.core.steps.StepInterceptor.executeTestStepMethod(StepInterceptor.java:354)
at net.thucydides.core.steps.StepInterceptor.runTestStep(StepInterceptor.java:329)
at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:134)
at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:61)
at org.nslc.cm.serenity.bdd.steps.scenariosteps.LoginScenarioSteps$$EnhancerByCGLIB$$c0d128c0.open_login_page()
at org.nslc.cm.serenity.bdd.scenario.LoginScenario.givenTheUserIsOnTheLoginFormPage(LoginScenario.java:22)
(reflection-invoke)
at org.jbehave.core.steps.StepCreator$ParametrisedStep.perform(StepCreator.java:599)
at org.jbehave.core.embedder.PerformableTree$FineSoFar.run(PerformableTree.java:340)
...
[pool-1-thread-1] INFO net.thucydides.core.webdriver.SystemPropertiesConfiguration - project.build.directory : null
[pool-1-thread-1] INFO net.thucydides.core.webdriver.SystemPropertiesConfiguration - project.reporting.OutputDirectory : null
[pool-1-thread-1] INFO net.thucydides.core.webdriver.SystemPropertiesConfiguration - OutputDirectory : /var/lib/jenkins/workspace/SerenityTest/target/site/serenity
[pool-1-thread-1] ERROR net.serenitybdd.core.Serenity -
__ _____ _____ ____ _____ _____ _ ___ _ _____ ____
_ / / |_ | / **| | | / \ | | | | __**| _ \
(
)
| | | | | | ___ \ | | | | / _ \ | || | | _| | | | |
_|
| | | | | |
) || | | / ___ \ | || |**| |**| || |
(
) | | |
| |_____|
/ || ||// _|___|_____|____/
_\

TEST FAILED WITH ERROR: Submitting login form with user and password

[pool-1-thread-1] ERROR net.serenitybdd.core.Serenity - TEST FAILED AT STEP Open login page
[pool-1-thread-1] ERROR net.serenitybdd.core.Serenity -

@wakaleo
Copy link
Member

wakaleo commented Sep 20, 2016

Can you post the code where the null pointer is happening?

@OmerCeliker
Copy link
Author

OmerCeliker commented Sep 20, 2016

A request.
Is there a complete log of all changes based on versions released?
That is very valuable as it is difficult by looking at individual release logs
to see which version of serenity is using which selenium drivers.

I had to switch back to pure selenium java code to find correct jar compatible
with firefox browser we have on linux. We are using Xvnc.

$ firefox -version
Mozilla Firefox 45.3.0

This page helped me do this.
https://github.com/SeleniumHQ/selenium/blob/master/java/CHANGELOG

Pure java selenium code with Cucumber or Jbehave is working but we like the report display feature of
serenity.

Thanks.

sample_modified_code.zip

@wakaleo
Copy link
Member

wakaleo commented Oct 5, 2016

This looks like a problem in the LoginScenarioSteps class (line 25) - what does the code do on this line?

@wakaleo
Copy link
Member

wakaleo commented Nov 1, 2017

Closing due to lack of activity.

@wakaleo wakaleo closed this as completed Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants