DVA Prototype Test Automation Drive web page via script - AusDVA/myservice-prototype GitHub Wiki

TLDR

  1. Install Katalon Automation Recorder in Firefox or Chrome
  2. Find __ in toolbar; click to open
  3. Press record
  4. Start by typing or pasting URL into address bar
  5. Type text in to fields, click on buttons and navigate around
  6. When done click on Stop
  7. To replay select the script and hit Play.

Editing DVA Prototype Test Automation Drive web page via script

This documentation describes a process to automatically interact with the prototype at http://localhost:5000/ or http://myservice-disco.herokuapp.com/ or wherever. This can be done to perform automated testing, or simply during development to reach certain states.

For example, to start a claim, fill in details and click buttons to progress through screens. Then at a later date replay this.

Automated testing enables regression testing to show that any changes that have been made have not affected any existing functionality. However in saying this, we need to keep in mind that the prototype is not specifically intended to have any functionality. We need to consider the value of automated testing in the prototype.

However the tools and tricks that are described here apply to create true functional testing of the real application for example in Dev or Test.

The tools described here and the techniques are useful to developers as often we need to get the prototype in some state (for example select a claim and fill in some details). And it can be time consuming and mind-numbing to need to do this every time. Plus it becomes tedious to repeat the recipe to new-comers.

The tool that has been selected for this is the Katalon Automation Recorder, which is based on the Selenium IDE (however it hasn’t been updated since Firefox 55).

A decent tutorial for this is at DZone - https://dzone.com/articles/execute-automation-testing-in-3-steps.

A folder has been created to save test scripts in - myservice-prototype/test-scripts in https://github.com/AusDVA/myservice-prototype. Although this means that the scripts are version controlled, developers should not feel the need to maintain them with updates for new functionality. Whilst they work they are useful. But the effort to maintain could be too great. Instead remove or overwrite with a new script.

Replaying existing scripts

  1. Simply open your web browser of choice (Firefox or Chrome are the only choices I believe) and install the Katalon Recorder extension.
  2. Press the Katalon button on the browsers tool bar and its window should open.
  3. Next press the Test Suites Open button (the folder) and navigate to the test-scripts directory.
  4. Open the appropriate test script and hit play. This will exercise the UI and get the application in to some state described in the test script.

Changing replay speed

This is useful if the script is being used for a demonstration either to a new client or to new developer.

Press the 'change speed button' and adjust.

Change Speed Button Change Speed Control

Amending existing scripts

This is useful if an existing script is incomplete, or the existing script gets you to a "fork in the road" and you want to add new steps. In which case you would want to copy the existing script with a new name indicating what it achieves in the app.

There is no easy way to do this, however it can be done.

  1. Firstly treat the smallest atomic unit as a Test Suite since you can copy suites but not the test cases within them
  2. Open the 'base' test suite that you wish to amend Open Button
  3. Right-click on the test suite and 'save as' as the new suite's name (the name should reflect the new purpose)
  4. If required rename the suite's test cases that you wish to amend
  5. Add a new test case - it is a temporary container for the new steps
  6. Record the new steps (and Stop)
  7. Go in to the new test case and copy each command one-by-one and paste in to the other test case
  8. Right click on the temporary test case and choose Remove Test Case and answer No to Would you want to save this test suite?
  9. Right-click on the new Test Suite and Close Test Suite and answer Yes to Would you want to save this test suite?

Caveats

  • Katalon doesn't seem to have a way to show where mouse-clicks were made.
⚠️ **GitHub.com Fallback** ⚠️