Selenium: org.openqa.selenium.NoSuchWindowException: Currently focused window has been closed












5
















  1. System.setProperty("webdriver.ie.driver", "D:SeleniumjarsIEDriverServerIEDriverServer.exe");

  2. WebDriver driver = new InternetExplorerDriver();

  3. driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

  4. driver.get("http://the-internet.herokuapp.com");

  5. driver.findElement(By.linkText("Forgot Password")).click();

  6. Thread.sleep(3000);

  7. driver.findElement(By.id("email")).sendKeys("testmail@mail.com");


when i run the above code it is working fine with chrome and firefox but when i run using IE it is throwing below error when running 7th step don't understand y it is not working in IE.



Could some one please help me in resolve this issue. Thanks in advance



Nov 20, 2017 2:58:39 PM org.openqa.selenium.remote.ErrorCodes toStatus
INFO: HTTP Status: '404' -> incorrect JSON status mapping for 'no such window' (400 expected)



org.openqa.selenium.NoSuchWindowException: Currently focused window has been closed.
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z'
System info: host: 'ML-SIVAKUMARS-P', ip: '192.168.12.159', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{proxy=Proxy(), acceptInsecureCerts=false, browserVersion=11, se:ieOptions={nativeEvents=true, browserAttachTimeout=0, ie.ensureCleanSession=false, elementScrollBehavior=0, enablePersistentHover=true, ie.browserCommandLineSwitches=, ie.forceCreateProcessApi=false, requireWindowFocus=false, initialBrowserUrl=http://localhost:2761/, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, ignoreProtectedModeSettings=false}, timeouts={implicit=0, pageLoad=300000, script=30000}, browserName=internet explorer, pageLoadStrategy=normal, javascriptEnabled=true, platformName=WINDOWS, setWindowRect=true, platform=WINDOWS}]
Session ID: 24a4d291-482e-4399-98fc-f2037c4da5bb
*** Element info: {Using=id, value=email}



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:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:185)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:120)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:586)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:356)
at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:402)
at org.openqa.selenium.By$ById.findElement(By.java:218)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:348)
at com.org.learning.tests.TestDayTwo.firstTest(TestDayTwo.java:38)
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:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:744)
at org.testng.TestRunner.run(TestRunner.java:602)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)
at org.testng.TestNG.run(TestNG.java:1115)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)









