| API | _random(limit) |
| Notes | Returns a random number between 0 and limit. Details |
| API | _scriptName() |
| Notes | Returns the name of the current script |
| API | _scriptPath() |
| Notes | Returns the path of the current script |
| API | _popup(identifier) |
| Identifier | windowName, windowTitle |
| Notes | Returns a handle to the window. The identifier can be a regular expression. _popup() is used as a prefix to statements which need to be executed on another window. Eg.
_popup("popWin")._click(_link("Click me"));
_popup(/popWin.*/)._click(_link("Click me"));
_popup("Window Title")._click(_link("Click me"));
|
| API | _savedRandom(key) |
| Notes | Deprecated Returns a previously saved random number agains that key. Details |
| Related | _resetSavedRandom |
| API | _getGlobal(key) |
| Notes | Returns value stored against key. Details |
| Related | _setGlobal |
| API | _logException(exception) |
| Notes | Logs an exception. Used in catch block of try-catch. Details |
| API | _logExceptionAsFailure(exception) |
| Notes | Logs an exception and stops execution. Used in catch block of try-catch. Details |
| API | _stopOnError() |
| Notes | Makes the script stop if an error occurs. This is the default behavior. |
| API | _continueOnError() |
| Notes | Makes script continue inspite of errors. Can be turned off with _stopOnError() |
| API | _setRecovery(fn) |
| Notes | Sets fn as recovery function. The function will be called before the script exists, if and only if there is a failure in the script. It can be turned off with _removeRecovery(). Details |
| API | _removeRecovery(fn) |
| Notes | Removes any recovery function which was set via _setRecovery. Details |
| API | _sessionInfo() |
| Notes | Returns information of the current session. The object has attribures: isRecording isPlaying isPaused sessionId |
| API | _suiteInfo() |
| Notes | Returns information of the current session. The object has attribures: suitePath: Path of suite base: Base url for suite browser: Browser executable path sessionId: SessionId of suite browserOption: browserOption passed to Suite browserProcessName: browserProcessName passed to Suite suiteName: name of suite |
| API | _userDataDir() |
| Notes | Returns the path to userdata. |
| API | _getDB(driver, jdbcurl, username, password) |
| Notes | Returns a DB object which can be used to query the database. Details |
| API | _readFile(filePath) |
| Notes | Reads a file at filePath and returns its contents as a string. Details |
| API | _writeFile(text, filePath[, overwrite]) |
| Notes | Writes the text into file at filePath. if overwrite is true, the file contents are overwritten. Default is false which will append text at the end. Details |
| API | _writeToFile(text, filePath[, overwrite]) |
| Notes | Same as _writeFile |
| API | _readCSVFile(filePath) |
| Notes | Reads a csv file and returns a 2 dimensional array of the contents. Details |
| API | _writeCSVFile(filePath) |
| Notes | Writes a 2 dimensional array into a file in CSV format. |
| API | _deleteFile(filePath) |
| Notes | Deletes the file at filePath. |
| API | _renameFile(oldFilePath, newFilePath) |
| Notes | Renames (or moves) a given file from oldFilePath to newFilePath. If newFilePath already exists, it will be overwritten |
| API | _dataDrive(fn, data2DArray) |
| Notes | Loops over data2DArray, and invokes function fn with each row of data. The invocation is within a try catch block with exception logging. More on data driven testing |
| API | _runUnitTests() |
| Notes | _runUnitTests() executes all functions whose name starts with “test”. If functions setUp() and tearDown() are defined, they are executed before and after each test, irrespective of errors in the test functions. |