![](/img/trans.png)
[英]Selenium 3.0 Firefx Driver fails with org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session
[英]WinAppDriver: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session
我正在嘗試使用 WinAppDriver 在 Delphi 中開發的桌面應用程序中自動化測試。
編程語言:Java 1.8.0_281
IDE:Eclipse,Luna 服務版本 2 (4.4.2)
selenium-server-standalone-3.141.59.jar
Appium:java-client-7.4.1.jar
commons-lang3-3.12.0
公共 class 演示 {
public static void main(String[] args) { WindowsDriver driver = null; DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("app", "<path_of_exe_file>"); capabilities.setCapability("platformName","Windows"); capabilities.setCapability("deviceName", "WindowsPC"); try { driver = new WindowsDriver(new URL("http://127.0.0.1:4723"), capabilities); } catch (MalformedURLException e) { e.printStackTrace(); } }
}
應用程序以信息啟動屏幕開始,然后啟動主應用程序。 但是控制台中會顯示以下錯誤:
線程“主”org.openqa.selenium.SessionNotCreatedException 中的異常:無法創建新的遠程 session。 請檢查服務器日志以獲取更多詳細信息。 原始錯誤:無法找到打開的應用程序 window with appId: <path_of_exe_file>, and processId: 1936 (WARNING: The server did not provide any stacktrace information)
請告訴我,如何解決這個問題。
您可能需要安裝 WinAppDriver。 app id 應該是您想要自動化的桌面應用程序的路徑。
我多次遇到同樣的問題。 最好的解決方案是關閉所有應用程序並重新啟動機器。 然后運行 winappdriver.exe 並執行測試腳本。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.