Skip to content
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

Serenity chromedriver capabilities are not working with BeforeAWebdriverScenario, but working with chrome.switches. #2513

Closed
tiwari90 opened this issue Jul 20, 2021 · 16 comments

Comments

@tiwari90
Copy link

created a sample repo with the same issue.
https://github.com/tiwari90/SerenityCapabilityIssue.git

@tiwari90 tiwari90 changed the title Serenity capabilities are not working with BeforeAWebdriverScenario, but working with chrome.switches. Serenity chromedriver capabilities are not working with BeforeAWebdriverScenario, but working with chrome.switches. Jul 20, 2021
@wakaleo
Copy link
Member

wakaleo commented Jul 20, 2021

Can you propose a PR?

@tiwari90
Copy link
Author

@wakaleo Is this a known issue?

@wakaleo
Copy link
Member

wakaleo commented Jul 20, 2021

No. I'd recommend putting a breakpoint and seeing what the code is doing behind the scenes.

@tiwari90
Copy link
Author

I tried and observed that Serenity is reading and setting all the capabilities in the background, also printing it on the console as well, during execution. But still, it's not applying.

@wakaleo
Copy link
Member

wakaleo commented Jul 20, 2021

Have a look at the ChromeDriverProvider class - that is where the new ChromeDriver instance is created.

@tiwari90
Copy link
Author

WebDriver newDriver = ProvideNewDriver.withConfiguration(environmentVariables,
enhancedCapabilities,
driverServicePool,
DriverServicePool::newDriver,
(pool, capabilities) -> new ChromeDriver(enhancedChromeOptions)
);

Below is the value passed for enhancedChromeOptions variable:

Capabilities {acceptInsecureCerts: false, acceptSslCerts: true, browserName: chrome, goog:chromeOptions: {args: [--disable-gpu, --start-maximized, use-fake-device-for-media-s..., use-fake-ui-for-media-stream], extensions: [], prefs: {download.default_directory: C:\Users\Ashish\git\qa-te..., download.prompt_for_download: false, plugins.always_open_pdf_externally: true, plugins.plugins_disabled: [Adobe Flash Player], profile.default_content_settings.popups: 0}}, loggingPrefs: org.openqa.selenium.logging..., platform: ANY, version: }

I personally don't see any issue with this.
Can you please have a look once?

@wakaleo
Copy link
Member

wakaleo commented Jul 20, 2021

If you can update your sample project so that it runs in all environments (no tests currently run when you run mvn verify) and reproduces the issue, it will be easier for folk to pick it up and see if anything is amiss.

@tiwari90
Copy link
Author

Done,
Added sample test class in pom.xml

@wakaleo
Copy link
Member

wakaleo commented Jul 20, 2021

Your sample project only works on Windows.

@tiwari90
Copy link
Author

Added driver for Linux and Mac as well

@tiwari90
Copy link
Author

@wakaleo did you get a chance to look into it?

@wakaleo
Copy link
Member

wakaleo commented Jul 22, 2021

Is it urgent? Is it something you need for your work?

@tiwari90
Copy link
Author

not that urgent, as chrome.switches, are already there as a workaround.

@tiwari90
Copy link
Author

tiwari90 commented Aug 9, 2021

@wakaleo Did you get a chance to look into it?

@wakaleo
Copy link
Member

wakaleo commented Aug 10, 2021

No

@wakaleo wakaleo closed this as completed Feb 12, 2022
@ravibabu1408
Copy link

Hi all, Currently i am running serenity bdd tests with browser stack, looks like the tests are running on browserstack but not being taking browser capabilities, can anyone please help me whats the wrong here?
capabilities {
browserName = "Firefox"
#
# Any BrowserStack-specific options go in the 'bstack:options' section
#
"bstack:options" {
os = "Windows"
osVersion = "11"
browserVersion = "107.0"
local = false
resolution = "1920x1200"
#seleniumVersion = "4.6.0"
video = true
idleTimeout = 300
buildName= "browserstack-build-1"
#browserstack.networkLogs=true
#browserstack.consoleLogs=errors
debug= true
consoleLogs=errors
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants