ActionTypes

Action Types

Overview

The Mobile action types in Qyrus are divided into the below groups.

Action Type Fields

The required fields for each action can be categorized into the following:

  • Step Description

  • Element locator information

  • Data need to perform the action i.e. text to enter in a text field

Note: Every step requires a "Step Description" and an "Action Type"

***Note: Click on the eye icon with the slash in the data field of an action to hide any sensitive information while showing the script to someone else or from the reports page. ***

Launch

Go to URL

Navigates to the specified URL; used after opening a mobile browser

  • Required Inputs

    • URL

Launch

  • Launch the selected app

Conditional

Start if

To denote the start of the if condition. All the tests pertaining after this action type will be treated as steps inside the if condition and will be executed only if the condition is passed.

  • Required Inputs

    • Data

    • Verifier Type

    • Locator type and value

  • Optional Input

    • Index - Index value of the element

End if

  • To denote the end of the immediate above if condition

Gestures

Tap

Taps an element

  • Required Inputs

    • Locator type and value

  • Optional Input

    • Index - Index value of the element

Tap By Relative Coordinates

Taps an area on the screen with an identifier value and relative coordinates if the actual coordinates are not known.

  • Required Inputs

    • Device coordinates: (x, y) form where x and y are a percentage of an element size. x and y are between the number ( 1.00 - 0.00).

    • Locator type and value

  • Optional Input

    • Index - Index value of the element

Tap With Coordinates

Uses specified coordinates to tap the screen a selected amount of times.

  • Required Inputs

    • Tap Count

    • Coordinates

Double Tap

Double taps an element

  • Required Inputs

    • Locator type and value

  • Optional Input

    • Index - Index value of the element

Drag and Drop

Clicks and holds one element and drags that source element to a target element.

  • Required Inputs

    • Locator type and value of both the source element and target element.

  • Optional Input

    • Index - Index value of the element

Dynamic Tap

Taps on an element that has its value dynamically generated. Requires the use of the "Create Variable" action type to find the dynamic value of that element and store that value so it can be used with the "Dynamic Tap" action type.

  • Required Inputs

    • Data from created variable

    • Locator type and value

Dynamic Double Tap

Double taps on an element that has its value dynamically generated. Requires the use of the "Create Variable" action type to find the dynamic value of that element and store that value so it can be used with the "Dynamic Double Tap" action type

  • Required Inputs

    • Data from created variable

    • Locator type and value

  • Optional Input

    • Index - Index value of the element

Go Back

Goes back a page or takes you back to the home screen

Long Press

Performs a long press on an element

  • Required Inputs

    • Locator type and value

Open Notifications

Opens the notifications section of the phone

Press Home

Taps the "home" button on the device.

Swipe Gestures

Custom Swipe

Selects a number of swipes according to entered coordinates (x1, y1, x2, y2). The first set of coordinates is the starting point of the swipe with the last set being the ending point of the swipe.

  • Required inputs

    • Swipe count

    • Swipe coordinates for the starting point

Swipe Up

Performs Swipe Up operation on the device. The number of swipes can be specified in the data field.

  • Required Inputs

    • Number of swipes

Swipe Down

Performs Swipe Down operation on the device. The number of swipes can be specified in the data field.

  • Required Inputs

    • Number of swipes

Swipe Element

Performs a swipe on a specific element.

  • Required Inputs

    • Swipe coordinate

    • Locator type and value

  • Optional Input

    • Index - Index value of the element

Swipe Left

  • Performs a swipe left operation on the device. The number of swipes can be specified in the data field.

  • Required Inputs

    • Number of swipes

Swipe Right

Performs a swipe right operation on the device. The number of swipes can be specified in the data field. Default data value is 1.

  • Required Inputs

    • Number of swipes

Swipe To Element

Performs a swipe on a specific element which is not visible on the screen.

  • Required Inputs

    • Number of swipes

    • Swipe direction

    • Locator type and value

  • Optional Input

    • Index - Index value of the element

Wait Actions

Wait

Waits for a specified amount of time.

  • Required Inputs

    • Wait duration (in seconds)

Wait Until

Waits for a specified element to appear.

  • Required Inputs

    • Wait duration (in seconds)

    • Locator type and value

  • Optional Input

    • Index - Index value of the element

Wait Until Element Contains Text

Waits for an element to contain text

  • Required Inputs

    • Expected Value

    • Max wait duration (in seconds)

    • Locator type and value

  • Optional Input

    • Index - Index value of the element

Wait Until Element Has Text

Waits until an element has text

  • Required Inputs

    • Expected value

    • Max duration (in seconds)

    • Locator type and value

  • Optional Input

    • Index - Index value of the element

Wait Until Element Is Clickable

Waits until an element can be clicked

  • Required Inputs

    • Max duration (in seconds)

    • Locator type and value

  • Optional Input

    • Index - Index value of the element

Wait Until Element Matches Pattern

Wait until an element matches a given specified pattern.

  • Required Inputs

    • Expected value

    • Max duration (in seconds)

    • Locator type and value

  • Optional Input

    • Index - Index value of the element

Window Actions

Landscape

  • Sets phone to landscape view.

Portrait

  • Sets phone to portrait view.

Push File

Adds the selected file to a device's internal storage. This feature is currently only supported for Android devices.

  • Required Inputs

    • Select File - File that is uploaded from the ‘File Management’ tab in the ‘Setup’ page (only accepts .png, .pdf and .jpg)

Install

Installs an application while running the test script. Just provide the URL in the Data field.

  • Required Inputs

    • Select App - An app that is uploaded from ‘Application Management’ in ‘Setup’

Uninstall App

Uninstalls the app with the given app package or bundle ID

  • Required Inputs

    • Data - App package (Android) or bundleId (iOS)

Close App

Closes the app

Reset App

Closes the app and opens it up again

Switch App

Switches between multiple apps.

  • Required Inputs

    • Data - appPackage/appActivity (Andorid) or bundleId (iOS)

Switch Context

Switches automation control between web views in a hybrid app.

  • Required Input

    • Data - the context to switch the automation control

Terminate App

Terminates the application

  • Required Input

    • Data - the appPackage/appActivity (Andorid) or bundleId (iOS) of the app

Get All Context

  • Provides a list of all available views

Activate App

Activates the specified app

  • Required Input

    • Data - the appPackage/appActivity (Andorid) or bundleId (iOS) of the app

Hardware Actions

Volume Down

  • Lowers the phone’s volume.

Volume Up

  • Raises the phone's volume.

Change Network Speed

  • Change the network speed of the selected mobile device.

  • Required Inputs

    • Network Profile - predefined network profiles in a dropdown

  • The network profiles included are listed below:

    Profile Name
    Bandwidth
    Loss
    Delay

    Wifi

    100mbps

    0%

    0ms

    2g-gprs-good

    50kbps

    1%

    500ms

    2g-gprs-lossy

    30kbps

    2%

    650ms

    edge-good

    250kbps

    0%

    300ms

    2gedge-lossy

    150kbps

    1%

    500ms

    3g-utms-good

    400kbps

    0%

    100ms

    3g-umts-lossy

    400kbps

    1%

    200ms

    3.5g-hspa-good

    1800kbps

    0%

    100ms

    3.5g-hspa-lossy

    900kbps

    1%

    190ms

    4g-lte-good

    18000kbps

    0%

    100ms

    4g-lte-high-latency

    18000kbps

    0%

    3000ms

    4g-lte-lossy

    7000kbps

    1%

    120ms

    4g-lte-advanced-good

    25000kbps

    0%

    80ms

    4g-lte-advanced-lossy

    15000kbps

    1%

    70ms

Input Events

Clear

  • Clears any values entered in a field.

  • Required Inputs

    • Locator type and value

  • Optional Steps

    • Index - index value of the element

Press Keys

  • Inputs keys from the phone's keyboard. Separate keys to be pressed with a "+"

  • Required Input

    • Data for the keyboard action

Send Text

Sends a value to a text field

  • Required input

    • Data that the user wants to send as input

Set

Sets a value to a text field or spinner wheel.

  • Required input

    • Data that the user wants to send to an input field

    • Locator type and value

  • Optional Steps

    • Index - index value of the element

Set Clipboard Text

Sets the clipboard text to the one specified.

  • Required Input

    • Data - the data to be set in the clipboard text

API

Get

Use a GET API call to get a response from an API

  • Required Input

    • Step Description - description of the step

    • URL - url of the api

  • Optional

  • First click the “Add” button to add a row to the table

    • Query Params - Key and Value parameters to be added at the end of the URL

    • Headers - Any additional information to be added to process the API call

    • Extract From Response - Extract data from the response path and stores it into a local variable

      • Variable Name - Name of the variable

      • Path - path to desired field from the response JSON

        • default is entire response is stored into the variable

        • EX. people[0].name.height

    • Set to Request - The “Set to Request” tab is used to modify the request of the API based on previously created variables

      • All of the fields are mandatory expected for “Parameter Location” when the “Parameter Type” is “Request Body”

Post

Use a POST API call to get a response from an API

  • Required Input

    • Step Description - description of the step

    • URL - url of the api

  • Optional

  • First click the “Add” button to add a row to the table

    • Query Params - Key and Value parameters to be added at the end of the URL

    • Headers - Any additional information to be added to process the API call

    • Body- Any request body required for the API

    • Extract From Response - Extract data from the response path and stores it into a local variable

      • Variable Name - Name of the variable

      • Path - path to desired field from the response JSON

        • default is entire response is stored into the variable

        • EX. people[0].name.height

    • Set to Request - The “Set to Request” tab is used to modify the request of the API based on previously created variables

      • All of the fields are mandatory expected for “Parameter Location” when the “Parameter Type” is “Request Body”

Put

Use a PUT API call to get a response from an API

  • Required Input

    • Step Description - description of the step

    • URL - url of the api

  • Optional

  • First click the “Add” button to add a row to the table

    • Query Params - Key and Value parameters to be added at the end of the URL

    • Headers - Any additional information to be added to process the API call

    • Body- Any request body required for the API

    • Extract From Response - Extract data from the response path and stores it into a local variable

      • Variable Name - Name of the variable

      • Path - path to desired field from the response JSON

        • default is entire response is stored into the variable

        • EX. people[0].name.height

    • Set to Request - The “Set to Request” tab is used to modify the request of the API based on previously created variables

      • All of the fields are mandatory expected for “Parameter Location” when the “Parameter Type” is “Request Body”

Delete

Use a DELETE API call to get a response from an API

  • Required Input

    • Step Description - description of the step

    • URL - url of the api

  • Optional

  • First click the “Add” button to add a row to the table

    • Query Params - Key and Value parameters to be added at the end of the URL

    • Headers - Any additional information to be added to process the API call

    • Body- Any request body required for the API

    • Extract From Response - Extract data from the response path and stores it into a local variable

      • Variable Name - Name of the variable

      • Path - path to desired field from the response JSON

        • default is entire response is stored into the variable

        • EX. people[0].name.height

    • Set to Request - The “Set to Request” tab is used to modify the request of the API based on previously created variables

      • All of the fields are mandatory expected for “Parameter Location” when the “Parameter Type” is “Request Body”

Data Handlers

Get Element Count

Return how many times an element appeared

  • Required Input

    • name for variable

Create Variable

Create a variable based on the element and its given property.

  • Required Input:

    • Variable Name: create a name for which this variable will be called.

    • Data Column - select the variable to be used

    • Locator type and value

    • Property - property of the element (text, attribute)

  • Optional Steps

    • Index - index value of the element

Verify OTP

Used to enter a One Time Password into an element during a running Qyrus test

  • Required Inputs:

    • Data Column - a variable name to store the OTP

    • Elements locator type and value.

  • Optional Steps

    • Index - index value of the element

Executing a Verify OTP step

  1. Run Execute Test on the script and enable the OTP option under “Advanced Options

  2. Under Actions header, click the “Verify OTP”

  3. Enter in the OTP and press the green checkmark

Dynamic Contains

Verify given element contains the text of the selected local variable’s text.

  • Required Input:

    • Data Column - select the variable to be used

    • Locator type and value

  • Optional Steps

    • Index - index value of the element

Dynamic Element Exists

Verify the selected local variable’s expected element exists on the actual given element.

  • Required Input:

    • Data Column - select the variable to be used

    • Locator type and value

Dynamic Press Keys

Enters the text saved in the selected local variable.

NOTE:

  • Required Input:

    • Data Column - select the variable to be used

    • Locator type and value

Dynamic Set

Input the selected local variable data into an element.

  • Required Input:

    • Data Column - select the variable to be used

    • Locator type and value

  • Optional Steps

    • Index - index value of the element

Dynamic Verify

Verify the element’s value is the same as the text value in the selected local variable.

  • Required Input:

    • Data Column - select the variable to be used

    • Locator type and value

  • Optional Steps

    • Index - index value of the element

Dynamic Verify Is Not

Verify the element’s value is not the same as the text value in the selected local variable.

  • Required Input:

    • Data Column - select the variable to be used

    • Locator type and value

  • Optional Steps

    • Index - index value of the element

Dynamic Verify Attribute

Verify the element's attributes in the data field from the given attribute in the selected local variable.

  • Required Input:

    • Data Column - select the variable to be used

    • Locator type and value

  • Optional Steps

    • Index - index value of the element

Get Clipboard Text

Get the data from the device’s clipboard

Set Location

Sets the device's location by latitude, longitude and altitude. Setting a wrong altitude value can yield improper data on an otherwise correct location.

  • Required Inputs:

    • Latitude/Longitude/Altitude

      • Example “38.25/-85.26/120

Execute Test Case

Execute Test Case enables user to invoke/call another script within a script. Execute Test Case enables re-usability of test scripts within the scripts.

  • Note:- Execute Test Case can only invoke scripts that do not have Execute Test Case step within them.

    • Execute Test Case used in the following ways: Required Inputs:

      • Script Name- User has to select the script which has to be invoked. Optional Inputs:

      • Data-

      • After clicking on Parameterization icon Data Column field is used to parameterize the execute test step

      • The Data field is used to run the parameterized scripts of the invoked script.

      • Execute Test case step cannot be made as optional step.

  • On click on “Select Script” button, all the Modules will be displayed under the particular project

  • On click on particular Suite, user is allowed to select the script and invoke those scripts.

Parameterization for ExecuteTestCase with various scenarios:

  1. If the Test 1 has parameterized step with 2 rows of data , User can use Test 1 in Test 2 and in the Data field user can specify the Excel TestCase serial name(ex: Tc_1),So for this particular Test data execution will happen.

  2. If the Test 1 has parameterized step with 2 rows of data , User can use Test 1 in Test 2 and in the Data field user can specify (ex: *),So for this it will consider both data and execution will happen for 2 iteration then it will proceed to next step.

  3. User can use multiple ExecuteTestCase in single test but the test which user invokes should not contain ExecuteTestCase step.

  4. User can parameterize the ExecuteTestCase step :-(considering Test 1 and Test 2) Where user can call the test data in the below format. In Test 2(Paramaterized data):-

If the user add Case3 and give Tc_3 it will not execute since Tc_3 data is not present in T_est 1_

Note:- Parameterization of ExecuteTestCase will allow the user to include the steps which is apart from ExecuteTestCase step in single iteration.

Execute Java Code

  • Allows user to Execute a java code at runtime and also allows the user to determine whether the step has passed or failed.

    • Required inputs:

      • Code : user can paste the java code(JAVA Class) to compile and execute

      • Class Name : Name of the class that the user has entered in the code text area, that is to be compiled and executed

      • Method Name : Name of the method that has to be executed within the java class entered by the user, the method has to take in one parameter of the type RemoteWebDriver.

      • The Method to be executed has to be a static method

    • Optional inputs: None

    • Usage: The user can use the driver object to execute any selenium operations, the user can also mark the status of the script as Pass/Fail in the following way below:

    • To Use The Driver Object : the method to be executed has to be a static method and should have a parameter of type RemoteWebDriver. The parameter can then be consumed by the method as a Selenium Driver Object, the session that is handed over to your method is the same session being used by your Test Script.

    • Example: In the below example consider the function to invoke is myFunction in your Java class, the code would look like something shown below.

      •   public static void myFunction(RemoteWebDriver driver) {
          		System.out.println(driver.getCapabilities().asMap());
          		WebElement element = driver.findElementById("someElementID");
          		System.out.println("Code succesfull");
          	}
    • To Set The Status Of Your Test: The user has the freedom to manipulate the status of this step based on any condition they feel is satisfied/unsatisfied . To do this the user has to include a method in his class and invoke that method anywhere in his code to set the Status to Pass/Fail, if not included the default status is set to Pass. Example: In the below example is the method that is to be added to the Class and invoked.

    •   public static void setStatus(String status) {
        		if (status != null)
        			try {
        				Path path = Files.write(Paths.get("status.txt"), status.getBytes());
        			} catch (Exception e) {
        				e.printStackTrace();
        			}
        	}

A Complete Example is Shown Below:

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.openqa.selenium.remote.RemoteWebDriver;
public class MyClass {
	public static RemoteWebDriver driver=null;
	public static void myFunction(RemoteWebDriver d) {
		driver = d; //to use our runtime driver
		System.out.println(driver.getCapabilities().asMap());
		System.out.println("Code succesfull");
		setStatus("Fail"); //To set Fail Status
		setStatus("Pass"); //To set Pass Status
	}
	public static void setStatus(String status) {
		if (status != null)
			try {
				Path path = Files.write(Paths.get("status.txt"), status.getBytes());
			} catch (Exception e) {
				e.printStackTrace();
			}
	}
}

Execute Query

  • Executes a given query and saves the response to a variable for use. Can only be used if the database is configured in the “Setup - Database Configuration” page

    • Required inputs:

      • Data Column - Variable name to store value for reuse

      • Query – SQL query statement

      • Key Extractor - Key whose value needs to be extracted

Extract Words

  • Specify an index range in the data field. Action type then extracts the characters from the given data in the selected local variable.

    • Example: 123,123,123 is the data in the local variable

      • Extract words: “0|6” returns “123,12”

    • Required Input

      • Data - Value which needs to be extracted from the stored variable’s text

      • Data Column - Variable name that contains value of the text

Remove Words

  • Remove the text or character from the given data in the selected local variable

    • Example: 123,123,123 is the data in the local variable

      • Remove Words: “,” returns “123123123”

    • Required Input:

      • Data - character(s) that needs to be removed from the variable

      • Data Column - select the variable to be changed.

Modify Dynamic Value

  • Modifies the selected created local variable with the data in the data field

    • Required Input

      • Data - text to overwrite existing text in the local variable

      • Data Column - select which variable data needs to be changed

Verifier

Contains

  • Verifies if the element contains the data from data field

    • Required Inputs

      • Element’s locator type and value

      • Data - value of the attribute to be checked

    • Optional Steps

      • Index - index value of the element

Is Visible

  • Verifies if the element is visible

    • Required Inputs

      • Element’s locator type and value

    • Optional Steps

      • Index - index value of the element

Is Blank

  • Verifies that the element is blank

    • Required Inputs

      • Element’s locator type and value

    • Optional Steps

      • Index - index value of the element

Verify Attribute Is Not

  • Verifies the attribute (name, src, width, title, value, etc.) of an element is not the value specified in the data field.

    • Required Inputs

      • Element’s locator type and value

      • Data - value of the attribute to be checked

    • Optional Steps

      • Index - index value of the element

Verify Attribute

  • Verifies the attribute (name, src, width, title, value, etc.) of an element is the value specified in the data field.

    • Required Inputs

      • Element’s locator type and value

      • Data - value of the attribute to be checked

    • Optional Steps

      • Index - index value of the element

Verify Text

  • Verifies given element’s text matches the text from the data field.

    • Required Inputs

      • Element’s locator type and value

      • Data - expected text to be verified by the actual element text

    • Optional Steps

      • Index - index value of the element

Verify Clipboard Text

  • Verifies that the data is in the clipboard of the device

    • Required Inputs

      • Data - expected text to be verified from the actual clipboard text

Verify Push Notification Text

  • Verifies that the information in the notification is the specified text.

    • Required Inputs

      • Data - expected text to be verified from the actual push notification text

Verify Greater Than

  • Verifies if the the value of the given locator (Id value) is greater than the number in the data field

    • Required Inputs

      • Element’s locator type and value

      • Data - number to be compared with the value found by the locator

    • Optional Steps

      • Index - index value of the element

Verify Less Than

  • Verifies if the the value of the given locator (Id value) is less than the number in the data field

    • Required Inputs

      • Element’s locator type and value

      • Data - number to be compared with the value found by the locator

    • Optional Steps

      • Index - index value of the element

Verify Not Null

  • Verifies if the the value of the given locator (Id value) is not null

    • Required Inputs

      • Element’s locator type and value

    • Optional Steps

      • Index - index value of the element

Verify Regular Expression

  • Verifies the regular expression pattern provided in the field value of "Verify Regular Expression" action type for the specified field.

    • Required Inputs

      • Element’s locator type and value

      • Data - input field for the wanted regular expression

    • Optional Steps

      • Index - index value of the element

Element Verifiers

Verify Element Count

  • Verifies the count of the given element

    • Required Inputs

      • Element’s locator type and value

      • Data - counts the amount of times an Element shows up

    • Optional Steps

      • Index - index value of the element

Element Position Is

  • Verifies if an element is in the {x , y} coordinates specified by the value in the data field

    • Required Inputs

      • Element’s locator type and value

      • Data - the { x , y } coordinate of the position to be checked

    • Optional Steps

      • Index - index value of the element

Element Position Is Not

  • Verifies if an element is not in the {x , y} coordinates specified by the value in the data field

    • Required Inputs

      • Element’s locator type and value

      • Data - the { x , y } coordinate of the position to be checked

    • Optional Steps

      • Index - index value of the element

Element Not Exists

  • Verifies an element does not exist

    • Required Inputs

      • Element’s locator type and value

    • Optional Steps

      • Index - index value of the element

Element Exists

  • Verifies if the elements exists

    • Required Inputs

      • Element’s locator type and value

    • Optional Steps

      • Index - index value of the element

Element Enabled

  • Verifies if the element is disabled/has enabled tag.

    • Required Inputs

      • Element’s locator type and value

    • Optional Steps

      • Index - index value of the element

Element Disabled

  • Verifies if the element is disabled/has disabled tag.

    • Required Inputs

      • Element’s locator type and value

    • Optional Steps

      • Index - index value of the element

AI (Beta)

NOTE for AI actions types, select the AI action type first, push it to the script, and then upload an image

Click By Image

  • Clicks on uploaded image on the device’s screen

Set By Image

  • Finds the uploaded image field on the device’s screen and sets the given user data in that field.

    • Required Inputs

      • Data - text data to be entered into the element

Verify By Image

  • Verifies that the uploaded image appears on the device’s screen.

Last updated