Search code examples
windowsappiumui-automationwinappdriver

How to perform multiple device testing with Windows Application Driver


Hi WindowsAutomation/Appium community,

I am writing UI automation tests for a Windows 10 based application and things have been going well with my test scripts until when I had to log into a second device. I have no idea how to make this work with WinAppDriver. I have read up on Appium and WinAppDriver but it doesn't look like this scenario is supported at the moment. Has anyone been able to hack this process? Please advise.


Solution

  • Making a network connection to a 2nd device is possible. The steps are outlined in the "running on a remote machine" instructions on the readme here: https://github.com/Microsoft/WinAppDriver

    1. On the machine you want to run the test application on, open up "Windows Firewall with Advanced Security"

      • Select "Inbound Rules" -> "New Rule"
      • Rule type -> port
      • Select TCP
      • Choose specific local port (4723 is WinAppDriver standard)
      • Action -> allow the connection
      • Profile -> select all
      • Name -> optional, choose name for rule (e.g. WinAppDriver remote)
    2. Run ipconfig to determine your machine's local IP address

      • Note that setting * as the IP address command line option will cause it to bind to all bound IP addresses on the machine
    3. Run WinAppDriver.exe with command line arguments as seen above specifying local IP and port (must be in admin cmd)

    4. On the machine with the test runner, make sure the URL in the test script is pointing to the IP of the remote machine
    5. If the test app is installed on the remote machine run your test script and see the results!

    I work at Microsoft on WinAppDriver.