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

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 paste a text from the screen into a given field using mouse clicks, testRigor’s copy-paste commands, and even through keyboard simulations. Let’s take a look at how you can achieve this.

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: copy-pasting and searching strings using keyboard shortcuts

In this test case, we will select a string on the screen and try to copy, paste, clear, and search using keyboard shortcuts.

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.

Step 3: We will start by using a mouse action to select some text on the screen. When you use the ‘drag‘ command, you must tell testRigor the exact points on the screen between which it should drag the mouse. Using offsets, you can precisely pinpoint where the points need to be. These offsets are relative to the screen under test. To better visualize offsets, imagine the X and Y axes since you need to mention the coordinates of the points between which the mouse dragging needs to happen.

In the command below, we focus on the text we want to select on the screen, ‘automobile‘. Considering this as one whole element, we will start with offset as (0,5), which is the very start of this text. From there, we want to drag the mouse all the way to the point (75,5), which covers the entire text. So, across the X-axis horizontally, we moved from 0 to 75. Likewise, we maintained a height of 5 between the two points across the Y-axis or vertically. If you recall, this is how we can select a section using the mouse without releasing the click by moving the mouse horizontally and vertically.
drag "automobile" on the right of ", or an " with offset "0,5" to "automobile" on the right of ", or an " with offset "75,5" using the mouse
Step 4: We will now use the keyboard shortcut ‘Control + C‘ to copy the selected text.
enter ctrl+C
Step 5: To paste this copied text, we will activate the search bar on the top of the page.
click on "Search Wikipedia"
Step 6: Over here, we will use another keyboard shortcut ‘Control + V‘ to paste the copied text.
enter ctrl+V
Step 7: Using the ‘Control + A‘ shortcut, we will select the entire text in the search bar.
enter ctrl+A
Step 8: To delete the selected text, we will use the delete key.
enter delete
Step 9: Let’s search this blank field by using the enter key.
enter enter
Step 10: Searching this blank string will take you to the main search page. On this page, we will check if the text ‘Advanced search‘ is present above the word ‘Article‘.
check that page contains "Advanced search" roughly above "Article"

Complete test case

Here’s what the full test case will look like in testRigor.
drag "automobile" on the right of ", or an " with offset "0,5" to "automobile" on the right of ", or an " with offset "75,5" using the mouse
enter ctrl+C
click on "Search Wikipedia"
enter ctrl+V
enter ctrl+A
enter delete
enter enter
check that page contains "Advanced search" roughly above "Article"

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)

Do I need to know coding to include keyboard shortcuts 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.