Нужно автоматизировать jnlp в драйвере winapp - PullRequest
0 голосов
/ 26 февраля 2020

Я пытаюсь автоматизировать jnlp с помощью драйвера winapp или автоматизации рабочего стола. Поэтому я попытался использовать java код:

public class Rms {
    private static WindowsDriver driver = null;

      @Test
      public  void setup() throws MalformedURLException {
         // String driver = "C:\\\\work\\\\rms-sim_clinet\\\\sim_client.jnlp";
              DesiredCapabilities capabilities = new DesiredCapabilities();
              capabilities.setCapability("java_client", "C:\\work\\rms-sim_clinet\\sim_client.jnlp");
              System.out.println("appStarted");
              driver = new WindowsDriver(new URL("http://localhost:4723/wd/hub"),capabilities);

              System.out.println("driverStarted");
              driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS);
              ((WebElement) driver).sendKeys(Keys.ENTER);

              System.out.println("return2");
              driver.close();

          }
}

Я могу запустить его с помощью кода автоматизации. Но я сталкиваюсь с этой ошибкой:

org.openqa.selenium.UnsupportedCommandException: 'getSessionCapabilities' is not valid or implemented command. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 33 milliseconds
Build info: version: '3.3.1', revision: '5234b325d5', time: '2017-03-10 09:10:29 +0000'
System info: host: 'PRASANTH', ip: '10.91.192.143', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_241'
Driver info: io.appium.java_client.windows.WindowsDriver
Capabilities [{app=C:\work\rms-sim_clinet\sim_client.jnlp, args=, innerPort=9998, debugConnectToRunningApp=false, keyboardSimulator=1, launchDelay=0, platform=ANY}]
Session ID: AwesomeSession
    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.ErrorHandler.createThrowable(ErrorHandler.java:216)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:638)
    at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:46)
    at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
    at io.appium.java_client.windows.WindowsDriver.execute(WindowsDriver.java:1)
    at io.appium.java_client.HasSessionDetails.getSessionDetails(HasSessionDetails.java:36)
    at io.appium.java_client.HasSessionDetails.getSessionDetail(HasSessionDetails.java:42)
    at io.appium.java_client.HasSessionDetails.getPlatformName(HasSessionDetails.java:46)
    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:100)
    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:112)
    at io.appium.java_client.windows.WindowsDriver.<init>(WindowsDriver.java:43)
    at Automation.Automation.Rms.setup(Rms.java:22)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)

после того, как я запустил код, я смог запустить jnlp и столкнулся с ошибкой. Но мне нужно, чтобы мне пришлось войти в приложение jnlp.

...