WinAppDriver
WinAppDriver copied to clipboard
When trying to open CMD from WinAppDriver its opens up but still getting an error Unable to create a new remote session
Hi All,
I am trying to open CMD using WinAppDriver , on running the code CMD is opening up but still getting an error Unable to create a new remote session. Can you help me here why is it happening , even though CMD has opened up its not able to create a session with it .
Here is my Code: DesiredCapabilities cap = new DesiredCapabilities(); cap.setCapability("app", "C://Windows//System32//cmd.exe"); -- > As i am running remotely from my mac so this is the path cap.setCapability("platformName", "Windows"); cap.setCapability("deviceName", "Android"); try { driver = new WindowsDriver<WindowsElement>(new URL("http://127.0.0.1:4723/wd/hub"), cap); driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); } catch (MalformedURLException e) { e.printStackTrace(); }
@LisaAga Why do you need to open cmd using WinAppDriver? Solution https://github.com/microsoft/WinAppDriver/issues/1614#issuecomment-939095085
@Shakevg Thank you for your response . I am trying to run my tests on a remote windows machine . Can you help me understand can i use the approve mentioned here (https://github.com/microsoft/WinAppDriver/issues/1614#issuecomment-939095085) to run the cmd remotely ??
@LisaAga I haven't much experience, but you should copy the bat file to the remote host and can try something like this https://stackoverflow.com/questions/42049767/execute-batch-file-on-remote-pc-from-a-webpage-on-user-action