Automate Website Testing
Automate Website Testing even if the layout or content of the web page changes. Due to marketing programs or due to design changes often your website changes. If your website testing software is not designed to handle it, you will have to create thousands of test cases again.
Automation Anywhere Web Recorder offers advanced features so that your test cases will still work as intended even if your website changes.
Note: This sample task uses test pages on our server to illustrate feature. It can be applied to any similar scenario on any website.
Note: Save the .atmx file in My Documents -> Automation Anywhere -> Automation Anywhere -> My Tasks
Record a new task
- Click on Tools->Web Recorder.
- Type in http://www.tethyssolutions.com/Test-Links1.htm and click on Start
- Click on Link1. It will take you to http://www.tethyssolutions.com/automation-software.htm
- Stop Recording and Save the task.
Test your changed web page
- When you run this task, it will open Test-Links1.htm web page and look for a hyperlink named Link1 and clicks it. Now let's say your web page changes and of the following scenario occurs.
Scenario 1 (Link name is same but URL changes):
- Let's say your web page changed and the name of the Hyperlink (for e.g. Link1) remains the same but the actual link that it points to (in above example http://www.tethyssolutions.com/automation-software.htm) changes.
- When you run the above recorded task, it will still look for Link1 and clicks it, whatever URL that maybe (This is the default behavior of Web Recorder. You do not need to do any additional setting for this.)
Scenario 2 (Link name changed but URL is same):
- On website due to marketing programs or new design layout often the name of the hyperlink changes but the actual URL points to the same web page. e.g. http://www.tethyssolutions.com/Test-Links2.htm
- In this case, for website testing you still want to click the link and continue testing (as oppose to test case fails).
- Automation Anywhere Web recorder offer advanced setting that allows you to specify this. Select your task and click on Edit. Double-click the Click event and click on the Advance button.
- Select the checkbox URL
- Checking this option will tell Automation Anywhere not to look for the Hyperlink named Link1, instead look for the recorded URL and navigate there.
Scenario 3 (Link and URL both changed):
- Similarly let's say that both the name of the Hyperlink and the URL that it points to changed. For e.g. in http://www.tethyssolutions.com/Test-Links3.htm
- But you still want to click on the Hyperlink that appears at that location. For e.g. let's say you want to always click on the third headline on www.cnn.com.
- In order to account for this select your task and click on Edit. Double-click the Click event and click on the Advance button.
- Select the checkbox Index as shown in the. Checking this option will tell Automation Anywhere not to look for the Hyperlink named Link1 or actual URL, instead look for the link that has the same index.
- To simulate this, you can change the first line of the task to go to http://www.tethyssolutions.com/Test-Links3.htm and then run the task. Web recorder will click the link.
This task illustrate the usage of the Advanced options that you can set in your Web Recorder Link command to automate the web site testing.