1. Install Kantu
  2. Record a script using Kantu
  3. Test the script in Kantu
  4. Troubleshoot script issues using Kantu
  5. Revise the script as necessary
  6. Upload the script to APM

Rather than manually entering all script commands, you can use a 3rd-party script recorder, such as UI.Vision Kantu for Chrome, to record your interactions with a web application and automatically generate the Selenium script to mimic your interactions. Kantu creates the script by recording your mouse clicks and key strokes as you interact with a web application - just like recording a macro.

As recording a script is just a starting point, it is likely that, once recorded, you will need to revise it manually. In particular, you may need to make web element locators more robust and you may need to manually add waits, assertions, or tests. For example, adding a command that waits for something to load, or checks that a certain label exists, or checks that something is visible. You may also need to resolve one or more common issues. Once you are happy with the script, you copy it from the recorder to the appropriate web app group workflow in APM and preview the script execution on a monitoring point.

The following steps describe how to use Kantu (V5.0.1) to record your scripts. The steps are similar with other script recorders.

Install Kantu

To install Kantu:

  1. Open the Chrome browser.
  2. Go to the UI.Vision Kantu for Chrome page.
  3. Click Add to Chrome.
  4. Click Add extension.
    • The Kantu is loaded into Chrome.

Record a script using Kantu

Before recording, take some time to plan your steps through the app, and the results you expect to see from it. Start out small. Record a few lines and verify that they play back successfully before moving on.

To record a script using Kantu:

  1. Open the Chrome browser.
  2. Navigate to the target URL (the URL of the web app you are creating the script for).
  3. Click the “UI.Vision Kantu for Chrome” icon on the top right of the Chrome browser.
  4. Click + Macro.
  5. Specify the name of the new macro.
  6. Click Confirm.
    • A new macro is created and selected.
  7. Click Record to start recording.
  8. Execute the planned workflow at the target URL.
    • Confirm that your actions are being recorded in Kantu.
    • If an action can’t be recorded, move on and deal with it in the troubleshooting phase.
  9. Click Stop Record to stop recording.
  10. Click Save to save the recording.

Test the script in Kantu

Once the script is recorded, play it back to make sure there are no errors.

To play the script in Kantu:

  1. Click Play Macro.
    • You will see the script executing the recorded commands in the Chrome browser.
    • The Logs tab shows the commands being executed.

Troubleshoot script issues using Kantu

Use the Logs tab at the bottom of Kantu to review any error messages. Update the script accordingly and play it back again until there are no errors. Use the Resolving Common Issues page for assistance.

Revise the script as necessary

If you need to add commands to pause script execution or to test for things like the visibility or existence of various page elements, this is done by manually entering commands in the script.

To add a command to the script:

  1. Right-click the command above the one you want to insert and click Insert new line.
  2. In the Command field, select the command you want to add.
  3. In the Target field, enter the locator that identifies the target element the command is to act on (if applicable).
  4. In the Value field, enter a value required by the command (if applicable).
  5. Click Save.

Continue to revise the script and testing it as necessary to confirm that it behaves as expected. You can find helpful tips identifying web elements, resolving common issues, and dealing with Javascript pop-ups.

Upload the script to APM

In order to run the script from your monitoring points, you need to upload it to the workflow of a web app group in APM.

To upload the script to APM:

  1. In Kantu, in the left panel, right-click the name of the script you recorded and select Export as JSON.
    • The JSON script file is downloaded to your computer.
  2. Follow the steps from Create a script but, rather than entering the commands manually, click the Source tab in the script editor and click Upload Recorded Script.
  3. Select the JSON script file downloaded to your computer.
    • The script is uploaded to APM.
  4. Continue with the Selenium scripting workflow at Test the script.