$.udb.benchmark.rec
This article is under construction.
$.udb.benchmark.rec
This object exposes the Web benchmark recorder engine API.
The $.udb.benchmark.playback function exposes the Web Benchmark playback engine.
breakpoints: {}
Description | Contains all breakpoints set in the Edit test actions and parameters dialog. The breakpoints are only listed in the context of the currently selected test. Each breakpoint is set as a key-value (test step : |
Example | A test with a breakpoint set at step five: breakpoints: |
createWaitFunctions: ƒ (entries)
Description | Constructs the wait conditions in the Extensions dialog as Javascript functions. The entries are fetched from indexeddb via the extensions table with type “wait”. The functions are stored in the |
devMessages: []
Description | When |
expandTest: ƒ ()
Description | Function used to display tests in edit tests dialog. |
exportAsFile: ƒ (file, obj, type, ext)
Description
Exports data to file. Can be in XML format, JSON, or PDF (under development). The $.udb.benchmark.events.export
event calls this function.
Options
file
: filenameobj
: the data to export (the XML is normally created by$.udb.benchmark.rec.makeXML()
#makexml )type
: the content-type, currently eitherapplication/xml
,application/json
, orapplication/pdf
ext
: the extension for the file, by default.xml
Example
Export a dummy file named “TestRun” with {}
as file content in JSON format with extension json.txt
:
$.udb.benchmark.rec.exportAsFile("TestRun", '{}' , "application/json", 'json.txt');
findAllRunsOfTest: ƒ (testName, options)
Description | executed in loop as soon as you open the Overview of test runs dialog , since it finds all runs for every existing test. |
findControl: ƒ (rec, $target)
Description | Attempts to find the control on the displayed page. Called whenever you press the “Locate control in displayed page” button when editing a test action. |
Options |
|
findFolder: ƒ (testId)
Description | Helper function , calls $.udb.benchmark.storageFolder.findObject |
findFolderByAlias: ƒ (alias)
Description | Helper function , calls $.udb.benchmark.storageFolder.findObject |
findFolderId: ƒ (testId)
Description | Helper function , calls $.udb.benchmark.storageFolder.findObject |
findTest: ƒ (id, folder)
Description | Helper function , calls $.udb.benchmark.storageFolder.mapArray |
finishEvent: ƒ ()
Description | Called when a single action has finished recording. Preceeded by |
formatScriptResult: ƒ (scriptResult)
Description | Called whenever scripts are executed to apply formatting on the script result. |
formatValues: ƒ (scriptResult, formatCols, nesting)
Description | Called by formatScriptResult. |
getAction: ƒ (id, ref)
Description | Retrieves the action of a test, either matches the id or does a search based on the input Returns an object containing the action. |
Options |
Use Use
|
Example | Get the first action of the test:
Returns:
|
getActionControlProperties: ƒ (action, options)
Description | - |
getAllResultsOfRun: ƒ (runId)
Description | Fetches all test run results. OBSOLETE |
getContext: ƒ (options)
Description | Used to retrieve the context of a control that is selected while recording. Returns an array of DOM elements. |
getControlValue: ƒ (vt, $el)
Description | A helper function that retrieves values of the selected HTML control. Used during recording. |
Options |
|
Example | Fetches the
|
getCurrentAction: ƒ ()
Description | Retrieves the current recorded action. Returns -1 if there is none. |
getCustomValueType: ƒ ($el)
Description | Retrieves the Web benchmark control its “Value type” property. More about the Value type property is found here. |
getInvokes: ƒ (test, depth)
Description | Fetches all invokes that belong to the currently selected test, including nested invokes. Returns a |
Example | This example retrieves all invokes.
This example displays an array of multiple objects.
|
getOccurrence: ƒ ($elem, context)
Description | Retrieves the Occurence rank of a control. More about the Occurence Rank property is found here. |
getPropertiesForElement: ƒ ($e, event)
Description | Retrieves all Web Benchmark properties of an element. Called when e.g. replacing a control. |
Options | $e : |
Example | This example retrieves all properties of some tab named Documents on a click event:
|
getScriptResult: ƒ (script, frame, waitPromise)
Description | Retrieves the result of a script action. Called when recording a script action. More about recording scripts can be found here. |
getUniqueID: ƒ (name)
Description | Helper function for finding test control ID’s. Called by |
getVariableValue: ƒ (origValue, requestedType)
Description | Parses and retrieves variables that are used in test actions. Used when you record a variable using
Also called during test playback. |
invoke: false
Description | Internal flag used to skip notifications on invoked tests. |
Description | Checks whether the action its control properties fetched via the last recorded change action fetched via
The check is done in order to check if the same control was recorded.
|
makeXML: ƒ (options)
Description | Generates the XML content when exporting to file. Returns a |
Options | The options are the same as $.udb.benchmark.events.export |
Example | Generate XML for test named “test 1”:
The example uses await to get the value fullfilled by the |
messageFilter: []
Description | Retrieves the list of messageFilters of extensions. For more details on message filters, please visit the following article. [Deprecated.] |
Example | This example display the “Developer info” dialog in a web UI:
|
messages: []
Description | Array appended with recorded messages when triggering |
mode: null
Description | Initialization flag used to test the mode of Web benchmark. |
newTest: false
Description | Flag to check if the recorded test is a new test. Set as soon as the recording has stopped. |
origSettings:
Description | Internally used object, the same object as |
parameters: []
Description | Contains invocation parameters of the selected test. |
parseTestFromXML: ƒ ($test, version)
Description | Called by |
propsList:
Description | Static object containing default properties that are used by the recorder engine for referencing purposes. |
purgeRunsOfTest: ƒ (suiteName, testName, runList)
Description | Performs a delete of test runs. Called as soon as you trigger |
readXML: ƒ (xml, struc)
Description | Reads the content of an XML file. Called as soon as you Import from file when you trigger |
recordComment: ƒ (comment)
Description | Record a comment as test action. Called automatically when you resume a paused recording where it adds a comment to your test. |
Example | This example shows a call that automatically adds comment when resuming a recording.
|
recordVariable: ƒ ()
Description | Opens up the Record variable dialog allowing you to define variables. This function is called when you press the Variables button and then “Define variables”. |
recordedActions: []
Description | Contains all actions belonging to the selected test. |
replaceAllVariableValues: ƒ (value)
Description | Used during playback in order to do variable replacement |
requestInvocationParams: ƒ (testObj, callback, current)
Description | Used at the moment a test is played in order to retrieve all invocation parameters |
selectedRecId:
Description | The selected test, its test ID number. |
setValueFromVariable: ƒ (rec, show)
Description | Sets the HTML control its value. |
setVariableActionsOfInvoke: ƒ (rec, defParams)
Description | Sets the invocation parameters on an invoke test action during playback based on the parameter type, which is either to set new values, inherit or to use the invocation parameter defaults. |
startEvent: ƒ ()
Description | Called when recording of a single action has started. succeeded by |
started: false
Description | Flag that sets to true the moment you press the record button. Only sets to false when the stop event is fired (the stop or pause button is pressed). |
storeTestRun: ƒ (run, testObj, suite)
Description | Stores the test run into either indexeddb or browser storage depending on |
storeValueInVariable: ƒ (rec, show)
Description | Called whenever you press the “Store Value or property in Variable” button to store values into variables. |
storedMessages: []
Description | Temporary array containing messages belonging to a testrun. |
validateControl: ƒ (rec, props)
Description | When using a replace control ,this function checks whether the newly set control is compatible with the action being edited. Reason can be that buttons do not support setValue, test can only be done on static (div) structures, asserts require input controls, etc. If the control is invalid, it will display a message. |
variables:
Description | Temporarily filled with the variables used in a selected testrun. Cleared as soon as playback is finished. |
Example | This example displays the “Developer info” dialog in GUI:
|
waits: []
Description | Contains all wait condition functions that are defined in the Manage Extensions window. |