mozilla / geckodriver

WebDriver for Firefox
https://firefox-source-docs.mozilla.org/testing/geckodriver/
Mozilla Public License 2.0
7.11k stars 1.52k forks source link

Set window size through Selenium Grid occasionally doesn't work #2025

Open arnonax-tr opened 2 years ago

arnonax-tr commented 2 years ago

System

Testcase

        [Test]
        [Repeat(100)]
        public void BrowserResolutionFirefox()
        {
            var fxProfile = new FirefoxProfile();
            var driverOptions = new FirefoxOptions { Profile = fxProfile };
            driverOptions.LogLevel = FirefoxDriverLogLevel.Trace;
            using var driver = new RemoteWebDriver(new Uri(GridUrl), driverOptions.ToCapabilities(), TimeSpan.FromMinutes(10));

            driver.Manage().Window.Size = new Size(500, 600);

            var outerWidth = driver.ExecuteJavaScript<long>("return window.outerWidth");
            var outerHeight = driver.ExecuteJavaScript<long>("return window.outerHeight");
            Assert.AreEqual(500, outerWidth, "Width");
            Assert.AreEqual(600, outerHeight, "Height");
        }

Notes:

Stacktrace

  Width
  Expected: 500
  But was:  1224

Trace-level log

Attached. FirefoxSizeLog.txt

whimboo commented 2 years ago

Thanks for the report. We indeed had issues in the past and interestingly in the Firefox Nightly build from yesterday we landed an improvement. Do you have a chance to test your script with such a Firefox build? You can get it from https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly.

I would appreciate your feedback.

arnonax-tr commented 2 years ago

Thanks! I'd be happy to try that build. However, because I can reproduce it only on Selenium Grid, I need an image of Selenium Firefox Node . Can you provide me such an image, or advise how I can create one?

whimboo commented 2 years ago

Sorry, but I'm not familiar with this project. If you aren't able to build we may have to wait with the verification until the patches are in a release build of Firefox. Let me get back to you when it is the case.

arnonax-tr commented 2 years ago

Thanks. In the meantime I'll see if I can somehow work around the docker image and reproduce it without it. I just want you to clarify something: the improvement that you think might resolve the issue is in the Firefox browser's code, not in GeckoDriver?

whimboo commented 2 years ago

Yes, it's a recent fix in Firefox and not geckodriver.

whimboo commented 1 year ago

@arnonax-tr can we now close this issue?

arnonax-tr commented 1 year ago

Thanks! I’ll try to check it this week.

Arnon Axelrod

Chief Automation and CI/CD Architect, eToro

Buy my book: Complete Guide to Test Automation https://www.amazon.com/Complete-Guide-Test-Automation-Maintaining/dp/1484238311

Read my blog: @.***

From: Henrik Skupin @.> Sent: Friday, June 10, 2022 9:21 AM To: mozilla/geckodriver @.> Cc: arnonax-tr @.>; Author @.> Subject: Re: [mozilla/geckodriver] Set window size through Selenium Grid occasionally doesn't work (Issue #2025)

Thanks for the report. We indeed had issues in the past and interestingly in the Firefox Nightly build from yesterday we landed an improvement. Do you have a chance to test your script with such a Firefox build? You can get it from https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly.

I would appreciate your feedback.

— Reply to this email directly, view it on GitHub https://github.com/mozilla/geckodriver/issues/2025#issuecomment-1151998986, or unsubscribe https://github.com/notifications/unsubscribe-auth/APAQFAU4DLMCDK4PXNPASHDVOLNGLANCNFSM5YKIFCVA . You are receiving this because you authored the thread.Message ID: < @.***>