Error with session id null using Appium and JBehabe

124 views
Skip to first unread message

ricardo larrahondo genoy

unread,
Sep 13, 2017, 1:41:12 PM9/13/17
to Serenity BDD Users Group
I have two stories each one with 1 scenario, after running the test I get session id null exception so the second scenario doesn't run. 

John Smart

unread,
Sep 13, 2017, 1:50:00 PM9/13/17
to ricardo larrahondo genoy, Serenity BDD Users Group
Could you share the stack trace? The second story should run regardless of the result of the first story.

On 13 September 2017 at 19:41, ricardo larrahondo genoy <ricardol...@gmail.com> wrote:
I have two stories each one with 1 scenario, after running the test I get session id null exception so the second scenario doesn't run. 

--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-users+unsubscribe@googlegroups.com.
To post to this group, send email to thucydides-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
___________________________________________________
John Smart | Wakaleo Consulting  |  +44 7398 832273
Making smart teams collaborate better
http://johnfergusonsmart.com  |  john....@wakaleo.com
___________________________________________________

We love breaking down silos and helping smart teams collaborate better! Ask about our tailored on-site workshops in Agile Product Planning, BDD Requirements Discovery,  BDD, TDD and Clean Coding, and Advanced BDD Test Automation.

Need some help with Serenity BDD? Check out our Serenity BDD training and support packages here.
___________________________________________________

ricardo larrahondo genoy

unread,
Sep 13, 2017, 2:01:43 PM9/13/17
to Serenity BDD Users Group
Given James navigates to a section of the app (FAILED)
(net.serenitybdd.core.exceptions.SerenityManagedException: The following error occurred: Session ID is null. Using WebDriver after calling quit()?
Build info: version: '3.5.2', revision: '10229a9', time: '2017-08-21T17:29:55.15Z'
System info: host: 'EN911058', ip: '192.168.156.2', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_131'
Driver info: driver.version: AndroidDriver)
And Wants to return to the home (NOT PERFORMED)
When He taps on miami herald icon (NOT PERFORMED)
Then He should be redirected to the home (NOT PERFORMED)

net.serenitybdd.core.exceptions.SerenityManagedException: The following error occurred: Session ID is null. Using WebDriver after calling quit()?
Build info: version: '3.5.2', revision: '10229a9', time: '2017-08-21T17:29:55.15Z'
System info: host: 'EN911058', ip: '192.168.156.2', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_131'
Driver info: driver.version: AndroidDriver
at net.serenitybdd.core.exceptions.SerenityManagedException.detachedCopyOf(SerenityManagedException.java:21)
at net.thucydides.core.steps.StepInterceptor.runTestStep(StepInterceptor.java:364)
at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:132)
at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:61)
at com.endava.proofconcept.mcclatchy.serenity.mobile.poc.steps.serenity.AndroidMobileUserSteps$$EnhancerByCGLIB$$6cdbed62.navigates_to_a_random_section(<generated>)
at com.endava.proofconcept.mcclatchy.serenity.mobile.poc.steps.NavigationDefinitionSteps.givenJamesNavigatesToASectionOfTheApp(NavigationDefinitionSteps.java:26)
(reflection-invoke)
at org.jbehave.core.steps.StepCreator$ParametrisedStep.perform(StepCreator.java:733)
at org.jbehave.core.embedder.PerformableTree$FineSoFar.run(PerformableTree.java:346)
...

ricardo larrahondo genoy

unread,
Sep 13, 2017, 2:29:54 PM9/13/17
to Serenity BDD Users Group
I think I find the error, In order to use AndroidElement in my Page Object I'm doing this in the constructor 
public BaseScreen(WebDriver driver) {
super(driver);
// Force initialization of elements with appium
// TODO we need to create a MobileImpl version of webelemnts
PageFactory.initElements(new AppiumFieldDecorator(((WebDriverFacade) getDriver()).getProxiedDriver(),
this.getImplicitWaitTimeout().in(TimeUnit.SECONDS), TimeUnit.SECONDS), this);
}


any advice in how can I still use this approach.


El miércoles, 13 de septiembre de 2017, 12:41:12 (UTC-5), ricardo larrahondo genoy escribió:

John Smart

unread,
Sep 13, 2017, 2:32:26 PM9/13/17
to Serenity BDD Users Group, ricardo larrahondo genoy
I'm still confused as to where it is breaking, as the stories should be independent (there should be a fresh driver etc for each new story)

--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-use...@googlegroups.com.
To post to this group, send email to thucydid...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

ricardo larrahondo genoy

unread,
Sep 13, 2017, 2:38:32 PM9/13/17
to Serenity BDD Users Group
I don't know, I'm having a lot of headaches integrating appium,  I think the problem is like it tries to use the previous version of the driver when tries to construct the PageObject. 


El miércoles, 13 de septiembre de 2017, 12:41:12 (UTC-5), ricardo larrahondo genoy escribió:

ricardo larrahondo genoy

unread,
Sep 13, 2017, 4:55:00 PM9/13/17
to Serenity BDD Users Group
This only happens with JBehave or Cucumber, with Junit using uniqueSession there is no problem.


El miércoles, 13 de septiembre de 2017, 12:41:12 (UTC-5), ricardo larrahondo genoy escribió:

ricardo larrahondo genoy

unread,
Sep 18, 2017, 12:41:21 PM9/18/17
to Serenity BDD Users Group
Should I open a ticket in gitHub, @wakaleo can you tell me where can I see the driver instantiation process so I can check If I figure what can be the issue. 


El miércoles, 13 de septiembre de 2017, 12:41:12 (UTC-5), ricardo larrahondo genoy escribió:

John Smart

unread,
Sep 18, 2017, 12:43:56 PM9/18/17
to ricardo larrahondo genoy, Serenity BDD Users Group
Yes, open a ticket. Driver instantiation happens in the DriverProvider classes - there is a different class for each driver (FirefoxDriverProvider, ChromeDriverProvider, AppiumDriverProvider etc).

--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-users+unsubscribe@googlegroups.com.
To post to this group, send email to thucydides-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages