-
-
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
How to register webdriver/actor for current running test? #2450
Comments
Just out of curiosity, why don't you know how many actors you need? I am pretty sure you problem disappears when you get your actors from a |
As @globalworming says, try using an |
I tried this before using managed driver,
I declared this inside a junit rule called
Inside my test script
And for the part where I create actors during runtime. I am calling |
My script creates n instances of something. Each Instance have its own IP. I have to open each IP address in the browser and verify something. |
This way I can make many reusable rules and chain them up. The advantage would be flexibility. Instead of making separate base classes for each small group of tests with slight setup variations. Also it would follow composition over inheritance rule. |
Rules are managed outside the Serenity lifecycle so there is no guarantee that they will work this way. |
I am creating actors during the runtime during a junit test. For these actors screenshots do not appear in the report. From what I have found is that I got to use
inside the test class. As the serenity runner initializes and uses this driver to get screenshots. But I do not know how many actors will be created during runtime. So I am creating actors in the code without predefining them in the main test class.
How can I register drivers of the dynamically created actors ? I have tried this
ThucydidesWebDriverSupport.getWebdriverManager().registerDriver(BrowseTheWeb.as(actor).getDriver());
as the code inside the registerDriver method kinda suggests that it registers the driver to current test.
But it did not work. So how can I pass the webdriver/actors to current test so it can take the screenshots.
The text was updated successfully, but these errors were encountered: