Creating Robust Transaction Scripts

Suppose that you are just getting started with transaction tests. You’ve watched the tutorial video Getting Started with Transactions. You’ve used the ThousandEyes Recorder IDE to generate a simple test script, and now that transaction test is successfully running on the ThousandEyes platform. You’re done, right? Actually, not quite.

Developing good transaction scripts is an iterative process. Let’s say that you have successfully used the ThousandEyes Recorder IDE to create a basic working script. The next step is fine-tuning and adding some scripting elements to make the script more efficient and robust.

Initially, you test the scripts in the Recorder, and inspect them in a browser Developer Tools window. Script development can include adding interim debugging features into the script, and then removing them later after the script is working as intended. Next, test the script on the ThousandEyes platform in an actual transaction test to see if the test can run, and if the test is giving you the desired information.

There are several post-Recorder methods you might use in this iterative process ("post-Recorder” means picking up where the ThousandEyes Recorder leaves off):

  • Markers. Adding timing markers lets you capture load times for various page elements or operations. Putting these markers in the right places is important.

  • Waits. There may be times when you’ll need to add a delay, either during script development or after finalization.

  • Screenshots. You can add screenshots to your script for troubleshooting, or as part of the finished test.

  • Validation. Verify that an element is present by searching for a line of text such as “Account creation successful”.

  • Advanced scripting. Additional script optimization techniques include direct API calls and working with page elements.

To learn more about how to use these features, see Optimizing and Troubleshooting Transaction Scripts and Transaction Scripting Tips and Tricks for guidance and usage examples. You can also refer to the Transaction Scripting Reference and the ThousandEyes transaction scripting examples repository.

In order to get the maximum benefit during your script development process, it is strongly recommended that you familiarize yourself with basic web development tools when contacting support for assistance. Working with Web Development Tools includes some publicly available video tutorials on how to use the developer tools in your Chrome desktop browser to inspect page elements and test your script in a console. Executing Custom JavaScript Code provides background on how the ThousandEyes BrowserBot process works on cloud and enterprise agents to execute your transaction test scripts.

Last updated