I'm trying to start our WPF application.
Here are what I have done:
-
Followed the instruction "Running on a Remote Machine" in
https://github.com/Microsoft/WinAppDriver/wiki/Frequently-Asked-Questions/289a8b325d3ddab9f08b4398c49163a9a136f607#what-to-do-when-an-application-has-a-splash-screen-or-winappdriver-fails-to-recognize-the-correct-window
Note: I started WinAppDriver without "/wd/hub" since I want to use WinAppDriver standalone
-
Java code for starting up a WPF app:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "WindowsPC");
capabilities.setCapability("app", "C:\Users\xyz\Desktop\sv14web00041.appref-ms");
appSession = new WindowsDriver(new URL("http://127.0.0.1:4723"), capabilities);
Assert.assertNotNull(appSession);
String winHandle = appSession.getWindowHandle();
Thread.sleep(50000);
Note: I tried both 127.0.0.1 and local IP
Log:
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{app=C:\Users\xyz\Desktop\sv14web00041.appref-ms, platformName=Windows, deviceName=WindowsPC}], required capabilities = Capabilities [{}]
Build info: version: '3.3.1', revision: '5234b325d5', time: '2017-03-10 09:10:29 +0000'
System info: host: 'xyz', ip: '10.xx.xx.xx', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'
Driver info: driver.version: WindowsDriver
at io.appium.java_client.remote.AppiumProtocolHandShake.lambda$1(AppiumProtocolHandShake.java:95)
at java.util.Optional.orElseThrow(Optional.java:290)
at io.appium.java_client.remote.AppiumProtocolHandShake.createSession(AppiumProtocolHandShake.java:95)
at io.appium.java_client.remote.AppiumCommandExecutor.doExecute(AppiumCommandExecutor.java:111)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:162)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604)
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:244)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:144)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:88)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:112)
at io.appium.java_client.windows.WindowsDriver.(WindowsDriver.java:43)
at src.test.SystemManagementCenter.EagleSystemManagementCenterUiTest.setUp(EagleSystemManagementCenterUiTest.java:31)
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.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.RunBefores.evaluate(RunBefores.java:24)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Message from WinAppDriver console:
Accept-Encoding: gzip,deflate
Connection: Keep-Alive
Content-Length: 182
Content-Type: application/json; charset=utf-8
Host: 127.0.0.1:4723
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_171)
{"capabilities":[{"desiredCapabilities":{"app":"C:\Users\xyz\Desktop\sv14web00041.appref-ms","platformName":"Windows","deviceName":"WindowsPC"}},{"requiredCapabilities":{}}]}
HTTP/1.1 400 Bad Request
Content-Length: 141
Content-Type: application/json
{"status":100,"value":{"error":"invalid argument","message":"Bad capabilities. Specify either app or appTopLevelWindow to create a session"}}
Any assistant would be truly appreciated.
I'm trying to start our WPF application.
Here are what I have done:
Followed the instruction "Running on a Remote Machine" in
https://github.com/Microsoft/WinAppDriver/wiki/Frequently-Asked-Questions/289a8b325d3ddab9f08b4398c49163a9a136f607#what-to-do-when-an-application-has-a-splash-screen-or-winappdriver-fails-to-recognize-the-correct-window
Note: I started WinAppDriver without "/wd/hub" since I want to use WinAppDriver standalone
Java code for starting up a WPF app:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "WindowsPC");
capabilities.setCapability("app", "C:\Users\xyz\Desktop\sv14web00041.appref-ms");
appSession = new WindowsDriver(new URL("http://127.0.0.1:4723"), capabilities);
Assert.assertNotNull(appSession);
String winHandle = appSession.getWindowHandle();
Thread.sleep(50000);
Note: I tried both 127.0.0.1 and local IP
Log:
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{app=C:\Users\xyz\Desktop\sv14web00041.appref-ms, platformName=Windows, deviceName=WindowsPC}], required capabilities = Capabilities [{}]
Build info: version: '3.3.1', revision: '5234b325d5', time: '2017-03-10 09:10:29 +0000'
System info: host: 'xyz', ip: '10.xx.xx.xx', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'
Driver info: driver.version: WindowsDriver
at io.appium.java_client.remote.AppiumProtocolHandShake.lambda$1(AppiumProtocolHandShake.java:95)
at java.util.Optional.orElseThrow(Optional.java:290)
at io.appium.java_client.remote.AppiumProtocolHandShake.createSession(AppiumProtocolHandShake.java:95)
at io.appium.java_client.remote.AppiumCommandExecutor.doExecute(AppiumCommandExecutor.java:111)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:162)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604)
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:244)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:144)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:88)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:112)
at io.appium.java_client.windows.WindowsDriver.(WindowsDriver.java:43)
at src.test.SystemManagementCenter.EagleSystemManagementCenterUiTest.setUp(EagleSystemManagementCenterUiTest.java:31)
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.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.RunBefores.evaluate(RunBefores.java:24)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Message from WinAppDriver console:
Accept-Encoding: gzip,deflate
Connection: Keep-Alive
Content-Length: 182
Content-Type: application/json; charset=utf-8
Host: 127.0.0.1:4723
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_171)
{"capabilities":[{"desiredCapabilities":{"app":"C:\Users\xyz\Desktop\sv14web00041.appref-ms","platformName":"Windows","deviceName":"WindowsPC"}},{"requiredCapabilities":{}}]}
HTTP/1.1 400 Bad Request
Content-Length: 141
Content-Type: application/json
{"status":100,"value":{"error":"invalid argument","message":"Bad capabilities. Specify either app or appTopLevelWindow to create a session"}}
Any assistant would be truly appreciated.