Friday, April 17, 2020

Appium Windows Automation: Options for running WinAppDriver.exe


The screenshot above shows installation folder of Windows Application Driver (WinAppDriver/WAD). WinAppDriver is a free to use UI automation technology by Microsoft, it is based on Appium and WebDriver standard.

To learn more about WinAppDriver, please visit the following course link:

https://www.udemy.com/course/appium-winappdriver-automation-testing/?referralCode=ED22C3A4CE5BB5E22E53

You need to know what's the importance of WinAppDriver.exe in UI automation based on [Appium] WinAppDriver.

Open file explorer and type path of WinAppDriver installation folder here.
Default installation path of WinAppDriver the path “C:\Program Files (x86)\Windows Application Driver”.
Inside the installation folder, you can see WinAppDriver.exe file alongside other binaries.
The WinAppDriver.exe is the heart of UI automation on the [Appium] WinAppDriver platform.

To perform UI automation with WinAppDriver, the WinAppDriver.exe file must be running on the target machine.

If you double click to start it[WinAppDriver.exe], you'll see it’s a console application.
Before proceeding further, let me repeat again, your WinAppDriver based UI automation will fail if the file WinAppDriver.exe is not running.



The WinAppDriver default port 4723. WinAppDriver is listening for incoming automation commands using http protocol.

It is listening for Appium automation commands on port number 4723.

