Understanding how to maintain test scripts using QaSCRIBE
Options for maintaining Test Script
Your Application under Test (AUT) may constantly go through changes including layout changes that can impact test cases automated in Worksoft SaaS. These changes can impact existing locators invalid and until these are updated executing these tests in the cloud will lead to failures.
Using QaSCRIBE you can easily take care of such changes. QaSCRIBE provides two options for working on the locators.
a. Validate and update locators using Magic Wand, available at instruction level
b. Validate and update locators by performing local execution
Validate and update locators using Magic Wand
You have executed a test and it failed at an instruction with the error "Element not found". This typically means that the locator of the element has changed due to some recent AUT deployments to the environment. In such cases, you can rely on checking for the locator by using Magic Wand feature in QaSCRIBE.
Follow the below steps to validate and update these locators.
- Edit the test script that failed in the test execution
- Identify the instruction that failed and expand it. You will see a "shield" icon to the far right on the Target field. The colour of the icon depends on predecessor steps. If you followed the sequence listed here, the icon is shown in the "blue" colour. But, if you have performed local execution, the icon would show in either red or green colour depending on whether any of the locators are invalid or not.
- Upon clicking on the icon, you would see a popup with a list of options that you can choose. The options allow you to specify how you would like the validation to happen. In most of the cases, you would select the last option i.e. "Identify all the above" to ensure there are no hidden (invisible) elements that use the same locator as the element in question. By default, the first option is selected.
- Based on the option you selected in the above step, you will see one or more icons beside the locators available at the instruction. Click here to understand how the options work and what to expect for each locator.
Validate and update locators by performing Local Execution
You have seen a notification on recent AUT deployment with the list of changes. You are aware that a specific test script can fail because of the changes deployed to the environment. In that case, it would be faster for you to do a local execution and find out if any of the recent changes impact the test script.
When you execute a test script locally, you will see if any of the locators have changed for an element. If all locators are modified and QaSCRIBE cannot find the element execution stops at the impacted instruction. If one of the locators identifies the element, QaSCRIBE would proceed with the execution but will highlight the element in the "Design & Build" mode. Refer to the screenshot below.
Expanding the highlighted instruction (shown in the above screenshot) will bring up all the locators at the instruction level and will highlight locators based on the options selected in "My Project Settings for Test Scripts Module" section.
Please note that variables (System, User Defined Variables & Local Variables) would be overridden when the validation is performed. Such locators are identified by a keyword "Embedded Variable" (as shown in the screenshot below). If you chose to retain the variables, mouseover on the keyword will show the previous locator.
Please note, Validation of locators won't work on fields within in "iframes"