can't maximize window in Java

Confirmed Issue #8778306 • Assigned to Ben B.

Details

Author
Jonathan P.
Created
Sep 6, 2016
Privacy
This issue is public.
Reports
Reported by 4 people

Sign in to watch or report this issue.

Steps to reproduce

Command:

  driver.manage().window().maximize();

Expected Results:

@Test
public void InitializeEdge() {
    WebDriver driver = null;
    DesiredCapabilities capabilities = null;
    if (System.getProperty("webdriver.edge.driver") == null) {
        System.setProperty("webdriver.edge.driver", "C:\\SeleniumDrivers\\MicrosoftWebDriver.exe");
    }
    capabilities = DesiredCapabilities.edge();
    driver = new EdgeDriver(capabilities);
    driver.manage().window().maximize();
    driver.quit();
}

Setps:

To reproduce this error, in the zip file attached you’ll find a simple maven project.
You can run with “mvn clan install” on the same folder of pom.xml file.
Or you can run with JUnit on EdgeTest.java file if you have Eclipse/Netbeans IDE.

Here is my environment:

OS: Windows 10 Pro - Version: 1511 - Build: 10586.545
Microsoft Edge 25.10.586.0.0 - Microsoft EdgeHTML 13.10586
Open’s with 7 custom pages (such as outlook, facebook, youtube, etc.)
Selenium 3.0.0-Beta3
Usin Edge WebDriver Release 10586
JDK installed: 1.8.0_45
Up to date JRE: 1.8.0_101

Stacktrace:

org.openqa.selenium.NoSuchWindowException: No such window (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 17 milliseconds
Build info: version: 'unknown', revision: 'c7b525d', time: '2016-09-01 14:57:44 -0700'
System info: host: 'xxxxxxxxxxxx', ip: 'xxxxxxxxxxxxxxxx', os.name: 'Windows xx', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_45'
Driver info: org.openqa.selenium.edge.EdgeDriver
Capabilities [{acceptSslCerts=true, browserVersion=25.10586.0.0, platformVersion=10, browserName=MicrosoftEdge, takesScreenshot=true, pageLoadStrategy=normal, takesElementScreenshot=true, platformName=windows, platform=ANY}]
Session ID: XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:631)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:654)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:878)
at testing.Testando.InitializeEdge(Testando.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Attachments

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Brad E.”

    Changed Title from “WebDriver can't maximize window in Java” to “can't maximize window in Java”

    Changed Assigned To to “Mara P.”

    Changed Assigned To from “Mara P.” to “Ben B.”

    Changed Status to “Confirmed”

  • I am using Selenium 2.53.0 and still see this issue. I tried using latest webdriver released as well as an insider build but still this issue occurs.

      DesiredCapabilities capabilities = DesiredCapabilities.edge();
      EdgeDriverService service = new EdgeDriverService.Builder().usingDriverExecutable(edgeDriverPath)
                .usingAnyFreePort().build();
      WebDriver result = new EdgeDriver(service, capabilities);
      result.manage().window().maximize();
    

    ,

    A window size operation failed because the window is not currently available (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 16 milliseconds Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40' System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0' Driver info: org.openqa.selenium.edge.EdgeDriver Capabilities [{applicationCacheEnabled=true, acceptSslCerts=true, browserVersion=38.14393.0.0, platformVersion=10, locationContextEnabled=true, webStorageEnabled=true, browserName=MicrosoftEdge, takesScreenshot=true, pageLoadStrategy=normal, takesElementScreenshot=true, platformName=windows, platform=ANY}] Session ID: 63889C12-AEE9-43E9-92B3-A3EC772AB057
    
    org.openqa.selenium.WebDriverException: A window size operation failed because the window is not currently available (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 16 milliseconds
    Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40'
    System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0'
    Driver info: org.openqa.selenium.edge.EdgeDriver
    Capabilities [{applicationCacheEnabled=true, acceptSslCerts=true, browserVersion=38.14393.0.0, platformVersion=10, locationContextEnabled=true, webStorageEnabled=true, browserName=MicrosoftEdge, takesScreenshot=true, pageLoadStrategy=normal, takesElementScreenshot=true, platformName=windows, platform=ANY}]
    Session ID: 63889C12-AEE9-43E9-92B3-A3EC772AB057
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:88)
        at .(Unknown Source)
        at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
        at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
        at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:945)

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

Sign in