Recording New Transaction Script (Scenario)

 Open the Transaction Recorder using the icon from the task bar.

open transaction recorder

Login with your Monitis credentials.

transaction recorder login page

The Transaction Recorder will open listing your existing transaction tests.

transaction scripts list

If you have no transaction test uploaded to Monitis, this list will be empty. Click Add New Script to start recording and adding your scripts.

add new script

  • To upload the script to Monitis Cloud click Save As on Cloud. You can also do that from the File menu. Note that an asterisk ‘*’ next to the script’s name means that you have unsaved changes in that script.
  • To edit a test previously uploaded to Cloud, go to the Scripts tab, choose a test from the list on the left pane of the TR window and click on it.
  • To save the script locally, click on the Download on Local Disk button. You can also do that from the File menu.

To open a test saved locally, go to the File menu and click Open.

open new script in transaction recorder

To record a new transaction test click on the “+” button. A new untitled script will be added to the list.

record new transaction script

Notice that recording mode is initially disabled for the new script. Enter the URL of the site you want to monitor into the Base URL field (e.g. example.com) and click the Start Recording button to start recording the script.

If you leave the Base URL field empty, and then press the Start Recording button and open the website that you want to record a test on, the base URL will be filled in automatically with the website’s address following the Open command added by the recorder in your script.

Open in Firefox the site that you want to monitor and start navigating through and interacting with it.

Notice that the Transaction Recorder records all your steps. During the recording phase you can edit any recorded command by selecting it and editing the Command box value. You can also insert/delete commands (use the appropriate option after right clicking on a step).

add remove steps in transaction script

You can also add commands manually from the drop down list.

manually add steps in transaction script

The description of the selected command is displayed in the Reference tab at the bottom of the Transaction Recorder window.

There are three fields that store essential information about each step in the script – CommandTarget and Value. For any element present on the web page, the Transaction Recorder maps its action with three values: command, target, and value.
For example, when typing a username in the User Name text box, the Transaction Recorder translates it as COMMAND=TYPE , TARGET=USERNAME_TEXT_BOX and VALUE=YOUR_USERNAME. For commands related to asserts, a certain value can be specified to compare to another value. For example: COMMAND=ASSERTTEXT ,TARGET=LABEL and VALUE=SOMETHINGTOCOMPARE.

The Transaction Recorder provides enough functionality in terms of identifying the target. For instance, the client can locate or identify the target using DOM, ID, Name, XPath etc. You also may find it useful to try Firefox extensions like DOM Inspector or XPath Viewer to get information about the XPath or DOM information of the GUI element under test.

use xpath in transaction recorder

Use the Target Selector button to select the target on web page. Click the button, and then click an element on the web page to select it. To change the selection, click some other element. To cancel the selection, click the button again.

After you have selected the element, you can choose between ID, Name, or XPath to be the element target as needed, by selecting the value from the Target combo box.

target selector in transaction recorder

You can also use the Find button to find the element that you have specified under Target.

There are also custom developed commands: if, else and for.

If there is a need to change the flow of a transaction script by including some condition, then you can use the “if/else” statement. Condition of the “if”, “else” and “for” clauses is displayed in the Target column. When the “else” clause is not needed you should close the “if” clause using the “endif” command.
If you’re using the “else” command then you should close it with the “endElse” command.

use if command in transaction script
Use the “for” statement to repeat the same commands multiple times.

Note: You can find the most commonly used commands with their descriptions here:

To view the recorded flow click the Run Script button.

You can also test your script by running it from one of the Monitis global locations. Click on the Test from Global Location button, and then select location from the drop-down box.

image12.png

Click Start test. A pop-up will appear showing the test progress.

Please wait until it shows you the test result. If the test is successful, you will see a success message in the pop-up.

test success

If the test fails, you will see a failure message specifying the problem.

test failed

You can also click the Web page capture on test failure link to view the web page capture of the failed step.

If the test takes too long to complete, it will be aborted and you will see a respective message. Click Try Again to run the test again.

test aborted

Click Close to close the pop-up.

Click Save As to upload the script to Monitis cloud. Note that the test name should be unique within the account’s list of existing Transaction Monitors.

To ensure that the new recording has been successfully added look it up in the list of scripts there in the Transaction Recorder.

 

Running the Script in Transaction Monitor

In your Monitis dashboard go to Monitors -> End User Monitors -> Synthetic Transaction.

In the Add Transaction Monitor wizard select the script you want to run on this monitor and click Next.

running the script in transaction monitor

 

On the next screen select the locations to run the script from as well as running frequency.

add transaction monitor

Click Add when done to add the monitor.