Skip to content

Update steps for running WinAppDriver autonomously#1368

Merged
DHowett merged 4 commits into
microsoft:masterfrom
smilinrobin:patch-1
Jul 29, 2022
Merged

Update steps for running WinAppDriver autonomously#1368
DHowett merged 4 commits into
microsoft:masterfrom
smilinrobin:patch-1

Conversation

@smilinrobin
Copy link
Copy Markdown
Contributor

The steps in the current documentation leave ambiguity for the reader to figure out setup steps in a CI/CD kind of pipeline.
Adding details around batch files and Task Schedulers to run winappdriver autonomously would help automation/testing teams to setup Winappdriver in a complementary style to the CI/CD flow.
@timotiusmargo @hassanuz @licanhua @kat-y @DHowett - Kindly review and approve the PR as necessary .

The steps in the current documentation leave ambiguity for the reader to figure out setup steps in a CI/CD kind of pipeline.
Adding details around batch files and Task Schedulers to run winappdriver autonomously would help automation/testing teams to setup Winappdriver in a complementary style to the CI/CD flow.  
@timotiusmargo @hassanuz  @licanhua @kat-y  @DHowett - Kindly review and approve the PR as necessary .
@ghost
Copy link
Copy Markdown

ghost commented Nov 17, 2020

CLA assistant check
All CLA requirements met.

@vagisha-nidhi195
Copy link
Copy Markdown

@smilinrobin Does the solution to pass the desktop session to a console session work? I have been able to connect with winappdriver on the console session but wehn clicking any element it results in the following error:

{"status":13,"value":{"error":"unknown error","message":"An unknown error occurred in the remote end while processing the command."}}

Comment thread Docs/RunningOnRemoteMachine.md Outdated
- *Note*: The IP address above (10.x.xx.xx) should be replaced with the local IP address of the server/remote machine
- **5.3**. Setup Batch file to logout (without disconnecting) from the remote machine :
- *Name* : logout-rdp.bat
- *Contents*: `for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (%windir%\System32\tscon.exe %%s /dest:console C:\Install\QRes.exe /x 1920 /y 1080)`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what QRes.exe?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@licanhua - We can setup Qres (http://qres.sourceforge.net/) or another remote vnc tool to change the resolution of the target machine to match the local machine. My solution is loosely derived from here : https://stackoverflow.com/questions/35862217/screen-resolution-changes-for-the-remote-machine-after-safely-closing-the-rdp-se .

Alternatively the user can skip setting up the destination resolution with QRes .

Comment thread Docs/RunningOnRemoteMachine.md Outdated
Added note around QRes

Co-authored-by: Canhua Li <canli@microsoft.com>
@smilinrobin
Copy link
Copy Markdown
Contributor Author

Updated commit with the notes around Qres

@licanhua
Copy link
Copy Markdown
Contributor

@kat-y and @DHowett Can you help to review and merge it? I think these handy scripts are very useful

Copy link
Copy Markdown
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this! I reworded it quite a bit.

Comment thread Docs/RunningOnRemoteMachine.md Outdated
CalculatorResult = CalculatorSession.findElementByAccessibilityId("CalculatorResults");
``` No newline at end of file
```
5.WinAppDriver requires the Winappdriver server to be listening on the local host or IP address in order to perform the requisite UI interactions. While Appium generally takes care of this requirement on the local , for running on a server/remote machine, we need to perform a few extra steps as Winappdriver requires a GUI Output and the Winappdriver server running in an interactive shell.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
5.WinAppDriver requires the Winappdriver server to be listening on the local host or IP address in order to perform the requisite UI interactions. While Appium generally takes care of this requirement on the local , for running on a server/remote machine, we need to perform a few extra steps as Winappdriver requires a GUI Output and the Winappdriver server running in an interactive shell.
5. WinAppDriver requires the WinAppDriver server to be listening in order to perform the requisite UI interactions. While Appium generally takes care of this requirement on the local machine, running on a server/remote machine requires a few extra steps as WinAppDriver requires an interactive desktop session.

@DHowett DHowett merged commit 9c561a5 into microsoft:master Jul 29, 2022
@smilinrobin
Copy link
Copy Markdown
Contributor Author

Thanks @DHowett . 👍

@lovelyplanet2019
Copy link
Copy Markdown

lovelyplanet2019 commented Oct 24, 2022

I have setup a launch.bat file to call WinAppDriver.exe at test machine IP and port.
cmd start /K "C:/Program Files (x86)/Windows Application Driver/WinAppDriver.exe" 192.168.2.129 4723

Then Jenkins call the :
C:\Users\tester\Desktop\Jenkins\workspace\test_RF>CALL C:\prj-ewcom\launch.bat

At Jenkins console result: the WinAppDriver is exit automatically and cause the robot script failed.

C:\Users\tester\Desktop\Jenkins\workspace\test_RF>cmd start /K "C:/Program Files (x86)/Windows Application Driver/WinAppDriver.exe" 192.168.2.129 4723  
Windows Application Driver listening for requests at: http://192.168.2.129:4723/

Press ENTER to exit.

Exiting...

Anyone know how to configure Jenkins properly to run WinAppDriver ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants