Hello
My problem is, that the windows application is starting for like 6-10 sec. The test fails 1/2 times at the beginning of execution. The implicitlyWait doesnt wait for the app. Is there a possibility to wait longer for the application to load?
Current code:
Runtime.getRuntime().exec("cmd.exe /c start " + “WinAppDriver/WinAppDriver.exe”)
Windows.startApplication(GlobalVariable.path)
Windows.getDriver().manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
Windows.setText(findWindowsObject(‘Object Repository/mainWindow/loginWindow/tbUser’), (GlobalVariable.user))
Windows.setText(findWindowsObject(‘Object Repository/mainWindow/loginWindow/tbPassword’), (GlobalVariable.password))
Log:
Caused by: org.openqa.selenium.WebDriverException: Failed to locate opened application window with appId: C:\MyFolder\myApp.exe, and processId: 19468 (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 9.64 seconds
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘APS00076262-MB’, ip: ‘172.30.240.1’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: driver.version: WindowsDriver
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$errorHandler$0(JsonWireProtocolResponse.java:54)
at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
… 42 more
)
2020-03-19 07:52:27.100 ERROR k.k.c.m.CustomKeywordDelegatingMetaClass - Unable to create a new remote session. Please check the server log for more details. Original error: Failed to locate opened application window with appId: C:\MyFolder\myApp.exe, and processId: 19468 (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 9.64 seconds