You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @wakaleo
Thanks for code fix for @BeforeAll and @afterall hookup(3.2.0 version). However I have a use-case where in need to setup
something like this.
@BeforeAll
Serenity.setSessionVariable("token_id").to(accessToken);
The above "token_id" I want to retrieve it in Scenario
Serenity.getCurrentSession().get("token_id")-------This is giving null pointer exception. How to resolve this one
The text was updated successfully, but these errors were encountered:
Session data is cleared before each session by default. If you want to preserve session data between sessions, you need to set the serenity.maintain.session property to true (see
Hi Wakaleo,
Thanks for suggesting link. It worked upon configuring serenity.maintain.session = "true" in conf file. However I have observed one thing here.
If you are running tests without parallel execution its working
If you are running tests parallel, then its not working
Looks like it is behaving as expected. If you are running parallel tests, each parallel thread has it's own session. @BeforeAll methods are called in a different thread, and don't have access to the sessions used by the parallel tests. If you need to run your tests in parallel, you can either use a static variable or use a @before method to run at the start of each scenario.
Hi @wakaleo
Thanks for code fix for @BeforeAll and @afterall hookup(3.2.0 version). However I have a use-case where in need to setup
something like this.
@BeforeAll
Serenity.setSessionVariable("token_id").to(accessToken);
The above "token_id" I want to retrieve it in Scenario
Serenity.getCurrentSession().get("token_id")-------This is giving null pointer exception. How to resolve this one
The text was updated successfully, but these errors were encountered: