Есть отличная удаленная работа для php+codeception+jenkins+allure+docker спецов. 100% remote! Присоединиться к проекту

Не могу справитья в IE с NoSuchWindowException

internet-explorer
webdriver
Теги: #<Tag:0x00007f7b63efa9a8> #<Tag:0x00007f7b63efa818>

(Артем Хоружий) #1

Не могу разобраться почему часто выпадает NoSuchWindowException на Internet Explorer. Как с этим можно бороться?

14:05:31 Aug 24, 2018 2:05:31 PM org.openqa.selenium.support.ui.ExpectedConditions findElement
14:05:31 WARNING: WebDriverException thrown by findElement(By.xpath: //*[@id="content"]/div/div/div[3]/div/div/div/div/div[3])
14:05:31 org.openqa.selenium.NoSuchWindowException: Currently focused window has been closed.
14:05:31 Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'
14:05:31 System info: host: 'MSQV356', ip: '10.130.66.58', os.name: 'Windows Server 2016', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_161'
14:05:31 Driver info: org.openqa.selenium.ie.InternetExplorerDriver
14:05:31 Capabilities {acceptInsecureCerts: false, browserName: internet explorer, browserVersion: 11, javascriptEnabled: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), se:ieOptions: {browserAttachTimeout: 0, elementScrollBehavior: 0, enablePersistentHover: true, ie.browserCommandLineSwitches: , ie.ensureCleanSession: false, ie.fileUploadDialogTimeout: 3000, ie.forceCreateProcessApi: false, ignoreProtectedModeSettings: false, ignoreZoomSetting: false, initialBrowserUrl: http://localhost:61209/, nativeEvents: true, requireWindowFocus: false}, setWindowRect: true, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss}
14:05:31 Session ID: aa68b5c4-feda-4c70-99f7-9b43ddbb6ef5
14:05:31 *** Element info: {Using=xpath, value=//*[@id="content"]/div/div/div[3]/div/div/div/div/div[3]}
14:05:31 	at sun.reflect.GeneratedConstructorAccessor39.newInstance(Unknown Source)
14:05:31 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
14:05:31 	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
14:05:31 	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
14:05:31 	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
14:05:31 	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
14:05:31 	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
14:05:31 	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
14:05:31 	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
14:05:31 	at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:349)
14:05:31 	at org.openqa.selenium.remote.RemoteWebDriver.findElementsByXPath(RemoteWebDriver.java:428)
14:05:31 	at org.openqa.selenium.By$ByXPath.findElements(By.java:348)
14:05:31 	at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:310)
14:05:31 	at org.openqa.selenium.support.ui.ExpectedConditions.findElement(ExpectedConditions.java:895)
14:05:31 	at org.openqa.selenium.support.ui.ExpectedConditions.access$000(ExpectedConditions.java:44)
14:05:31 	at org.openqa.selenium.support.ui.ExpectedConditions$6.apply(ExpectedConditions.java:183)
14:05:31 	at org.openqa.selenium.support.ui.ExpectedConditions$6.apply(ExpectedConditions.java:180)
14:05:31 	at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:248)
14:05:31 	at com.hpe.automation.verifyelement.components.CheckWebElementBase.checkElementIsPresent(CheckWebElementBase.java:915)
14:05:31 	at com.hpe.automation.verifyelement.PageElementRDChecker.doCheckings_aroundBody0(PageElementRDChecker.java:189)
14:05:31 	at com.hpe.automation.verifyelement.PageElementRDChecker$AjcClosure1.run(PageElementRDChecker.java:1)
14:05:31 	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
14:05:31 	at io.qameta.allure.aspects.StepsAspects.step(StepsAspects.java:51)
14:05:31 	at com.hpe.automation.verifyelement.PageElementRDChecker.doCheckings(PageElementRDChecker.java:183)
14:05:31 	at com.hpe.automation.verifyelement.PageElementRDChecker.checkResponsivePage(PageElementRDChecker.java:214)
14:05:31 	at com.hpe.automation.HPETest.test(HPETest.java:38)
14:05:31 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:05:31 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
14:05:31 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
14:05:31 	at java.lang.reflect.Method.invoke(Method.java:498)
14:05:31 	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
14:05:31 	at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
14:05:31 	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
14:05:31 	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
14:05:31 	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
14:05:31 	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
14:05:31 	at org.testng.TestRunner.privateRun(TestRunner.java:744)
14:05:31 	at org.testng.TestRunner.run(TestRunner.java:602)
14:05:31 	at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
14:05:31 	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
14:05:31 	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
14:05:31 	at org.testng.SuiteRunner.run(SuiteRunner.java:289)
14:05:31 	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
14:05:31 	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
14:05:31 	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
14:05:31 	at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
14:05:31 	at org.testng.TestNG.runSuites(TestNG.java:1144)
14:05:31 	at org.testng.TestNG.run(TestNG.java:1115)
14:05:31 	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:283)
14:05:31 	at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
14:05:31 	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:120)
14:05:31 	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:386)
14:05:31 	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:323)
14:05:31 	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:143)

(Fiodar Motin) #2

Описание слишком подробное, не делайте так).
А теперь по делу.

  1. Что это??? ```
    ** Element info: {Using=xpath, value=//*[@id=“content”]/div/div/div[3]/div/div/div/div/div[3]}
сделайте нормальный  xpath

2. Судя по всему вы пытаетесь найти в браузере который вы закрыли элемент с самым крутым xpath из пункта 1, но может это не так  т.к описание проблемы слишком "ПОДРОБНОЕ".

3. Если вы скинете больше информации (при каких условиях, кусок кода с инициализацией драйвера и т.д) то помощь вы тут получите быстрее в  несколько раз.