WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

org.openqa.selenium.WebDriverException: It is impossible to create a new session because 'createSession' which takes HttpClient, InputStream and long was not found or it is not accessible

Open vnair1986 opened this issue 7 years ago • 11 comments

Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z' System info: host: 'NOLAPF2FFLWS598', ip: '172.22.56.49', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181' Driver info: driver.version: WindowsDriver at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:195) at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:209) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:231) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.windows.WindowsDriver.execute(WindowsDriver.java:1) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:212) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:130) at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:84) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:94) at io.appium.java_client.windows.WindowsDriver.(WindowsDriver.java:42) at com.appium.test.CalculatorTest.setup(CalculatorTest.java:37) 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:124) at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142) at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:168) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105) at org.testng.TestRunner.privateRun(TestRunner.java:648) at org.testng.TestRunner.run(TestRunner.java:505) at org.testng.SuiteRunner.runTest(SuiteRunner.java:455) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415) at org.testng.SuiteRunner.run(SuiteRunner.java:364) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208) at org.testng.TestNG.runSuitesLocally(TestNG.java:1137) at org.testng.TestNG.runSuites(TestNG.java:1049) at org.testng.TestNG.run(TestNG.java:1017) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77) Caused by: java.lang.reflect.InvocationTargetException 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 io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:185) ... 39 more Caused by: org.openqa.selenium.WebDriverException: Element not found. (Exception from HRESULT: 0x80070490) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 1.48 seconds Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z' System info: host: 'NOLAPF2FFLWS598', ip: '172.22.56.49', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181' Driver info: driver.version: WindowsDriver 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.ErrorHandler.createThrowable(ErrorHandler.java:214) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166) at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53) at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:122) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958) at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:125) ... 44 more

Originally posted by @vnair1986 in https://github.com/Microsoft/WinAppDriver/issues/418#issuecomment-444499486

vnair1986 avatar Dec 06 '18 12:12 vnair1986

{"status":13,"value":{"error":"unknown error","message":"Element not found. (Exception from HRESULT: 0x80070490)"}} [debug] [W3C] Matched W3C error code 'unknown error' to UnknownError [debug] [WinAppDriver] Deleting WinAppDriver session

vnair1986 avatar Dec 06 '18 13:12 vnair1986

Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Element not found. (Exception from HRESULT: 0x80070490) Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z' System info: host: 'NOLAPF2FFLWS598', ip: '172.22.56.49', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181' Driver info: driver.version: WindowsDriver remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Element not found. (Exception from HRESULT: 0x80070490) at errorFromW3CJsonCode (C:\Users\vipin.nair\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:802:25) at ProxyRequestError.getActualError (C:\Users\vipin.nair\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:685:14) at JWProxy.command$ (C:\Users\vipin.nair\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:236:19) at tryCatch (C:\Users\vipin.nair\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\vipin.nair\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\vipin.nair\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21) at GeneratorFunctionPrototype.invoke (C:\Users\vipin.nair\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37) at

vnair1986 avatar Dec 06 '18 13:12 vnair1986

Hi @vnair1986,

Can you launch the WinAppDriver.exe console window directly and paste the log that is generated there?

Also if you could share your test code, that would also help looking into this.

Thanks!

hassanuz avatar Dec 11 '18 23:12 hassanuz

Any Updates on this

vnair1986 avatar Dec 13 '18 07:12 vnair1986

@vnair1986 An alternate solution would be to evoke the application separately using Process Class and creating the Desktop Session and finding the Parent window of the application.

dhapolapankaj avatar Dec 23 '18 04:12 dhapolapankaj

@vnair1986 An alternate solution would be to evoke the application separately using Process Class and creating the Desktop Session and finding the Parent window of the application.

Can you please provide me little more details or sample how to do it.

vnair1986 avatar Dec 26 '18 06:12 vnair1986

@hassanuz any update on this ?

vnair1986 avatar Dec 28 '18 07:12 vnair1986

@vnair1986 I hope this helps.

https://simplifyautomation.blogspot.com/2019/01/simple-winappdriver-code-for-creating.html

dhapolapankaj avatar Jan 01 '19 12:01 dhapolapankaj

@vnair1986 I hope this helps.

https://simplifyautomation.blogspot.com/2019/01/simple-winappdriver-code-for-creating.html

@dhapolapankaj its didn't work for me. as my application is not launched through Appium.

vnair1986 avatar Jan 03 '19 06:01 vnair1986

@hassanuz you can close this issue as I am able to Launch the application by providing application ID after the package.

vnair1986 avatar Mar 13 '19 06:03 vnair1986

Hi, nice to see this blog.. I am testing widows application on desktop using winapp driver, my application will have links to click on folder and chromebrowser. i can be able to click on those links and then pop up with folder and chrome browser. but i cant move my session control to those windows, do yo have any idea how move the session control from desktop application to chrome browser??

please give me your answer, or if you give me your number i can call you..

rkunamneni19 avatar Oct 19 '19 19:10 rkunamneni19