Your script(C#, Java, JavaScript, Python, Ruby) tells the WinAppdriver what automation operation it wants to be performed and automation on the machine is performed by this WinAppDriver.exe.
The test automation script and the driver can be either on the same machine or on different machines.

Your scripts will fail if the WinAppDriver is not reachable through the port number which you specify in your script.

Windows Firewall can cause serious pain in this regard sometimes.

If let’s suppose the port number is already in use by another program, you can specify it through the command line.

For example, if we open the command prompt.

Next, type the full path of WinAppDriver here and press enter.

i.e.
C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe 21000

Here, I can simply type a different port number after the space, as a command line parameter.

Please note that the port number must be greater than 1024 and less than 65335.

You can type 21000 and hit Enter key.


The server will start running on this port now.

It’s better to let the WinAppDriver run on the default port, 4723.

You may create a shortcut to the WinAppDriver.exe on your desktop as well.

It is also possible to specify a different port number in the "target" field of a shortcut which you've created. 


Saturday, March 7, 2020

How to Change WinAppDriver Port Number?


The WinAppDriver, popularly known as Windows Application Driver is a UI automation engine that listens for incoming requests on port number 4782 by default.

Appium WinAppDriver UI Automation Testing Windows Apps in C#


You can see what port the WinAppDriver is listening to at any given moment when it is running; the port number is shown on the console.

WinAppDriver default port

But other than that, if you want to run the WinAppDriver on a different port number than the default, you can specify the port number in the command line arguments.
An example will be:

WinAppDriver.exe 28399

A screenshot is given below FYI.

Windows Application Driver (WAD) WinAppDriver.Exe Port Number Parameter cmd
WinAppDriver.exe port number in command line

How to specify a different port number in the shortcut?

If you've created a shortcut to WinAppDriver.exe on your desktop, you can easily go and add the port number after the exe file path in the Target field.
An example screenshot is given below to show how to set a different Windows Application Driver (WAD) port number for the desktop shortcut:


Windows Application Driver (WAD) WinAppDriver.Exe Port Number Parameter in desktop shortcut
WinAppDriver Shortcut Port Number Change
Suppose you're using Azure DevOps and want to run the WinAppDriver on your self-hosted agent or Azure VM but with a different port number. You can specify this in the pipeline task parameters. The screenshot of the setting of the Azure DevOps pipeline WinAppDriver task is shown below. as an example

WinAppDriver Azure DevOps Pipeline Task Settings Command line arguments to change port number in UI Automation Testing
WinAppDriver Azure DevOps Pipeline Task Settings

Sunday, February 16, 2020

Disadvantages of automated functional testing


Disadvantages of Automated Functional Testing

  1. The machine used for running scripts gets occupied until the test automation activity is finished(true for Selenium, Appium, WinAppDriver, and CodedUI). 
  2. Small mistakes at the wrong time can fail your automated testing scripts. For example, hitting the enter key while UI automated testing is in progress might cause an unwanted popup or a form to submit, which could lead to a test failure.
  3. Automated black box testing (a.k.a functional UI testing) is slow. (true for Selenium, Appium, WinAppDriver, and CodedUI)
  4. Many resources are needed to run multiple tests in parallel(although it might not be possible to run specific tests in parallel due to application domain requirements).
  5. You can't pinpoint the cause of the fault, you only get to know the steps to reproduce, and the developers have to find the root cause of the bug later.
  6. Automated functional tests are flaky and fail due to small changes in the application UI. 

Automation testing is the buzzword of the day. But we must know that some types of test automation are less valuable than some other types of automated testing. 

Not all automated tests are created equal.

UI-driven testing, known as end-to-end or functional testing, is, on the surface, the easiest to get going. As a result, tools like Selenium, Appium, Coded UI, WinAppDriver, WebDriver.IO, and PostMan are in high demand. But there are still some disadvantages of automated UI testing, briefly summarized here for you. 


The best thing you can do is to automate unit testing and then integration testing. That's where you're going to get the most coverage. 


Saturday, January 11, 2020

Software testing and automated testing tools


Software testing is a quality control activity. It is considered to be a repetitive and labor-intensive task.
Computers in general are you know capable of doing such repetitive, boring, and labor-intensive tasks really well.
Appium WinAppDriver: Automated UI Testing Windows Apps in C#
Appium WinAppDriver: Automated UI Testing Windows Apps in C#
Learn more about automated testing of Windows applications by clicking the link below.
https://www.udemy.com/course/appium-winappdriver-automation-testing/?referralCode=ED22C3A4CE5BB5E22E53

This leads us to software test automation and automated testing tools.
Software Test Automation tools help us to delegate laborious;  repetitive tasks to the computers, because that’s what computers do best.
Making the machines do the software testing job frees up time for Homosepians!, allowing them to be creative; something the machines can’t do well. At least at the time when this course was being created.
Automated software tests can be broadly broken into two categories.

  • Automated white box testing, such as 
    • Unit tests
    • Integration tests
    • API tests(Postman is a popular API testing tool)
  • Automated black box testing which includes
    • Automated UI testing(Robot Process Automation, RPA is a relevant field)

Test automation can be divided in two major phases…

First is “Creating scripts intended to exercise various parts of the software system under test and assert the results shown by the System Under Test or SUT.”

The second is “Running the test scripts to exercise the system and display the results.”
Any programming language can be used to write these scripts. For example, we will use C# .Net and Java.
Once the test scripts are in place, proper tools are also available to run the scripts.
Tests are commonly executed by test run agents.
For Visual Studio Unit Testing Framework, these are called agents. For UIPath, these are called robots.


In general, when we run test scripts, they either pass or fail based on the response of the system under test.

We can see these reports to assess the correctness of the system in a “quantitative fashion.”
UI Path Orchestrator
A developer can run these tests on one machine or on many machines using test control systems like Microsoft TFS or UiPath Orchestrator.

Jenkins is another such tool popular in the Java community.
Several types of automated testing tools are available in the market
These tools facilitate the process of writing and running test scripts
These tools also commonly include utility software to record user actions and prepare test scripts based on those actions
Some popular test automation (and RPA) tools are

Selenium and rarely used Selenium Recorder.
Appium for iOS and Android automated testing
UiPath
Appium-based WinAppDriver for testing Windows applications
I hope you found this video to be useful. Please like it and share it with your QA friends.
Do subscribe to my channel as well.

Monday, December 30, 2019

Discount on Udemy Courses!



Appium WinAppDriver: Automated UI Testing Windows Apps in C# 


Windows Service Programming, Debugging, Installing in C#.Net

UDP Socket Programming For Distributed Computing in C#.Net (hightest rated course)

https://www.udemy.com/course/udpsocketprogramming/?couponCode=BESTJULY2020

TCP/IP Socket Programming in C# .Net For Coders & Students (best selling course)

These coupons will stay alive only for five days, created as a new year's gift for everyone out there. Enroll in any of my C# .Net Udemy courses for as little as $9.99.
Hurry up, the discount will run out soon.


Hi, 

I hope you’re doing great. All of my courses are now available at the discount price of $9.99 each. Its a limited time offer, please click the links below enrol now. 

Appium WinAppDriver UI Automation Testing Windows Apps in C#(only dedicated course about WinAppDriver on Udemy in a post-CodedUI world)
TCP/IP Socket Programming in C# .Net For Coders & Students(best seller)
UDP Socket Programming For Distributed Computing in C#.Net(highly rated)
Windows Service Programming, Debugging, Installing in C#.Net

Best regards,

Naeem Malik.