Keywords Used in algoQA

Modified on Tue, 8 Oct at 5:37 PM

TABLE OF CONTENTS

1. Overview

1.1 General Keywords

1. Overview

This article describes about various keywords used, and their functionalities in algoQA. Keywords are used to define the parameters or conditions and actions within a test step.

1.1 General Keywords

The following table describes keywords used in algoQA and the description: 

Keyword Description 
||

You can pass '||' keyword during the node configuration to locate an iFrame in the following formats:
  • Xpath ||iframeindex
  • Xpath ||iframeID


In the preceding formats, system will read the code and switch to specified iframe within a web page and then search for an element using its XPath.


|
During the Node configuration, while configuring UI elements, you can pass the parameter in the following format in the Control Value textbox to update in separate columns:
<value>|<value>. You will see these values generated in the example table of the Feature File. 
Refer to DOUBLE_QUOTE<value>DOUBLE_QUOTE keyword section for the example table details.
--

Applicable to these actions: verify pdf data, verify file format, verify json file value, verify column name present in the spreadsheet and verify data present in the spreadsheet.

When entering data into specific cells within a Microsoft Excel spreadsheet using the file path format, you use the following structure:
-- path of the file,sheetname,celldata-rownumber-colnumber,celldata2-rownumber2-colnumber2

In this format, the "path of the file" represents the full path to the Excel file on your system where you intend to perform data entry operations.


For example, you have an excel file named 'SalesData.xlsx' located at C:\Users\YourUsername\Documents\. Within this file, there is a worksheet named 'QuarterlyReport' where you want to enter the following data:

  • "Total Sales" into cell B3 (2nd row, 3rd column).
  • "Average Revenue" into cell D5 (4th row, 5th column).

You can use the format (filePath, sheetName, celldata-rownumber-colnumber, celldata2-rownumber2-colnumber2) to specify these operations. For the preceding example, here is the path:

-- C:\Users\YourUsername\Documents\SalesData.xlsx,QuarterlyReport,"Total Sales"-2-3,"Average Revenue"-4-5.


-
Applicable to 'verify one of the value' action. Verifies any of the parameter values present on the page.
For example, 

On the MakeMyTrip.com, you would perform the action as follows:

verify one of the value from this list: Flights-Hotels-Homestays & Villas. 


Expected Outcome: The action checks if at least one of the following is displayed on the page:

  • Flights
  • Hotels
  • Homestays
  • Villas

If any of these options are visible, the verification is successful.

@@
Used as a custom-specific or project-specific tags which can be seen in Feature Files. For example, @@SmokeTest.

