mcdcorp / opentest

Open source test automation tool for web applications, mobile apps and APIs
https://getopentest.org
MIT License
452 stars 108 forks source link

Error running test in Internet Explorer 11 (32bits) #514

Closed ahsiu34 closed 2 years ago

ahsiu34 commented 3 years ago

Run this test in IE 11 ( 32 bits ) . It opens google.com in IE 11 (32bits) but it can not type react in searchBox.

- description: Navigate to Google
        action: org.getopentest.selenium.NavigateTo
        args:
          url: https://www.google.com

      - description: Type "react" in the search box
        action: org.getopentest.selenium.SendKeys
        args:
          locator: { name: q }
          text: react

Error stack:

Caused by: java.lang.RuntimeException: Failed executing action org.getopentest.selenium.SendKeys with arguments {"locator":{"name":"q"},"text":"react"} at org.getopentest.base.TestActor.executeActionByDef(TestActor.java:1821) at org.getopentest.base.TestActor.executeTestSegment(TestActor.java:2073) ... 3 more Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Failed sending keys to element By.name: q at org.getopentest.base.TestActor.executeActionByClassName(TestActor.java:1626) at org.getopentest.base.TestActor.executeActionByDef(TestActor.java:1705) ... 4 more

adrianth commented 3 years ago

It looks like the error information is not complete. Can you please provide the rest of the call stack that follows after java.lang.RuntimeException: Failed sending keys to element By.name: q?

ahsiu34 commented 3 years ago

Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Failed sending keys to element By.name: q at org.getopentest.base.TestActor.executeActionByClassName(TestActor.java:1626) at org.getopentest.base.TestActor.executeActionByDef(TestActor.java:1705) ... 4 more Caused by: java.lang.RuntimeException: Failed sending keys to element By.name: q at org.getopentest.selenium.SendKeys.run(SendKeys.java:45) at org.getopentest.base.TestActor.executeAction(TestActor.java:1527) at org.getopentest.base.TestActor.executeActionByClassName(TestActor.java:1603) ... 5 more Caused by: org.openqa.selenium.TimeoutException: Expected condition failed: waiting for presence of element located by: By.name: q (tried for 10 second(s) with 500 milliseconds interval) at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:95) at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:272) at org.getopentest.selenium.core.SeleniumTestAction.getElement(SeleniumTestAction.java:58) at org.getopentest.selenium.core.SeleniumTestAction.getElement(SeleniumTestAction.java:50) at org.getopentest.selenium.SendKeys.run(SendKeys.java:25) ... 7 more Caused by: org.openqa.selenium.NoSuchElementException: Unable to find element with css selector == *[name='q'] For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'OP-LP3', ip: '192.168.2.34', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_271' Driver info: org.openqa.selenium.ie.InternetExplorerDriver Capabilities {acceptInsecureCerts: false, browserName: internet explorer, browserVersion: 11, javascriptEnabled: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), se:ieOptions: {browserAttachT imeout: 0, elementScrollBehavior: 0, enablePersistentHover: true, ie.browserCommandLineSwitches: , ie.edgechromium: false, ie.edgepath: , ie.ensureCleanSession: false, ie.fileUploadDialogTimeout: 3000, ie.forceCreateProcessApi: fals e, ignoreProtectedModeSettings: false, ignoreZoomSetting: true, initialBrowserUrl: http://localhost:17849/, nativeEvents: true, requireWindowFocus: false}, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify} Session ID: 16eb92b5-9967-44a4-a5c3-8519ccda8ebc *** Element info: {Using=name, value=q} at sun.reflect.GeneratedConstructorAccessor14.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:323) at org.openqa.selenium.remote.RemoteWebDriver.findElementByName(RemoteWebDriver.java:404) at org.openqa.selenium.By$ByName.findElement(By.java:284) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:315) at org.openqa.selenium.support.ui.ExpectedConditions$6.apply(ExpectedConditions.java:182) at org.openqa.selenium.support.ui.ExpectedConditions$6.apply(ExpectedConditions.java:179) at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:249) ... 10 more

12.19.09 Test session has completed 12.19.09 TRACE: Firing TEST_COMPLETED event... 12.19.09 WARN: Failed to get browser log entries. 12.19.09 WARN: org.openqa.selenium.UnsupportedCommandException: Command not found: POST /session/16eb92b5-9967-44a4-a5c3-8519ccda8ebc/log Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'OP-LP3', ip: '192.168.2.34', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_271' Driver info: org.openqa.selenium.ie.InternetExplorerDriver Capabilities {acceptInsecureCerts: false, browserName: internet explorer, browserVersion: 11, javascriptEnabled: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), se:ieOptions: {browserAttachT imeout: 0, elementScrollBehavior: 0, enablePersistentHover: true, ie.browserCommandLineSwitches: , ie.edgechromium: false, ie.edgepath: , ie.ensureCleanSession: false, ie.fileUploadDialogTimeout: 3000, ie.forceCreateProcessApi: fals e, ignoreProtectedModeSettings: false, ignoreZoomSetting: true, initialBrowserUrl: http://localhost:17849/, nativeEvents: true, requireWindowFocus: false}, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify} Session ID: 16eb92b5-9967-44a4-a5c3-8519ccda8ebc at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) at org.openqa.selenium.remote.RemoteExecuteMethod.execute(RemoteExecuteMethod.java:35) at org.openqa.selenium.remote.RemoteLogs.getRemoteEntries(RemoteLogs.java:81) at org.openqa.selenium.remote.RemoteLogs.get(RemoteLogs.java:77) at org.getopentest.selenium.core.SeleniumTestAction$1.update(SeleniumTestAction.java:175) at java.util.Observable.notifyObservers(Unknown Source) at org.getopentest.base.TestActor.runOneSession(TestActor.java:3006) at org.getopentest.base.TestActor.runOneSession(TestActor.java:3017) at org.getopentest.Main.main(Main.java:20)

12.19.09 TRACE: Firing SESSION_COMPLETED event... 12.19.09 Actor 57060 of type WEB with tag(s) [internet explorer] is waiting to be acquired by a test session...

adrianth commented 3 years ago

It looks like the IE WebDriver implementation for some reason is simply not able to locate elements by name. Please make sure you are using an up-to-date version of the IE WebDriver. The latest driver binary and the proper installation process should be fairly easy to find online.

One other other thing I noticed is that the error message you got was: Unable to find element with css selector == *[name='q'] whereas the error message that is outputted by the Selenium client library v3.141.59 included with the latest OpenTest version is: Unable to locate element: {"method":"css selector","selector":"*[name='q']"} The fact that you are getting a slightly different error message makes me think that you might be using an old version of OpenTest or you might be having an old Selenium client library in the class path for your test actor.

gauravgandhi1315 commented 3 years ago

I just tested and it is an issue with old selenium client library in the class path.

adrianth commented 3 years ago

Hey @gauravgandhi1315, can you please elaborate on this, or send a link with more details?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.