This document describes the scripting language interpreted by the TextScriptRunner: General Notes:
Verb | Args | Example | Description |
---|---|---|---|
Browse | URL | Browse http://TextScriptRunner.com | Open a web client connection to the specified URL and return the contents. The current page is set to the result of that connection |
Back | Back | Emulates clicking the 'Back' arrow/button on your Browser to return to the previous page | |
WaitForText | text | WaitForText "some bit of text" | Since a lot of JS/Ajax (e.g. click, select, etc) fires off an event and returns, this allows you to wait for some text to show up (that you expect) |
WaitForElement | ElementID or ElementName | WaitForElement verifyRegistration | Since a lot of JS/Ajax (e.g. click, select, etc) fires off an event and returns, this allows you to wait for an element to show up (that you expect) |
Refresh | Refresh | Emulates clicking the 'refresh'/button on your Browser to reload the current page | |
Set | FieldName Value | Set email joe@example.com | Set/Enter the Value into the field with name FieldName on the current page/form |
DeprecatedSelectRadioButton | FieldName Value | SelectRadioButton gender Male | Selects the option Value from the options for RadioButoon group with name FieldName on the current page/form DeprecatedUse Click instead |
Select | TypeName Value | Select Form Gender | Selects the TypeName (Window, Form) with name FieldName on the current page/form |
SubmitForm | FormName Value | SubmitForm Search | This is somewhat of a hack those those web developers who are too lazy to add a submit button to their form. It simulates the user hitting the enter button on a field in a form. |
Click | NameOrID | Click login | Simulates the user clicking on the element with name or ID NameOrID on the current page/form to cause an action |
Validate | FieldName ExpectedValue | Validate OrderID 63 | Compares the value of the field labeled FieldName on the current page/form to the ExpectedValue Note: the FieldName IS case-sensitive Note: for a CheckBox or a RadioButton, Validate the FieldName is True or False |
GetValue | FieldName | GetValue myCalc | Locates the field labeled with name MyCalc and returns the value. Note: FieldName is case-sensitive |
VerifyContains | Value | VerifyContains 'Common Problems:' | Verifies that the current form or page contains Value |
Include | FileName | Include UserLogin.txt | Executes the contents of Filename as if it were included at this point in the script. |
Fail | Verb Args | Fail ClickLink viewOrder?id=42 | Executes the specified Verb with Arguments as specified above, but expects the result to FAIL. This is used to test permission errors, invalid previous results/test cases, invalid selection options, out of range field entries, etc |
Delay | Amount (seconds) | Delay 5 | Delays the execution of the next step in the script by Amount seconds. |
Comment or # | CommentText | Comment Next step includes the login script | A no-op that allows you to put documentation/comments in the script |
SetOption | SettingName Value | SetOption DisplayLevel Verbose | Sets the option SettingName to Value Here are the current supported SettingNames:
|
GetOption | SettingName | Get DisplayLevel | Gets the value of the SettingName |
SetWebOption | SettingName Value | SetWebOption JavaScriptEnabled true | Sets the option SettingName to Value Here are the settings and current defaults:
|
GetWebOption | SettingName | GetWebOption JavaScriptEnabled | Gets the value of the web-related setting for option SettingName |
GetVariable | ${VariableName} | GetVariable ${BaseURL} | Gets the value of the variable named VariableName |
SetVariable | VariableName Value | SetVariable BaseURL http://textscriptrunner.com/ | Sets the variable VariableName to Value for later use |
Help | Help | Returns the contents of this page - more details to be added later for each command. | |
Connect | Connect jdbc:mysql://your_host:3306/your_database user42 password42 | Open a SQL client connection to the specified Database URL using the specified username and password. | |
Query | SQL | Query "select * from users" | Returns the result of executing the SQL against the currently connected data source |
Login | Connect textscriptrunner.com user42 password42 | Open connection to the specified IP or hostname using the specified username and password. | |
RunShellCommand | command | RunShellCommand "ls -l" | Returns the result of executing the command on the currently connect host |