EdgeDriver - Cannot change window size in Edge

Issue #10319887 • Assigned to Steven K.

Details

Author
Andrea T.
Created
Dec 27, 2016
Privacy
This issue is public.
Found in
  • Microsoft Edge
Reports
Reported by 2 people

Sign in to watch or report this issue.

Steps to reproduce

I am using the EdgeDriver for running automation tests on my browser (Edge 38.14393.0.0). My tests are in C#, so I am using the .NET driver:

using OpenQA.Selenium.Remote;
using OpenQA.Selenium.Edge;

var options = new EdgeOptions();
options.PageLoadStrategy = EdgePageLoadStrategy.Normal;

RemoteWebDriver driver = return new EdgeDriver(Environment.CurrentDirectory, options, TimeSpan.FromSeconds(60));

driver.SetDocumentSize(new Size(800, 600)); // HERE!

This code is the one I run at the beginning of the test. And it fails at the last line with:

Class Initialization method
Web.TestSuite.UIRendering.RenderingTestSuiteEdge.TestClassInitialize
threw exception. System.InvalidOperationException:
System.InvalidOperationException: A window size operation failed
because the window is not currently available.

With this stack trace:

OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs: line 1126
OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs: line 920
OpenQA.Selenium.Remote.RemoteWindow.set_Size(Size value) in ...

What is the problem?

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Ibrahim O.”

    • Thank you for your feedback. We are having difficulties reproducing this issue. Could you please test the code below and let us know if it works for you. Please also let us know if we are missing any point regarding to your issue.

        System.Drawing.Size windowSize = new System.Drawing.Size(10, 10);
        driver.Manage().Window.Size = windowSize;

      Best regards,
      The MS Edge Team

    • That is the code which is basically causing this issue. So it seems that this is something very related to my configuration somehow… I will try running one test just with that code extracted from my test framework and see if it still fails and let you know ASAP.

      Did you successfully run those lines with the same version of the driver I pointed out?

    • I’m experiencing this also.

      I run a remotewebdriver instance in an Azure Windows 10 VM.

      If I run a test which maximises the browser with an RDP session open, the test passes.

      If I run a test which maximises the browser without an open RDP session, the test fails.

    • I’m experiencing this also.

      I run a remotewebdriver instance in an Azure Windows 10 VM.

      If I run a test which maximises the browser with an RDP session open, the test passes.

      If I run a test which maximises the browser without an open RDP session, the test fails.

      There are a number of reports of this failure;

      https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9340417/
      https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8778306/
      https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10319887/ https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9734266/
      http://stackoverflow.com/questions/41341763/edgedriver-cannot-change-window-size-in-edge/42226314

    • I’m experiencing this also.
      My tests and the remotedriver instance are in two Virtual machines in a local server.
      I maximize the browser using driver.manage().window().maximize();
      Only one difference:
      -After reboot the machine that hosts the remote web driver, the first time I run the tests, there is no problem, all my tests pass.
      -But if I run the tests again, all my tests fail with the message “A window size operation failed because the window is not currently available”

    • Microsoft Edge Team

      Changed Assigned To from “Ibrahim O.” to “Steven K.”

    You need to sign in to your Microsoft account to add a comment.

    Sign in