Problem in a VM with winappdriver

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 :

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.

1 Like

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.

1 Like

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 ?