Quick Start with Desktop Automation

 

 

Before start to automate your Desktop project, You need a Windows OS machine and an executable (EXE) application file to test. In this example, We will use your Windows’ original Calculator application.

We will inspect elements with “Accessibility Insights for Windows“ application. You have to install this application before start.

Alternative tools to inspect:

Let’s start !

1- Create a new Desktop automate project

  • Click PROJECTS and select Desktop tab

  • Click ADD .EXE FILE button

  • SELECT FILE from your Computer (File Path “C:\Windows\System32\calc.exe”.)

  • Write App Name and Version and Click ADD PROJECT button

2- Record or develop your test cases

  • You will be navigated CASE MANAGEMENT automatically

  • Click ADD SECTION and write your SECTION name

  • Press ENTER to Save your Section

  • Click ADD CASE button

  • Write your TestCase Name and press ENTER

  • Select C# language and NUnit framework

  • Click ADD STEP button

  • Write your Step Title and Press ENTER

  • Click Edit button on Step and copy-paste the below Example Automation Script

  • Inspect the elements with Accessibility Insights for Windows or alternative tools.

  • Click SAVE SCRIPT button

Example Automation Script:

Thread.sleep(5000); WebElement calcFrame = driver.findElement(By.className("CalcFrame")); WebElement menu = driver.findElement(By.id("MenuBar")); WebElement viewMenu = menu.findElement(By.name("View")); viewMenu.click(); viewMenu.findElement(By.name("Scientific")).click(); Thread.sleep(2000); calcFrame.findElement(By.id("132")).click(); Thread.sleep(2000); calcFrame.findElement(By.id("93")).click(); Thread.sleep(2000); calcFrame.findElement(By.id("134")).click(); Thread.sleep(2000); calcFrame.findElement(By.id("121")).click(); Thread.sleep(2000);

3- Run a test and check the results

  • Click TEST RUNS tab to create a new Test Run

  • Click CREATE NEW TEST button to create a new Test Run

  • Set Your Test Name

  • Check your TestCase(s) which will run

  • Click SET TIME button

  • Click SELECT DEVICE button

  • Select Winium-Bot which will run your TestCases

  • Click RUN TEST button

  • After a few seconds, your test will start automatically. You can inspect the TestRun when the test goes RUNNING status

  • Click VIEW RESULTS button

  • You should see your TestCases with Steps and Overall status of your test

  • Click on any STEP name to inspect

  • Select Winium-Bot from the list

  • Review the Test Results (Request & Response Details, Console Logs, Error Logs..)