Open SnehaJagdale opened 3 years ago
You can't really override the Serenity browser management like that. What problem are you trying to solve?
So on the application I am working, we support Chrome, IEEdge, however for a certain scripts we need to verify that Opera isn't supported. Now we run our scripts in bulk, so basically I am designing the script in such a way, that although I invoke chrome, for this particular script once I set the browser to Opera. I should be able to validate some error messages.
1) Set OperaDriver at runntime. -> Success 2) Launch Application at runtime. -> Success 3) Do some validation, visibility check on the current browser set -> Failure, Chrome is launched.
In the framework, I am passing initial -Ddriver="chrome", now in application I am launching an opera driver for some negative tests.
->>> Opera driver launches here.
When super.getDriver().navigate().to(URL); ->> URL is set.
In another class , invoking the webelements is handled.
By byFieldName=WebUtils.returnByBasedOnPageNameAndObjectName(pageName,fieldName); ->> getting the feild. super.element(byFieldName).waitUntilVisible(); - Log.info("Element visible : " + fieldName); return super.element(byFieldName).isVisible();
At this point allthough browser is set in Opera, browser from Chrome gets launched. Am I missing something here?