|ReadyAPI uses a number of third-party libraries. It is quite possible that we will update some of these libraries or even remove them from ReadyAPI. If you use classes from these libraries, you will have to update your scripts. See a list of third-party libraries updated in ReadyAPI 2.7.0.|
You can improve and customize your load test execution to the specific needs of your environment by using custom scripts on the Scripts page. LoadUI runs the Setup script before the test starts, and the Teardown script after it ends.
For example, LoadUI scripts can remove log files after the test run is finished, or prepare the database before it starts. Another possible way of usage is creating an email with data about a test run in case it fails.
LoadUI supports the following scripting languages:
By default, your projects work with Groovy, but you can change the scripting language in the Project Properties panel:
|You must restart ReadyAPI for the change to take effect.|
Your LoadUI scripts have access to the following objects and their children:
A logger object which writes data to the script log.
|loadTestRunner||An object giving access to context properties and related methods of ReadyAPI tests.|
|context||An object proving methods of controlling the execution of the LoadTest. Using it, you can access the underlying LoadTest model.|
|virtRunner||An object proving methods of controlling virtual services from the LoadUI tests. It allows you to run and stop virtual services specified in ServiceV or deployed at VirtServer.|
For more information about using ReadyAPI objects in your scripts, see the Scripting Overview.
If you have a large script, it may not fit into the script editor. In this case, click to open a panorama view of the editor. In this view, you can quickly hover over the needed part of the code to move to it.
You can edit your script with the Edit button. It has the context menu with the following items:
|Undo||Undoes the previous action.|
|Redo||Redoes the action you undid.|
|Cut||Cuts the selection.|
|Copy||Copies the selection.|
|Paste||Pastes clipboard contents to the caret position.|
|Delete||Deletes the selection.|
|Select All||Selects all text in the editor.|
|Folding||Opens or closes folds in the editor.|
|Find / Replace||Opens the Find/Replace dialog.|
|Code Completion||Opens the Code Completion prompt.|
|Go to Line||Moves the caret to the specified line.|
|Show Line Numbers||Toggles whether line numbers are shown or not.|