> For the complete documentation index, see [llms.txt](https://docs.thousandeyes.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thousandeyes.com/product-documentation/browser-synthetics/transaction-tests/development-guide/robust-transaction-scripts.md).

# Creating Robust Transaction Scripts

Suppose that you are just getting started with transaction tests. You used the [Google Chrome Recorder](https://developer.chrome.com/docs/devtools/recorder/) to collect the click path and selectors for a simple user journey, imported the JSON output into ThousandEyes, and ran an actual transaction instant test on the target agents for the scheduled test. You’re done, right? Actually, not quite.

Developing good transaction scripts is an iterative process. The next step is fine-tuning and adding some scripting elements to make the script more efficient and robust.

Script development can include adding interim debugging features into the script, and then removing them later after the script works as intended. Use Google Chrome Recorder to capture the basic flow; do not over-optimize the recording itself. Iterate on the imported script in ThousandEyes by running actual transaction instant tests against the Cloud or Enterprise Agents that will run the scheduled test.

There are several methods you might use in this iterative process:

* **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 might 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](https://docs.thousandeyes.com/product-documentation/browser-synthetics/transaction-tests/development-guide/robust-transaction-scripts/optimizing-transaction-scripts) and [Transaction Scripting Tips and Tricks](https://docs.thousandeyes.com/product-documentation/browser-synthetics/transaction-tests/development-guide/robust-transaction-scripts/transaction-scripting-tips) for guidance and usage examples. You can also see the [Transaction Scripting Reference](https://docs.thousandeyes.com/product-documentation/browser-synthetics/transaction-tests/transaction-scripting-reference) and the ThousandEyes [transaction scripting examples repository](https://github.com/thousandeyes/transaction-scripting-examples).

{% hint style="info" %}
To get the maximum benefit during your script development process, familiarize yourself with basic web development tools when contacting support for assistance. [Working with Web Development Tools](https://docs.thousandeyes.com/product-documentation/browser-synthetics/transaction-tests/getting-started/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](https://docs.thousandeyes.com/product-documentation/browser-synthetics/transaction-tests/development-guide/transactions-executing-custom-javascript-code) provides background on how the ThousandEyes BrowserBot process works on cloud and enterprise agents to execute your transaction test scripts.
{% endhint %}
