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

Update Selenium to 4.4.0 to fix DevTools interactions +semver: feature #220

Merged
merged 4 commits into from
Aug 19, 2022

Conversation

mialeska
Copy link
Contributor

@mialeska mialeska commented Aug 16, 2022

to be merged after the Aquality.Selenium.Core library is updated: aquality-automation/aquality-selenium-core-dotnet#99

  • attempt to rework Opera settings (WORKING NOW with a weird workaround):
    Found a solution unexpectedly by comparing java and dotnet implementation and documentation on selenium.dev.
    Solution was to prepare proper ChromeOptions:
  1. set binary to location of launcher.exe

  2. set start arguments: "--remote-debugging-port=9222", "--no-sandbox", "--disable-dev-shm-usage"

  3. ! force set "w3c" to true.
    In java this is quite simple: options.setExperimentalOption("w3c", true);
    In C# such capability is forbidden as already known, so I had to use the reflection to forcibly add it to additionalChromeOptions private dictionary in ChromiumOptions class:

             var field = typeof(ChromiumOptions).GetField("additionalChromeOptions", BindingFlags.NonPublic | BindingFlags.Instance);
             if (field.GetValue(options) is Dictionary<string, object> optionsDictionary)
             {
                 optionsDictionary["w3c"] = true;
                 field.SetValue(options, optionsDictionary);
             }
             options.BinaryLocation = BinaryLocation;
    

Related to bug SeleniumHQ/selenium#10835
Opera native support was removed from Selenium library since version 4.2.0:
SeleniumHQ/selenium@6dcef3a
, and provided example (https://www.selenium.dev/documentation/webdriver/getting_started/open_browser/#opera) from official site is not working
Related discussions:
https://forum.robotframework.org/t/opera-browser-unable-to-open-browser/4086
https://stackoverflow.com/questions/72536114/selenium-driver-failing-with-opera-87-0-4390-45
https://stackoverflow.com/questions/72560244/opera-webdriver-is-not-starting-on-selenium-4
operasoftware/operachromiumdriver#100 (comment)
operasoftware/operachromiumdriver#96 (comment)
SeleniumHQ/selenium#10835 (comment)

- attempt to rework Opera settings (not working yet)
@mialeska mialeska added bug Something isn't working enhancement New feature or request dotnet labels Aug 16, 2022
@mialeska mialeska self-assigned this Aug 16, 2022
@mialeska mialeska requested a review from runetsk-zz August 16, 2022 15:05
@mialeska mialeska changed the title Update Selenium to 4.4.0 to fix DevTools interactions Update Selenium to 4.4.0 to fix DevTools interactions +semver: feature Aug 16, 2022
@mialeska mialeska requested review from aqualityAutomation and a team August 16, 2022 16:38
@mialeska mialeska requested a review from n-verbitsky August 18, 2022 18:35
@mialeska mialeska marked this pull request as ready for review August 19, 2022 11:52
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@mialeska mialeska merged commit b015ccf into master Aug 19, 2022
@mialeska mialeska deleted the support/update-to-selenium-4.4.0 branch August 19, 2022 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dotnet enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant