1. Install Kantu Selenium IDE
  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. Copy the script to APM

Rather than manually entering all script commands, you can use a 3rd-party script recorder, such as Kantu for Chrome (Selenium IDE Lite), 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. 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. 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 (V2.3.0) to record your scripts. The steps are similar with other script recorders.

Install Kantu Selenium IDE

To install the Kantu Selenium IDE:

  1. Open the Chrome browser.
  2. Go to the Kantu Browser Automation page.
  3. Click Add to Chrome.
  4. Click Add extension.
    • The Kantu Selenium IDE 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 Kantu Browser Automation icon on the top right of the Chrome browser.
  4. Click + Macro.
    • A blank “Untitled” test case is created.
  5. Click Record to start recording.
  6. 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.
  7. Click Stop Record to stop recording.
  8. 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.

Copy the script to APM

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

To copy the script to APM:

  1. In Kantu, in the left panel, right-click the name of the script you recorded and select Export as HTML.
  2. Click the exported HTML file.
    • In your browser you will see a table with the commands on separate rows.
  3. Right-click the page and select View Page Source.
    • The HTML source appears.
  4. Copy all the HTML source on the page.
  5. Follow the steps from Create a script but, rather than entering the commands manually, click the Source tab in the Script section of the Edit Workflow page, remove any existing code, then paste the script.
    • The script is now loaded in APM.