share|improve this question





























    5
















    1. System.setProperty("webdriver.ie.driver", "D:SeleniumjarsIEDriverServerIEDriverServer.exe");

    2. WebDriver driver = new InternetExplorerDriver();

    3. driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

    4. driver.get("http://the-internet.herokuapp.com");

    5. driver.findElement(By.linkText("Forgot Password")).click();

    6. Thread.sleep(3000);

    7. driver.findElement(By.id("email")).sendKeys("testmail@mail.com");


    when i run the above code it is working fine with chrome and firefox but when i run using IE it is throwing below error when running 7th step don't understand y it is not working in IE.



    Could some one please help me in resolve this issue. Thanks in advance



    Nov 20, 2017 2:58:39 PM org.openqa.selenium.remote.ErrorCodes toStatus
    INFO: HTTP Status: '404' -> incorrect JSON status mapping for 'no such window' (400 expected)



    org.openqa.selenium.NoSuchWindowException: Currently focused window has been closed.
    Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z'
    System info: host: 'ML-SIVAKUMARS-P', ip: '192.168.12.159', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_121'
    Driver info: org.openqa.selenium.ie.InternetExplorerDriver
    Capabilities [{proxy=Proxy(), acceptInsecureCerts=false, browserVersion=11, se:ieOptions={nativeEvents=true, browserAttachTimeout=0, ie.ensureCleanSession=false, elementScrollBehavior=0, enablePersistentHover=true, ie.browserCommandLineSwitches=, ie.forceCreateProcessApi=false, requireWindowFocus=false, initialBrowserUrl=http://localhost:2761/, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, ignoreProtectedModeSettings=false}, timeouts={implicit=0, pageLoad=300000, script=30000}, browserName=internet explorer, pageLoadStrategy=normal, javascriptEnabled=true, platformName=WINDOWS, setWindowRect=true, platform=WINDOWS}]
    Session ID: 24a4d291-482e-4399-98fc-f2037c4da5bb
    *** Element info: {Using=id, value=email}



    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:423)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:185)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:120)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:586)
    at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:356)
    at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:402)
    at org.openqa.selenium.By$ById.findElement(By.java:218)
    at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:348)
    at com.org.learning.tests.TestDayTwo.firstTest(TestDayTwo.java:38)
    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:498)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
    at org.testng.TestRunner.privateRun(TestRunner.java:744)
    at org.testng.TestRunner.run(TestRunner.java:602)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
    at org.testng.SuiteRunner.run(SuiteRunner.java:289)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
    at org.testng.TestNG.runSuites(TestNG.java:1144)
    at org.testng.TestNG.run(TestNG.java:1115)
    at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
    at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)









    share|improve this question



























      5












      5








      5


      1







      1. System.setProperty("webdriver.ie.driver", "D:SeleniumjarsIEDriverServerIEDriverServer.exe");

      2. WebDriver driver = new InternetExplorerDriver();

      3. driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

      4. driver.get("http://the-internet.herokuapp.com");

      5. driver.findElement(By.linkText("Forgot Password")).click();

      6. Thread.sleep(3000);

      7. driver.findElement(By.id("email")).sendKeys("testmail@mail.com");


      when i run the above code it is working fine with chrome and firefox but when i run using IE it is throwing below error when running 7th step don't understand y it is not working in IE.



      Could some one please help me in resolve this issue. Thanks in advance



      Nov 20, 2017 2:58:39 PM org.openqa.selenium.remote.ErrorCodes toStatus
      INFO: HTTP Status: '404' -> incorrect JSON status mapping for 'no such window' (400 expected)



      org.openqa.selenium.NoSuchWindowException: Currently focused window has been closed.
      Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z'
      System info: host: 'ML-SIVAKUMARS-P', ip: '192.168.12.159', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_121'
      Driver info: org.openqa.selenium.ie.InternetExplorerDriver
      Capabilities [{proxy=Proxy(), acceptInsecureCerts=false, browserVersion=11, se:ieOptions={nativeEvents=true, browserAttachTimeout=0, ie.ensureCleanSession=false, elementScrollBehavior=0, enablePersistentHover=true, ie.browserCommandLineSwitches=, ie.forceCreateProcessApi=false, requireWindowFocus=false, initialBrowserUrl=http://localhost:2761/, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, ignoreProtectedModeSettings=false}, timeouts={implicit=0, pageLoad=300000, script=30000}, browserName=internet explorer, pageLoadStrategy=normal, javascriptEnabled=true, platformName=WINDOWS, setWindowRect=true, platform=WINDOWS}]
      Session ID: 24a4d291-482e-4399-98fc-f2037c4da5bb
      *** Element info: {Using=id, value=email}



      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:423)
      at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:185)
      at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:120)
      at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
      at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
      at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
      at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:586)
      at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:356)
      at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:402)
      at org.openqa.selenium.By$ById.findElement(By.java:218)
      at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:348)
      at com.org.learning.tests.TestDayTwo.firstTest(TestDayTwo.java:38)
      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:498)
      at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
      at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
      at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
      at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
      at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
      at org.testng.TestRunner.privateRun(TestRunner.java:744)
      at org.testng.TestRunner.run(TestRunner.java:602)
      at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
      at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
      at org.testng.SuiteRunner.run(SuiteRunner.java:289)
      at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
      at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
      at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
      at org.testng.TestNG.runSuites(TestNG.java:1144)
      at org.testng.TestNG.run(TestNG.java:1115)
      at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
      at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)









      share|improve this question

















      1. System.setProperty("webdriver.ie.driver", "D:SeleniumjarsIEDriverServerIEDriverServer.exe");

      2. WebDriver driver = new InternetExplorerDriver();

      3. driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

      4. driver.get("http://the-internet.herokuapp.com");

      5. driver.findElement(By.linkText("Forgot Password")).click();

      6. Thread.sleep(3000);

      7. driver.findElement(By.id("email")).sendKeys("testmail@mail.com");


      when i run the above code it is working fine with chrome and firefox but when i run using IE it is throwing below error when running 7th step don't understand y it is not working in IE.



      Could some one please help me in resolve this issue. Thanks in advance



      Nov 20, 2017 2:58:39 PM org.openqa.selenium.remote.ErrorCodes toStatus
      INFO: HTTP Status: '404' -> incorrect JSON status mapping for 'no such window' (400 expected)



      org.openqa.selenium.NoSuchWindowException: Currently focused window has been closed.
      Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z'
      System info: host: 'ML-SIVAKUMARS-P', ip: '192.168.12.159', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_121'
      Driver info: org.openqa.selenium.ie.InternetExplorerDriver
      Capabilities [{proxy=Proxy(), acceptInsecureCerts=false, browserVersion=11, se:ieOptions={nativeEvents=true, browserAttachTimeout=0, ie.ensureCleanSession=false, elementScrollBehavior=0, enablePersistentHover=true, ie.browserCommandLineSwitches=, ie.forceCreateProcessApi=false, requireWindowFocus=false, initialBrowserUrl=http://localhost:2761/, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, ignoreProtectedModeSettings=false}, timeouts={implicit=0, pageLoad=300000, script=30000}, browserName=internet explorer, pageLoadStrategy=normal, javascriptEnabled=true, platformName=WINDOWS, setWindowRect=true, platform=WINDOWS}]
      Session ID: 24a4d291-482e-4399-98fc-f2037c4da5bb
      *** Element info: {Using=id, value=email}



      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:423)
      at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:185)
      at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:120)
      at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
      at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
      at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
      at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:586)
      at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:356)
      at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:402)
      at org.openqa.selenium.By$ById.findElement(By.java:218)
      at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:348)
      at com.org.learning.tests.TestDayTwo.firstTest(TestDayTwo.java:38)
      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:498)
      at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
      at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
      at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
      at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
      at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
      at org.testng.TestRunner.privateRun(TestRunner.java:744)
      at org.testng.TestRunner.run(TestRunner.java:602)
      at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
      at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
      at org.testng.SuiteRunner.run(SuiteRunner.java:289)
      at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
      at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
      at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
      at org.testng.TestNG.runSuites(TestNG.java:1144)
      at org.testng.TestNG.run(TestNG.java:1115)
      at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
      at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)






      selenium






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 '17 at 5:08







      siva

















      asked Nov 20 '17 at 9:30









      sivasiva

      35114




      35114
























          4 Answers
          4






          active

          oldest

          votes


















          4














          I have been struggling with the same problem since yesterday and finally got my test to work.

          Check if you have all the required configurations for the InternetExplorerDriver. For me it was the protected mode settings which I finally tested even though I am on Win 10.

          Hope it helps you, too.






          share|improve this answer
























          • Many Thanks Zucchini. It's working by setting. For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE. Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.. You saved my time, once again thanks

            – siva
            Nov 24 '17 at 5:18













          • The following error should be happened if Protected Mode settings are not the same: org.openqa.selenium.SessionNotCreatedException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones.

            – Ripon Al Wasim
            Jan 12 '18 at 12:54



















          5














          There are 2 ways:



          Way 1: Setting INITIAL_BROWSER_URL:



          File ieFile = new File("D:\IEDriverServer_x64_2.53.0\IEDriverServer.exe");
          System.setProperty("webdriver.ie.driver", ieFile.getAbsolutePath());
          DesiredCapabilities ieCaps = DesiredCapabilities.internetExplorer();
          ieCaps.setCapability(InternetExplorerDriver.INITIAL_BROWSER_URL, "http://www.bing.com/");
          driver = new InternetExplorerDriver(ieCaps);
          //some operations on that site
          driver.findElement(By.id("sb_form_q")).clear();
          driver.findElement(By.id("sb_form_q")).sendKeys("Ripon Al Wasim");
          driver.findElement(By.id("sb_form_go")).click();


          Way 2: To set a registry entry on the target computer:
          For IE 11 only, you will need to set a registry entry on the target computer so that the driver can maintain a connection to the instance of Internet Explorer it creates.



          For 32-bit Windows: The key you must examine in the registry editor is HKEY_LOCAL_MACHINESOFTWAREMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE.



          For 64-bit Windows: The key is HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE.



          Note: Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.



          enter image description here



          For more details you can visit: https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration






          share|improve this answer

































            0














            In my case I was getting the error due to missing slash at last of URL "/"



            Actual is http://example.com/
            but I was passing http://example.com






            share|improve this answer

































              0














              There are three Settings :




              1. Zoom level set to 100%

              2. Unchecked the Internet Options --> Security--> For Internet and Trusted sites

              3. Unchecked Unable Protected Mode






              share|improve this answer

























                Your Answer






                StackExchange.ifUsing("editor", function () {
                StackExchange.using("externalEditor", function () {
                StackExchange.using("snippets", function () {
                StackExchange.snippets.init();
                });
                });
                }, "code-snippets");

                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "1"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47388733%2fselenium-org-openqa-selenium-nosuchwindowexception-currently-focused-window-ha%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                4














                I have been struggling with the same problem since yesterday and finally got my test to work.

                Check if you have all the required configurations for the InternetExplorerDriver. For me it was the protected mode settings which I finally tested even though I am on Win 10.

                Hope it helps you, too.






                share|improve this answer
























                • Many Thanks Zucchini. It's working by setting. For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE. Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.. You saved my time, once again thanks

                  – siva
                  Nov 24 '17 at 5:18













                • The following error should be happened if Protected Mode settings are not the same: org.openqa.selenium.SessionNotCreatedException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones.

                  – Ripon Al Wasim
                  Jan 12 '18 at 12:54
















                4














                I have been struggling with the same problem since yesterday and finally got my test to work.

                Check if you have all the required configurations for the InternetExplorerDriver. For me it was the protected mode settings which I finally tested even though I am on Win 10.

                Hope it helps you, too.






                share|improve this answer
























                • Many Thanks Zucchini. It's working by setting. For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE. Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.. You saved my time, once again thanks

                  – siva
                  Nov 24 '17 at 5:18













                • The following error should be happened if Protected Mode settings are not the same: org.openqa.selenium.SessionNotCreatedException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones.

                  – Ripon Al Wasim
                  Jan 12 '18 at 12:54














                4












                4








                4







                I have been struggling with the same problem since yesterday and finally got my test to work.

                Check if you have all the required configurations for the InternetExplorerDriver. For me it was the protected mode settings which I finally tested even though I am on Win 10.

                Hope it helps you, too.






                share|improve this answer













                I have been struggling with the same problem since yesterday and finally got my test to work.

                Check if you have all the required configurations for the InternetExplorerDriver. For me it was the protected mode settings which I finally tested even though I am on Win 10.

                Hope it helps you, too.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 22 '17 at 17:45









                ZucchiniZucchini

                617




                617













                • Many Thanks Zucchini. It's working by setting. For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE. Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.. You saved my time, once again thanks

                  – siva
                  Nov 24 '17 at 5:18













                • The following error should be happened if Protected Mode settings are not the same: org.openqa.selenium.SessionNotCreatedException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones.

                  – Ripon Al Wasim
                  Jan 12 '18 at 12:54



















                • Many Thanks Zucchini. It's working by setting. For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE. Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.. You saved my time, once again thanks

                  – siva
                  Nov 24 '17 at 5:18













                • The following error should be happened if Protected Mode settings are not the same: org.openqa.selenium.SessionNotCreatedException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones.

                  – Ripon Al Wasim
                  Jan 12 '18 at 12:54

















                Many Thanks Zucchini. It's working by setting. For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE. Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.. You saved my time, once again thanks

                – siva
                Nov 24 '17 at 5:18







                Many Thanks Zucchini. It's working by setting. For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE. Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.. You saved my time, once again thanks

                – siva
                Nov 24 '17 at 5:18















                The following error should be happened if Protected Mode settings are not the same: org.openqa.selenium.SessionNotCreatedException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones.

                – Ripon Al Wasim
                Jan 12 '18 at 12:54





                The following error should be happened if Protected Mode settings are not the same: org.openqa.selenium.SessionNotCreatedException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones.

                – Ripon Al Wasim
                Jan 12 '18 at 12:54













                5














                There are 2 ways:



                Way 1: Setting INITIAL_BROWSER_URL:



                File ieFile = new File("D:\IEDriverServer_x64_2.53.0\IEDriverServer.exe");
                System.setProperty("webdriver.ie.driver", ieFile.getAbsolutePath());
                DesiredCapabilities ieCaps = DesiredCapabilities.internetExplorer();
                ieCaps.setCapability(InternetExplorerDriver.INITIAL_BROWSER_URL, "http://www.bing.com/");
                driver = new InternetExplorerDriver(ieCaps);
                //some operations on that site
                driver.findElement(By.id("sb_form_q")).clear();
                driver.findElement(By.id("sb_form_q")).sendKeys("Ripon Al Wasim");
                driver.findElement(By.id("sb_form_go")).click();


                Way 2: To set a registry entry on the target computer:
                For IE 11 only, you will need to set a registry entry on the target computer so that the driver can maintain a connection to the instance of Internet Explorer it creates.



                For 32-bit Windows: The key you must examine in the registry editor is HKEY_LOCAL_MACHINESOFTWAREMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE.



                For 64-bit Windows: The key is HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE.



                Note: Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.



                enter image description here



                For more details you can visit: https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration






                share|improve this answer






























                  5














                  There are 2 ways:



                  Way 1: Setting INITIAL_BROWSER_URL:



                  File ieFile = new File("D:\IEDriverServer_x64_2.53.0\IEDriverServer.exe");
                  System.setProperty("webdriver.ie.driver", ieFile.getAbsolutePath());
                  DesiredCapabilities ieCaps = DesiredCapabilities.internetExplorer();
                  ieCaps.setCapability(InternetExplorerDriver.INITIAL_BROWSER_URL, "http://www.bing.com/");
                  driver = new InternetExplorerDriver(ieCaps);
                  //some operations on that site
                  driver.findElement(By.id("sb_form_q")).clear();
                  driver.findElement(By.id("sb_form_q")).sendKeys("Ripon Al Wasim");
                  driver.findElement(By.id("sb_form_go")).click();


                  Way 2: To set a registry entry on the target computer:
                  For IE 11 only, you will need to set a registry entry on the target computer so that the driver can maintain a connection to the instance of Internet Explorer it creates.



                  For 32-bit Windows: The key you must examine in the registry editor is HKEY_LOCAL_MACHINESOFTWAREMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE.



                  For 64-bit Windows: The key is HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE.



                  Note: Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.



                  enter image description here



                  For more details you can visit: https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration






                  share|improve this answer




























                    5












                    5








                    5







                    There are 2 ways:



                    Way 1: Setting INITIAL_BROWSER_URL:



                    File ieFile = new File("D:\IEDriverServer_x64_2.53.0\IEDriverServer.exe");
                    System.setProperty("webdriver.ie.driver", ieFile.getAbsolutePath());
                    DesiredCapabilities ieCaps = DesiredCapabilities.internetExplorer();
                    ieCaps.setCapability(InternetExplorerDriver.INITIAL_BROWSER_URL, "http://www.bing.com/");
                    driver = new InternetExplorerDriver(ieCaps);
                    //some operations on that site
                    driver.findElement(By.id("sb_form_q")).clear();
                    driver.findElement(By.id("sb_form_q")).sendKeys("Ripon Al Wasim");
                    driver.findElement(By.id("sb_form_go")).click();


                    Way 2: To set a registry entry on the target computer:
                    For IE 11 only, you will need to set a registry entry on the target computer so that the driver can maintain a connection to the instance of Internet Explorer it creates.



                    For 32-bit Windows: The key you must examine in the registry editor is HKEY_LOCAL_MACHINESOFTWAREMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE.



                    For 64-bit Windows: The key is HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE.



                    Note: Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.



                    enter image description here



                    For more details you can visit: https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration






                    share|improve this answer















                    There are 2 ways:



                    Way 1: Setting INITIAL_BROWSER_URL:



                    File ieFile = new File("D:\IEDriverServer_x64_2.53.0\IEDriverServer.exe");
                    System.setProperty("webdriver.ie.driver", ieFile.getAbsolutePath());
                    DesiredCapabilities ieCaps = DesiredCapabilities.internetExplorer();
                    ieCaps.setCapability(InternetExplorerDriver.INITIAL_BROWSER_URL, "http://www.bing.com/");
                    driver = new InternetExplorerDriver(ieCaps);
                    //some operations on that site
                    driver.findElement(By.id("sb_form_q")).clear();
                    driver.findElement(By.id("sb_form_q")).sendKeys("Ripon Al Wasim");
                    driver.findElement(By.id("sb_form_go")).click();


                    Way 2: To set a registry entry on the target computer:
                    For IE 11 only, you will need to set a registry entry on the target computer so that the driver can maintain a connection to the instance of Internet Explorer it creates.



                    For 32-bit Windows: The key you must examine in the registry editor is HKEY_LOCAL_MACHINESOFTWAREMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE.



                    For 64-bit Windows: The key is HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE.



                    Note: Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.



                    enter image description here



                    For more details you can visit: https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Jan 12 '18 at 13:40

























                    answered Jan 12 '18 at 12:45









                    Ripon Al WasimRipon Al Wasim

                    25.9k31125150




                    25.9k31125150























                        0














                        In my case I was getting the error due to missing slash at last of URL "/"



                        Actual is http://example.com/
                        but I was passing http://example.com






                        share|improve this answer






























                          0














                          In my case I was getting the error due to missing slash at last of URL "/"



                          Actual is http://example.com/
                          but I was passing http://example.com






                          share|improve this answer




























                            0












                            0








                            0







                            In my case I was getting the error due to missing slash at last of URL "/"



                            Actual is http://example.com/
                            but I was passing http://example.com






                            share|improve this answer















                            In my case I was getting the error due to missing slash at last of URL "/"



                            Actual is http://example.com/
                            but I was passing http://example.com







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Jul 22 '18 at 8:12









                            Bhargav Rao

                            30.3k2089110




                            30.3k2089110










                            answered Jul 22 '18 at 8:07









                            DonCoderDonCoder

                            1




                            1























                                0














                                There are three Settings :




                                1. Zoom level set to 100%

                                2. Unchecked the Internet Options --> Security--> For Internet and Trusted sites

                                3. Unchecked Unable Protected Mode






                                share|improve this answer






























                                  0














                                  There are three Settings :




                                  1. Zoom level set to 100%

                                  2. Unchecked the Internet Options --> Security--> For Internet and Trusted sites

                                  3. Unchecked Unable Protected Mode






                                  share|improve this answer




























                                    0












                                    0








                                    0







                                    There are three Settings :




                                    1. Zoom level set to 100%

                                    2. Unchecked the Internet Options --> Security--> For Internet and Trusted sites

                                    3. Unchecked Unable Protected Mode






                                    share|improve this answer















                                    There are three Settings :




                                    1. Zoom level set to 100%

                                    2. Unchecked the Internet Options --> Security--> For Internet and Trusted sites

                                    3. Unchecked Unable Protected Mode







                                    share|improve this answer














                                    share|improve this answer



                                    share|improve this answer








                                    edited Nov 23 '18 at 7:09









                                    Agilanbu

                                    1,3011419




                                    1,3011419










                                    answered Nov 23 '18 at 4:44









                                    MayurMayur

                                    1




                                    1






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Stack Overflow!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47388733%2fselenium-org-openqa-selenium-nosuchwindowexception-currently-focused-window-ha%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        404 Error Contact Form 7 ajax form submitting

                                        How to know if a Active Directory user can login interactively

                                        TypeError: fit_transform() missing 1 required positional argument: 'X'