Mobile App Automation Using Python Squish QT (QML)

Modified on Tue, 16 Apr 2024 at 06:39 PM

Overview 

This section introduces you to the Squish automation framework, guiding you through the process of creating, managing, executing, and maintaining test case scenarios leveraging algoQA automation process.


Prerequisites

  • To install Squish framework, see Squish installation guide.

    About Squish framework 
    Applicable for: Desktop, mobile and embedded systems automation types
    A squish serves as an automation tool designed for executing test scripts in the regression stage of software testing for user interfaces. algoQA with its extended capability supports Squish and helps you generate maintainable Squish scripts.

  • To set up and connect to a mobile emulator, refer to the Set up and Configuring Mobile Emulator.


Profiling 

Profiling is creating an offline model of an application under test (AUT), which involves mimicking a UI model of an AUT using nodes, features and UI elements. For more information, see Profiling.


Picking an object and inspecting using Squish

Squish allows you to "pick" GUI objects of the currently running application. Once picked the following can be done with the object:

  • Inspect the properties
  • Insert the methods
  • Create verification points for property values (property verification points)

If you have a test script already, perform the following:

  1. In the Application Objects, look for  icon to activate Squish in "pick" mode.
  2. Return to the Application Under Test (AUT) by clicking its window title bar once to give it focus.
  3. Mouseover the required object to inspect the element and selected element will be highlighted. All the properties will be displayed in the properties tab.  Choose the required attribute to locate the element.
  4. Navigate to Control List Panel window to update the locator. You can update the locator fetched from Object Spy tool and save it. Similarly, update the all the locators required for the objects.

     

Record the scenarios using FollowMe feature

Use case

This use case demonstrates the automation of a Calculator application by integrating algoQA with the Squish framework using the Python language. The example showcases the automation process, automating the steps of adding two numbers and verifying the sum.


Follow Me feature is used to record and save the workflow or scenario or use case. Scenario will be saved in the same sequence it has been recorded. 


Note: Recording for the Follow Me feature is done in offline model. It doesn't interact with the live application.


You can record scenarios by following the steps described in the 'Follow Me' section of the profiling article, using the use case steps provided in the use case section.

Generate Test cases

After recording the scenarios using Follow Me feature, next step is generating test cases.

Test cases are generated in Gherkin language and are Behavior-driven development (BDD) complaint. 

For more information, see Generate Test cases section in profiling article.


Editing Scenarios

Navigate to the Main Canvas, select Edit Scenarios from More Menu. All the scenarios corresponding to the project are listed in the following screen. Click Edit.

 

 


In the secondary screen, you can: 

  • Insert test steps between existing ones for more flexible scenario creation.
  • Add and list controls within the test steps.
  • Easily track the sequence of scenarios.
  • Use draggable functionality to arrange test steps.

Generating Test Scripts

This section helps you to choose required  language and automation framework to generate test scripts.

To Analyze and Generate scripts

  1. After generating Test Cases, in the Test case generation pop-up window, click the link Go for Script Generation.
    Make sure you select the appropriate language, framework and the Report Type by clicking the settings icon in the script generation screen. Click Update.
  2. In the script generation screen, navigate to the appropriate folder and select the test case files and click Analyze button.

  3. Scripts will be generated.

    You can download the script to your desired location and proceed to the execution.


Execution of the scripts


When using Squish with algoQA, the generated test scripts will be stored in the same Test Cases folder. You can choose to either download these test scripts to your local machine or import them into the Squish tool, depending on whether you are accessing the Squish tool on your local machine or a virtual machine.

After opening the scripts in the Squish , you can edit, review, and fix any issues, then rerun them. 


Execution Options:

You can execute scripts in two ways:

  1. Using Feature Files: Open the respective Feature File you want to execute in the Squish. You can either execute a single scenario or an individual step by right-clicking on the corresponding scenario outline or an individual step. You can execute entire Feature File by right-clicking on the respective file without opening it.
  2. Using Command Prompt: Alternatively, you can execute scripts using the command prompt, providing command-line instructions to run your tests.   











Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article