-
-
Notifications
You must be signed in to change notification settings - Fork 513
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 driverConfigurationException for remotedriver with cause NO BaseStepListener has been registered when use @beforeClass annotation #2708
Comments
This is normal behaviour. The Webdriver instances are created as part of the test lifecycle, and are not available in @BeforeClass or @BeforeAll methods. What problem are you trying to solve? |
@wakaleo Oh ok. Then why jUnit test cases are passing when I’m giving @BeforeClass. Only the classes which has RunWith CucumberWithSerenity and data driven tests are failing. The map that I’m returning, I can still see it in console but right after that I am getting error for cucumber and datadriven tests. I am trying to return a map which includes from where the test triggered, session id, browser name etc. |
There will be a different browser session for each test, or each feature, or each execution thread, and sometimes multiple browsers per test, so having the browser name/session id captured only once doesn't make much sense in the context of a Serenity test suite. In each test you can see this sort of details in the Info page, e.g |
@wakaleo The requirement for me is, if test is triggered from Jenkins I have to return the key and value for that, along with nodeId, sessionId, etc. if running from IDE , I will return MANUAL as a value for source. Along with that, I will return the browserName and all in console . having each @test returns these info doesn’t have a value added, since we are mentioning the browser, version etc in Jenkins or as part of run configuration. We are running test with grid, so sessionId and nodeId will also be for that entire session. eg: Is there a way to print it once. |
No. As I said, the Session ID will be different for each browser instance, and therefore for each test. If you just want to log this information once, as part of your Jenkins build, do it as part of your Jenkins build job, not as part of the Serenity tests. |
Got it. Thank you so much for your prompt response. |
No problem. In that case can we close this issue or is there something else you wanted to clarify? |
No . I’m good. Thanks again |
In my framework, I have cucumber tests also junit test. Cucumber test runs with @RunWith(cucumberwithSerenity.class) . I gave parameterised test that runs with @RunWith(SerenityParameterizedRunner.class). All my test cases were working.
As part of my enhancement, I added a new method which contains info that needs to be printed or returned before each class . So I used @BeforeClass annotation.
Surprisingly, after that my test failing with couldn’t instantiate chrome remote driver and caused by is “No baseListener registered”.
My jUnit test cases is working fine though.
When I remove @BeforeClass my test is working fine. Is there is any work around to make this work.
Please help
The text was updated successfully, but these errors were encountered: