Conditional actions help you to execute steps only if certain conditions are met. For example, you want to click on a button only if it the page has title “Click Me”.
ifTitleEquals “ClickMe”
Click button
EndIf
Structure :
if<Condition> <parameters>
<Steps to execute if condition is true>
elseIf (Optional)
<Steps to execute if condition is false>
endif
Info |
---|
For the keywords under this list :
|
Action | Parameters | Example Usage | ||
---|---|---|---|---|
ifAlertExists
Check if an alert with a given text exists on the screen. If an alert is found then the following statements are executed. | Param 1 (Optional): Text to check in the alert.
| Example:
Checks if an alert exists and contains the text "Welcome" and time | ||
ifAndroid
To execute the next steps if user is executing on an android device. | Example
Checks if the user is executing test on an Android device or not. | |||
ifBluetoothDeviceConnected
To execute the next steps if Bluetooth device having name <PARAM1> is connected. | Param 1 : Name of the device | Example
Checks if Bluetooth device payPal is connected. | ||
ifBluetoothEnabled
To execute the next steps if Bluetooth is enabled on device. | Example
Checks ifBluetooth is enabled on device. If the condition is true, the appropriate steps are executed. | |||
ifBluetoothDisabled
To execute the next steps if Bluetooth is disabled on device. | Example
Checks ifBluetooth is disabled on device. | |||
ifChecked
To check if object (mentioned in objectName) is checked and perform appropriate actions only if element is checked. | Param 1 (Default : 60 sec): Timeout in seconds
| Example
Checks if the checkbox is checked on the object element 'bqObject'. | ||
ifDisabled
To check if object (mentioned in objectName) is disabled and perform appropriate actions only if disabled. | Param 1 : Timeout | Example
Checks if the mentioned object is disabled or not. | ||
ifDevice
To validate that the current device is of type defined in Param 1 and has a form factor defined in Param 2. | Param 1 : Type of device (Android / iOS) | Example
Checks if the device is an Android Phone or not & performs appropriate actions accordingly. | ||
ifDesktop
To execute the next steps if user is executing on desktop. | Example
Checks if the user is executing test on the Desktop or not. | |||
ifDecimal
To execute the next steps if the value (mentioned in Parameter) is decimal. | Param 1 : Value to check
| Example
Checks if the value is a decimal or not.
Checks if the value 12.8 on the object bqObject is a decimal or not. | ||
ifDate
To execute the next steps if the value (mentioned in Parameter) is in date format (mentioned in parameter 2). | Param 1 : Date value
| Example
Checks if the date value mentioned 02/02/2020 matches the provided date format MM/dd/yyyy.
Checks if the date value mentioned 02/02/2020 , on the object bqObject, matches the provided date format MM/dd/yyyy. | ||
ifDateTime
To execute the next steps if the value (mentioned in Parameter) is in date time format (mentioned in parameter 2). | Param 1 : Date Time value
| Example
Checks if the date time value mentioned 02/02/2020::15:25:45 matches the provided date time format dd-MM-yyyy::HH:mm:ss.
Checks if the date value mentioned 02/02/2020 , on the object bqObject, matches the provided date format MM/dd/yyyy. | ||
ifEqual
To compare the specified value in Parameter 1 with Parameter 2 and perform appropriate actions only if both are equal. | Param 1 : Source text to compare
| Example :
Checks if value in param 1 is equal to the value in param 2 or not. | ||
ifEnabled
To check if object (mentioned in objectName) is enabled and perform appropriate actions only if it is enabled. | Param 1 : Timeout | Example
Checks if the mentioned object is enabled or not. | ||
ifElementVisible
To check if object (mentioned in objectName) is visible on the screen and perform appropriate actions only if element is visible. | Param 1 : Timeout | Example
Checks if the element mentioned in bqObject is visible in mentioned timeout time or not. | ||
ifElementNotVisible
To check if object (mentioned in objectName) is not visible on the screen and perform appropriate actions only if element is not visible. | Param 1 : Timeout | Example
Checks that the element mentioned in bqObject is not visible in mentioned timeout time. | ||
ifEmpty
To check if the variable (variable name in Parameter 1) is empty. | Param 1 : Name if the variable to check | Example
Checks if the variable stored in Variable1 is empty of not. | ||
ifExcelRowCountEquals
To compare the total number of rows in the excel file is value (mentioned in Parameter 1) and perform appropriate actions only if it is equal. | Param 1 : Total number of rows | Example
Checks if the excel row count equals 20 or not. | ||
ifFolderExists
To check if folder (mentioned in Parameter 1) exists in file system at location (mentioned in Parameter 2) and perform appropriate actions only if folder exists. | Param 1 : Name of the Folder | Example
Checks if the folder named TestFolder is present at the mentioned location C:\Users\Public or not. | ||
ifFolderDoesNotExist
To check if folder (mentioned in Parameter 1) does not exist in file system at location (mentioned in Parameter 2) and perform appropriate actions only if folder does not exist. | Param 1 : Name of the Folder | Example
Checks that the folder named TestFolder is not present at the mentioned location C:\Users\Public. | ||
ifFileExists
To check if file (mentioned in Parameter 1) exists in file system at location (mentioned in Parameter 2) and perform appropriate actions only if file exists. | Param 1 : Name of the File | Example
Checks if the file named TestFile is present at the mentioned location C:\Users\Public or not. | ||
ifFileDoesNotExist
To check if file (mentioned in Parameter 1) does not exist in file system at location (mentioned in Parameter 2) and perform appropriate actions only if file does not exist. | Param 1 : Name of the File | Example
Checks that the file named TestFile is not present at the mentioned location C:\Users\Public. | ||
ifGreaterThan
To compare the specified value in Parameter 1 with Parameter 2 and perform appropriate actions only if the value in Parameter 1 is greater than the value in Parameter 2. | Param 1 : Source test to compare
| Example
Checks if value in param 1 is greater than param 2 or not. | ||
ifInteger
To execute the next steps if the value (mentioned in Parameter) is integer. | Param 1 : Value to check
| Example
Checks if the value is an Integer or not.
Checks if the value 12 on the object bqObject is an Integer or not. | ||
ifIos
To execute the next steps if user is executing on an iOS device. | Example
Checks if the user is executing test on an iOS device or not. | |||
ifLessThan
To compare the specified value in Parameter 1 with Parameter 2 and perform appropriate actions only if the value in Parameter 1 is less than the value in Parameter 2. | Param 1 : Source text to compare
| Example
Checks if value in param 1 is less than param 2 or not. | ||
ifLinux
To execute the next steps if user is executing on Linux machine. | Example
Checks if the user is executing test on a Linux machine or not. | |||
ifMac
To execute the next steps if user is executing on Mac machine. | Example
Checks if the user is executing test on a Mac machine or not. | |||
ifNotEmpty
To check if the variable (variable name in Parameter 1) is not empty. | Param 1 : Name if the variable to check | Example
Checks that the variable stored in Variable1 is not empty. | ||
ifNotChecked
To check if object (mentioned in objectName) is unchecked and perform appropriate actions only if element is unchecked. | Param 1 (Default : 60 sec) : Timeout in seconds
| Example
Checks if the checkbox is not checked on the object element 'bqObject'. | ||
ifNotEqual
Compare the specified value in Parameter 1 with Parameter 2 and perform appropriate actions only if both values are not equal. | Param 1 : Source Text to compare
| Example:
Checks if value in param 1 is not equal to the value in param 2 or not. | ||
ifNotSelectedItemInSpinner
To check if specified item (mentioned in Parameter 1) is not selected in spinner object (mentioned in objectName) and perform appropriate actions only if not selected. | Param 1 : Expected Spinner Item | Example
Checks if bqSpinner-1 is not selected in mentioned object bqSpinner. | ||
ifRadioSelected
To check if object (mentioned in objectName) is selected and perform appropriate actions only if the element is selected. | Param 1 (Default : 60 sec): Timeout in seconds
| Example
Checks if the radio box is selected on the object element 'bqObject'. | ||
ifRadioNotSelected
To check if object (mentioned in objectName) is not selected and perform appropriate actions only if the element is not selected. | Param 1 (Default : 60 sec): Timeout in seconds
| Example
Checks if the radio box is not checked on the object element 'bqObject'. | ||
ifSelectedInList
To check if specified value (mentioned in Parameter 1) is selected in object (mentioned in objectName) and perform appropriate actions only if selected. | Param 1 : Expected item in the list
| Example
Checks if Must Have is present in the list on the mentioned object. | ||
ifSelectedItemInSpinner
To check if specified item (mentioned in Parameter 1) is selected in spinner object (mentioned in objectName) and perform appropriate actions only if selected. | Param 1 : Expected Spinner Item | Example
Checks if bqSpinner-1 is selected in mentioned object bqSpinner. | ||
ifTitleEquals
To check if page title is equal to the specified value (mentioned in Parameter 1) and perform appropriate actions only if condition is true. | Param 1 : Title to compare
| Example
Checks if the window title is equal to "Login-bqurious" or not. | ||
ifTitleNotEqual
To check if page title is not equal to the specified value (mentioned in Parameter 1) and perform appropriate actions only if title is different from the value mentioned in Parameter 1. | Param 1 : Title to compare
| Example
Checks if the window title is not equal to "Login-bq" or not. | ||
ifTextExists
To check if text inside the Frame (Frame path or Index mentioned in Parameter 3) with match case exists on page and perform appropriate actions only if text exists. If objectName is mentioned then text will be searched first in the object only. | Param 1 : Text to verify | Example
Checks if text Email Address exists on the webpage.
Checks if text Email Address exists on the mentioned object. | ||
ifTextDoesNotExist
To check if text inside the Frame (Frame path or Index mentioned in Parameter 3) with match case does not exist on page and perform appropriate actions only if text does not exist. If objectName is mentioned then text will be searched first in the object only. | Param 1 : Text to verify | Example
Checks if text Email Address does not exist on the webpage.
Checks if text Email Address does not exist on the mentioned object. | ||
ifToolTipExists
To check if tooltip text (mentioned in Parameter 1) exists in object (mentioned in objectName) and perform appropriate actions only if tooltip exists. | Param 1 : Tooltip text present over the element | Example
Checks that the text Add Project exists over the mentioned object, when mouse hover is performed. | ||
ifTextExistsOnDevice
To check if text (mentioned in Parameter 1) exists on page and perform appropriate actions only if text exists. If object (mentioned in Object Name) is provided then text will be searched only in object. | Param 1 : Text to verify on the device | Example
Checks if text Welcome to bqurious exists on device page. | ||
ifTabExists
To check if tab name (mentioned in Parameter 1) exists in TabStrip (mentioned in Object Name) and steps in if block will only be executed if mentioned tab exists. | Param 1 : Name of the Tab | Example
Checks if Allocation tab exists in Tab Strip AssetTabStrip. | ||
ifTabNotExist
To check if tab name or index (mentioned in Parameter 1) does not exists in TabStrip (mentioned in Object Name) and perform appropriate actions only if tab name does not exists. | Param 1 : Name of the Tab | Example
Checks if Allocation tab does not exist in Tab Strip AssetTabStrip. | ||
ifTabSelected
To check if tab name (mentioned in Parameter 1) is selected in TabStrip (mentioned in Object Name) and steps in if block will only be executed if mentioned tab is selected. | Param 1 : Name of the Tab | Example
Checks if Allocation tab is selected in Tab Strip AssetTabStrip. | ||
ifTabNotSelected
To check if tab name (mentioned in Parameter 1) is not selected in TabStrip (mentioned in ObjectName) and steps in if block will only be executed if mentioned tab is not selected. | Param 1 : Name of the Tab | Example
| ||
ifToggleButtonState
To check if toggle button (mentioned in ObjectName) state is (State mentioned in Parameter 1)and perform appropriate action only if state is true. | Param 1 : Expected Toggle State (True / False) | Example
Checks if the bqToggleButton status is true or not. | ||
ifWindowWithTitleExists
To check if window exists with title (mentioned in Parameter 1) and perform appropriate actions only if the condition is true. | Param 1 : Title to compare
. | Example
Checks if the window with title "Login-bqurious" exists or not. | ||
ifWindows
To execute the next steps if user is executing on Windows machine. | Example
Checks if the user is executing test on a Windows machine or not. |
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|