**
Applicable while using 'Remove all items' from the cart and 'scroll and verify tooltip' actions.
For example, in case of remove all items from the cart, either you can delete the item from the cart by clicking on the Delete icon or when a user clicks on the remove all items, a pop-up is displayed for confirmation then you can use this keyword using the following format: (//input[@aria-label='Remove'])[2]**//input[@aria-label='Remove'])[1]
This keyword is applicable to both mobile and web automation.
_and_
If you don't want the default last step (where the current screen is displayed with "NA") to appear in the Feature File, and instead wish to generate custom messages, you can use _and_ to combine conditions.

To access no postcondition option, navigate to Edit Scenarios > Edit Scenario Form > select 'no postcondition' from TestStep Settings dropdown option and provide custom messages in the Messages text box.
Example: Checking if a button is both enabled ( button must be active and available for interaction) and visible (must be displayed on the screen) before clicking it.

if (loginButton.isEnabled()_and_ loginButton.isDisplayed()) {

    loginButton.click();

}

Button Visibility and Enablement custom messages.


"Login button is visible and enabled. Proceeding with the click."

"Login button is not enabled, action cannot be performed."


DOUBLE_QUOTE<value>DOUBLE_QUOTE
While editing a scenario, if you enter a custom value into Custom Value text box in the format suggested in the left column, then you will see the value generated in the Example table of Feature File.
Note that you can add custom value into Custom Value text box while recording a scenario using Follow Me feature.
For example, consider a scenario where currency is to be verified for various countries.
GWT steps with the example table is as follows:
While editing a scenario in the Edit Scenario Form, if you wish to pass a parameter within a test step, then enter the value in the format suggested in the left pane by selecting inline drop-down option in the 'TestStep' Settings drop down list, then you will see the value in the corresponding GWT step in the Feature File.
Consider the same example, GWT step is highlighted in the screenshot:
If wish to generate these custom values with double quotes in a separate YML file, then enable Data Decoupling option in the Project Settings page.
For the same example, test data is generated in a separate YML file, as follows:

If you wish to remove the added double quotes, then enter the value in the following format:
 "<value>" .
<Value>COLON_COLON<Value>
During the Node configuration, while configuring UI elements, you can pass the parameter in the following format  <value>COLON_COLON<value> in the Control Value text box.
For example, 
In a given application, this parameter is used to filter and refine search results. If you wish to filter age between 18 and 35 while verifying patient details on an application, then you can add the parameter in this format - 18 COLON_COLON 35. You will see the age in the example table of the generated Feature File, as shown:
If wish to generate this parameter in a separate YML file, then enable Data Decoupling option in the Project Settings page.
For the same example, test data is generated in a separate YML file, as follows:
While generating test cases in API Test Automation, then you must pass the parameter in the 'Params' tab of the specific Request name in the following format: 
User::Email ID
You can generate the test data in a separate YAML file using the preceding format.
Feature File will be generated, as shown:


@randomemail

During Node configuration, when configuring UI elements, you can pass parameters in the following format: @randomemail. This format will generate a random email address with the default format @<randomname>@gmail.com in the report generated.

However, parameters can be customized to suit specific needs. For example, if you prefer to use a different email domain, you can specify the parameter as @[email protected]. This will generate a random email address with the domain @yahoo.com, such as [email protected].

For example, if you want to generate a random email address for user registration, you can use @randomemail. The system will create an email like [email protected] where user123 is a randomly generated name. Verify the registration process by checking that the registration is successful and that the confirmation message includes the generated email address.

Note that you will be able to see the randomemail generated in the scripts generated.

 
@randomtext

During Node configuration, when configuring UI elements, you can use the @randomtext parameter to generate random text. This parameter creates a string of random characters, which can be useful for fields requiring unique values, such as usernames or addresses.


For example, if you want to generate a random username for a new user registration, you can use the @randomtext parameter. This will produce a value like userXyZ123 where userXyZ123 is a randomly generated string. You can then use this randomly generated username to fill in the registration form and verify the registration process. Ensure that the registration is successful and that the confirmation message includes the randomly generated username.


@randomnumber

During Node configuration, when configuring the UI elements, you can use the @randomnumber parameter to generate a random numeric value. This parameter produces a number within a specified or default range, which can be useful for fields that require unique values, such as order numbers or IDs. For example, if you want to generate a random order number for a transaction, applying the @randomnumber parameter will produce a value like 4832, where 4832 is a randomly generated number within the default range (for example, 0 to 9999) or a specified range if provided. You would then use this randomly generated number in the transaction form. Ensure that the transaction is processed successfully and that the confirmation message includes the randomly generated order number.


@copiednumber


During Node configuration, when configuring UI elements, you can use the @copiednumber parameter to insert a previously copied numeric value into your fields. This parameter allows you to reuse a number that has been copied from an earlier step or from another part of the test. For example, if you copy an order number 7564 from one part of your test and use the @copiednumber parameter, it will insert 7564 into the current field. This is particularly useful for scenarios where you need to maintain consistency by reusing the same number across multiple steps or actions. Ensure that the copied number is correctly applied in the relevant fields and that any subsequent actions or verifications are consistent with this reused value.


@currentDirectory

During Node configuration, when configuring UI elements, you can use the @currentDirectory parameter to refer to the path of the current working directory within your test environment. This parameter dynamically inserts the path of the directory from which the test scripts are being executed. For example, if your test scripts are executed from the directory

C:\Users\Admin\Downloads\ScriptGeneration\AlgoAFScript

, using the @currentDirectory parameter will automatically insert C:\Users\Admin\Downloads\ScriptGeneration\AlgoAFScript into the relevant field. This is useful for scenarios where you need to specify file paths or directories relative to the test's execution of scripts. Ensure that the path inserted by @currentDirectory reflects the intended directory and is used in subsequent verifications.

@convertDate_10 Jan 2020_dd MMM yyyy_dd/MM/yyyy

During Node configuration, when configuring UI elements, you can use this parameter, which allows for flexible date formatting, enabling you to convert dates to your desired format.

Input Date: Specify the date you want to convert (for example, 10 Sep 2024).

Input Format: Define the format in which the input date is provided (for example, dd MMM yyyy).

Output Format: Indicates the output format as dd/MM/yyyy.

Example Combinations

You can use various combinations to achieve different results. Following are a few examples:

Example 1:

  • Input: 15 Mar 2024
  • Input Format: dd MMM yyyy
  • Output Format: dd-MM-yyyy
  • Result: 15-03-2024

Example 2:

  • Input: 01/04/2024
  • Input Format: dd/MM/yyyy
  • Output Format: yyyy-MM-dd
  • Result: 2024-04-01
_empty_
While editing the scenario in the Edit Scenario feature, you can enter this keyword in the Custom Value textbox when using the Verify Content action. The scripts will consider this keyword as an empty string and display it as blank.
During Node configuration, when configuring UI elements, you can use this parameter to consider empty string.
Example:
Navigate to the login page.

Enter a valid username.

Enter _empty_ in the password field. Password field will be empty

Click the login button. 

Upon clicking the login button, login will fail, asking you to enter the valid password.






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 at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article