Hi, I’m using robot from gitlab to access an application in a Windows 10 VM. I use winappdriver in the VM and ApplicationLibrary.DesktopLibrary in gitlab. But when I try to click on some buttons, winappdriver gives me the error: WebAppDriver WebDriverException timeout. Why can this happen? I found out that winappdriver is discontinued. How can I replace it?
Well, without providing additional information like versions setup and logs , it will be difficult to figure it out but here some points to consider :
-
I see that the driver is no longer updated : [ WinAppDriver v1.2.1Latest on Nov 6, 2020
] (Release WinAppDriver v1.2.1 · microsoft/WinAppDriver · GitHub) : so it might be a compatibility issues , check your windows version & architecture on your VM and try another version if possible . check setup version also and that you have the rights versions . Check your desktop application versions and if WebAppDriver current version can automate it. -
Check out that you have installed the library from the newer repos which belong to appium and maintained : GitHub - appium/appium-windows-driver: Appium's interface to WindowsAppDriver provided by Microsoft and not from GitHub - stoneman/appium-windows-driver
-
Check Pywinauto library , it could fulfill your requirements and it is widely used for desktop application
-
last, you might consider looking at Playwrite on robot as an alternative for you automation requirement
in VM:
winappdriver v: 1.2.2009.2003
in gitlab:
robotframework==7.1
robotframework-applicationlibrary==1.2.1
*** Settings ***
Library ApplicationLibrary.DesktopLibrary
...
*** Variables ***
${HOST} opc.tcp://x.x.x.x:xxxx
${REMOTE_URL} http://x.x.x.x:4723
${SW} C:\\x\\SW.exe
...
*** Test Cases ***
Test Case 1 -> Manual Control
[Setup] ApplicationLibrary.DesktopLibrary.Open Application ${REMOTE_URL} platformName=Windows deviceName=Windows app=${SW} alias=SW splash_delay=20 automationName=WinAppDriver
Sleep 20s
Log To Console <Connect>
Wait Until Element Is Enabled accessibility_id=TitleBar
Mouse Over Element accessibility_id=TitleBar
Click A Point 210 80
Sleep 1s
...
ERROR: WebDriverException: Message: La operación superó el tiempo de espera. (Excepción de HRESULT: 0x80131505)
You could try replacing WinAppDriver with GitHub - FlaUI/FlaUI.WebDriver. It’s the candidate for eventual replacement for Appium integration. By no means a perfect substitute for WinAppDriver, but worth a try. There are various other similar (unofficial) WinAppDrivers as well that you can try if you search around, a few are mentioned under FlaUI.WebDriver project.
Your error leads me to think is a connection/firewall issue. Check that your WinAppDriver instance is connectable.
You should first try running everything locally on the VM. If it works all within VM but not when the client is connecting to driver outside VM, then the problem is with the VM network access config. Are you sure gitlab has all the access to the VM?
Also ensure the VM is not locked that the session is active whether on a local connection to VM or remote desktop. Windows UI automation tends to have issues executing when desktop is not active.
Hi David, thanks for your reply.
You are right about the local version as when I run it locally I also get the same error. Could it be a version issue between Appium and WinAppDriver?
I am using the latest version of the ApplicationLibrary, which version would you recommend for the latest version of winappdriver ?