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

How to do SMS, 2FA, and phone call testing using testRigor?

Nowadays, there are many scenarios where we test SMS and phone calls, especially when you are developing an app. You may have to validate the signup by sending an SMS or trying out a phone call validation.

So let’s see how we can make phone calls or send SMS with testRigor. Let’s get started.

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 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: testRigor uses Twilio to make phone calls and send and receive SMS. So, you need to configure the integration with Twilio. So make sure you have created a Twilio account and have Account Sid, Auth token, and service sid with you. Once you filled in the details provided in ‘Step 2’, click Advanced Settings.

Step 4: Click the Integrations dropdown, select Twilio, and add the details mentioned. To add these details, you should set up an account with Twilio. Once you complete the account setup with Twilio, you can add the following information by visiting the Twilio console page.

  • Account Sid
  • Auth Token
  • Phone Number
  • Service Sid

Step 5: Once you add the details, click on Create Test Suite.

On the next screen, you can let AI generate the test case based on your provided app description while creating the Test Suite. 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, click Add Custom Test Case.

Step 5: Provide the test case Description and add the test steps.

Test Cases: Phone call Validations

Test case 1: If you need to call a number and check if it has been picked up, write the test step as:
call "+15344297154" and validate it was picked up
Test case 2: To check if the call was answered, use:
make call to "+15344297154" and check it was answered
Test case 3: It’s straightforward to make a call without any checks:
call to +15344297154
Test case 4: For making a call and confirming it’s completed, the test step will be:
call "+15344297154" and check it was completed
Test case 5: If you have configured multiple numbers in Twilio, you can mention from which number the call has to go, like this:
call "+15344297154" from "+15551234567" and verify it is ringing
Test case 6: To check if the call from a particular number is ringing or not, we can add the test step as:
check that phone call from "+15344297154" is ringing
Test case 7: To check if the call from a particular number is answered, the test step would be:
check that phone call from "+15344297154" was answered
The number to call from is optional and may need to be allocated before use. Numbers to call from and to can be from stored values or parameterized strings:
call from stored value "allocatedNumber" to stored value "answerPhoneNumber"

Test Cases: Validation of SMS messages (Phone Text)

With Twilio integration, we can send messages. Since we have already configured the Twilio integration, we can directly use it.

Test case 1: For sending a message, use:
send sms to "+15344297154" with content "this is the content"
Test case 2: To validate if the message was sent, use the assertion as:
sms "+15344297154" with body "this is the content" and validate it was sent
Test case 3: To validate if the message was delivered, the test step is:
send message to "+15344297154" with text "this is the content" and check it was delivered
Test case 4: To validate if the message failed, use the below command with an assertion:
send message from "+15551234567" to "+15344297154" with text "this is the content" and check it was failed
Test case 5: To validate if the message was not delivered, test step is:
send message from "+15551234567" to "+15344297154" with text "this is the content" and check it was not delivered
Test case 6: You can also check the SMS message, validate it, and store the contents. For that, we can write the test script as:
check that sms from "+15551234567" to "+15344297154" contains "Code" and matches regex "Code\:\d\d\d\d" and save it as "sms"
Test case 7: You can then additionally apply the extract value command to get just the code like:
check that sms to "+12345678902" matches regex "Code\:\d\d\d\d" and save it as "sms"
extract value by regex "(?<=Code\:)[0-9]{4}" from "sms" and save it as "confirmationCode"
Test case 8: You can also check the SMS message, validate it, and store the contents. For that, we can write the test script as:
check that sms from “+15551234567" to “+15344297154" contains “Code" and matches regex “Code\:\d\d\d\d" and save it as “sms"

Test case 9: You can request a temporary phone number from Twilio. The below custom step will request a new phone number (Twilio charges will apply) and save it in a variable “newNumber”, which you can use to check for incoming calls or messages.

When the test run is finished, this number will be released automatically.
allocate a temporary number and save it as "newNumber"

SMS validation for 2FA

Here is a testRigor test case that shows how to log into an application that uses SMS 2FA as a security measure:
click "Sign in"
enter "jacob" into "Username"
enter "jacobs-secure-password" into "Password"
click "Verify me"
check that sms to "+12345678902" is delivered and matches regex "Code\:\d\d\d\d" and save it as "sms"
extract value by regex "(?<=Code\:)[0-9]{4}" from "sms" and save it as "confirmationCode"
enter saved value "confirmationCode" into "code"
click "Continue to Login"
check that page contains text "Welcome, Jacob!"

testRigor’s Capabilities

Apart from the simplistic test case design and execution, there are some advanced features that help you test your application using simple English commands.

  • 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 easily 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 are helpful for validating 2FA scenarios, with OTPs and authentication codes being sent to 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.

testRigor enables you to test web, mobile (hybrid, native), API, and desktop apps with minimum effort and maintenance.

Additional Resources

You're 15 Minutes Away From Automated Test Maintenance and Fewer Bugs in Production
Simply fill out your information and create your first test suite in seconds, with AI to help you do it easily and quickly.
Achieve More Than 90% Test Automation
Step by Step Walkthroughs and Help
14 Day Free Trial, Cancel Anytime
“We spent so much time on maintenance when using Selenium, and we spend nearly zero time with maintenance using testRigor.”
Keith Powe VP Of Engineering - IDT
Related Articles

All-Inclusive Guide to Test Case Creation in testRigor

Test cases fuel test automation tools. Over the years, the process of automating these test cases has undergone many changes. ...

How to Create Tests Using Live Mode in testRigor?

testRigor offers a unique capability known as the ‘Live Mode‘ to create and validate test cases. Using it, you can ...

CI/CD Series: testRigor and Azure DevOps

TestRigor manages different types of CI/CD tools in order to enhance with AI your workflows and pipelines. This time, we’ll ...
On our website, we utilize cookies to ensure that your browsing experience is tailored to your preferences and needs. By clicking "Accept," you agree to the use of all cookies. Learn more.
Cookie settings
Privacy Overview
This site utilizes cookies to enhance your browsing experience. Among these, essential cookies are stored on your browser as they are necessary for ...
Read more
Strictly Necessary CookiesAlways Enabled
Essential cookies are crucial for the proper functioning and security of the website.
Non-NecessaryEnabled
Cookies that are not essential for the website's functionality but are employed to gather additional data. You can choose to opt out by using this toggle switch. These cookies gather data for analytics and performance tracking purposes.