Turn your manual testers into automation experts! Request a DemoStart testRigor Free

How to add waits using testRigor?

Smart test automation tools like testRigor make sure to account for waiting mechanisms so that test cases do not fail unnecessarily. However, you might need explicit wait commands for certain end-to-end testing scenarios. Let’s explore how to add waits with testRigor through an example.

Pre-requisites to writing the test case

First and foremost, you need to create a test suite. Depending on the type of app you are testing, testRigor will ask you for details during test suite creation. Here are the general fields that will be visible to you during this process.

Step 1: Log in to your testRigor app with your credentials.

Step 2: Set up the test suite for the website testing by providing the information below:

  • Test Suite Name: Provide a relevant and self-explanatory name.
  • Type of testing: Select from the following options: Desktop Web Testing, Mobile Web Testing, Native and Hybrid Mobile, based on your test requirements.
  • URL to run test on: Provide the application URL that you want to test.
  • Testing credentials for your web/mobile app to test functionality which requires user to login: You can provide the app’s user login credentials here and need not write them separately in the test steps then. The login functionality will be taken care of automatically using the keyword login. However, this is an optional field and can be skipped if not relevant.
  • OS and Browser: Choose the OS Browser combination on which you want to run the test cases.
  • Number of test cases to generate using AI: You can simplify your test creation further by opting to generate test cases based on the App Description text. This feature works on generative AI.

Step 3: Click on Create Test Suite.

Note: On the next screen, you can let AI generate the test case based on the App Description you provided during the Test Suite creation. However, for now, select do not generate any test, since we will write the test steps ourselves.

Step 4: To create a new custom test case yourself, click Add Custom Test Case.

Test Case: Adding wait before checking emails

Email testing is a classic end-to-end testing scenario where you will be required to add explicit waits. We will explore this test scenario in the following sections.

Let’s take a look at every step that will be part of the testRigor test case.

Test Steps

Step 1: Come to the Test Cases section, provide the test case Description, and start adding the test steps. We will add test steps in the test case editor screen.

Step 2: Since we provided the website URL during test suite creation, testRigor automatically navigates to this website. There is no need to use a separate function to open the URL.

In this test case, however, we will be dealing with virtual mailboxes.

Step 3: In this test case, we are sending emails to a dummy email address. Using RegEx, we will generate this email address. The RegEx ‘[a-z0-9]{10}‘ means that our email address will have ten characters that can be either any lowercase alphabet between a and z or any number between 0 and 9. The email will have the domain ‘@testrigor-mail.com‘. For example, [email protected].

We will save this email as a variable called ‘newEmail’.
generate by regex "[a-z0-9]{10}\@testrigor-mail\.com", and save as "newEmail"
Step 4: We will now send three emails from ‘[email protected]’ to the new email address we created in the previous step.
send email from "[email protected]" to saved value "newEmail" with subject "Test message", and body "Hi, this is a first test, this is just a test message."

The subject of this email message will be ‘Test message’, and the body will be ‘Hi, this is a first test, this is just a test message.’

Step 5: Similarly, we will send the second email message with the same sender and recipient as above.
send email from "[email protected]" to saved value "newEmail" with subject "Test message", and body "Hi, this is a second test, this is just a test message."

The subject of this email message will be ‘Test message’, and the body will be ‘Hi, this is a second test, this is just a test message.’

Step 6: Finally, we will send the third message with the same sender and recipient.
send email from "[email protected]" to saved value "newEmail" with subject "Test message", and body "Hi, this is a third test, this is just a test message."

The subject of this email message will be ‘Test message’ and the body will be ‘Hi, this is a third test, this is just a test message.’

Step 7: Email delivery might take a few additional seconds, so adding a wait here is good practice.
wait 30 sec
Step 8: Finally, we will check that the recipient has received one or more of the emails. The wait command will help ensure that the emails that had to be triggered, have been triggered.
check that one or more emails to saved value "newEmail" were received

Complete test case

Here’s what the full test case will look like in testRigor.
generate by regex "[a-z0-9]{10}\@testrigor-mail\.com", and save as "newEmail"
send email from "[email protected]" to saved value "newEmail" with subject "Test message", and body "Hi, this is a first test, this is just a test message."
send email from "[email protected]" to saved value "newEmail" with subject "Test message", and body "Hi, this is a second test, this is just a test message."
send email from "[email protected]" to saved value "newEmail" with subject "Test message", and body "Hi, this is a third test, this is just a test message."
wait 30 sec
check that one or more emails to saved value "newEmail" were received

Viewing Test Results

Once the test is executed, you can view the execution details, such as execution status, time spent in execution, screenshots, error messages, logs, video recordings of the test execution, etc. In case of any failure, logs and error text are available easily in a few clicks.

Through the View Execution option, you can also download the complete execution, including steps and screenshots, in PDF or Word format.

testRigor’s Capabilities

With testRigor, you can test end-to-end test cases across various platforms like the web, desktop, and mobile. Using simple English commands, you can do the following.

  • Reusable Rules (Subroutines): You can easily create functions for the test steps that you use repeatedly. You can use the Reusable Rules to create such functions and call them in test cases by simply writing their names. See the example of Reusable Rules.
  • Global Variables and Data Sets: You can import data from external files or create your own global variables and data sets in testRigor to use them in data-driven testing.
  • 2FA, QR Code, and Captcha Resolution: testRigor efficiently manages the 2FA, QR Code, and Captcha resolution through its simple English commands.
  • Email, Phone Call, and SMS Testing: Use simple English commands to test the email, phone calls, and SMS. These commands help validate 2FA scenarios, with OTPs and authentication codes being sent via email, phone calls, or via phone text.
  • File Upload/ Download Testing: Execute the test steps involving file download or file upload without the requirement of any third-party software. You can also validate the contents of the files using testRigor’s simple English commands.
  • Database Testing: Execute database queries and validate the results fetched.

Additional Resources

Frequently Asked Questions (FAQs)

  1. Do I need to add waits before every single UI element interaction?

    testRigor is a smart tool that waits for the UI element to appear on the screen. However, if there are some situations wherein the wait time is explicitly needed, like for checking emails or waiting for file downloads, you can add a wait condition.

  2. Do I need to know coding to include the wait in testRigor?

    One of the best parts about using testRigor for testing is that it leverages generative AI to make test case writing as simple as plain English statements. If you take a look at their documentation, you’ll see just how easy it is to generate test cases for complex workflows in a couple of English statements. So, even if you aren’t proficient in coding, you can easily use this tool to create test cases.

Join the next wave of functional testing now.
A testRigor specialist will walk you through our platform with a custom demo.
Related Articles

How to Install Client Certificates in testRigor

Client certificates are one of several ways to allow users to authenticate their identity to a server, most often a private ...

How to do database testing using testRigor?

Database testing is crucial because it ensures the integrity and reliability of your application’s data. It verifies the ...

How to perform keyboard actions using testRigor?

Smart test automation tools like testRigor account for various ways for testers to interact with the system. You can copy and ...