Script Commands
Here you will find the list of all commands available for creating scripts.
-
Environment variables
When starting an agent, testRTC provides some environment parameters to the agent that can be used in the script. To access an environment parameter, please use the following expression: process.env.PARAMETE...
-
Common Nightwatch/Selenium commands
testRTC uses the popular Nightwatch/Selenium scripting language. Here are several common commands that you are bound to find useful with testRTC. For a complete reference of the Nightwatch API reference, please refer to http:...
-
Debug commands
testRTC gives you some useful debugging commands, making it easier to write test scripts and later on debug, analyze and troubleshoot both the script and your WebRTC application. These are listed here: rtcIn...
-
Assertion and expectation commands
testRTC offers specialized assertion and expectation commands that are meant to automatically determine the pass/failure status of a test run or a monitor run. These mechanisms are listed here. Expectations Expectations are s...
-
Synchronization commands
testRTC offers powerful synchronization capabilities. These can be used to synchronize across the probes that are running within a given test. These mechanisms work on the concept of key/value pairs. You can create a value and ...
-
Timer commands
testRTC offers timing mechanisms, enabling you to time certain activities within your web service. With these, you can set expectations based on timing, or collect timing related custom metrics. rtcStartTimer(...
-
Custom metrics commands
testRTC enables users to create custom metrics for test results. Since we can’t collect everything you have in mind, you can add your own metrics as custom ones. These will get collected, aggregated and report...
-
Including Assets in scripts
testRTC has the ability to store code assets and then use them inside your test scripts by a dedicated include command. This is useful when you are maintaining a large set of scripts, each offering different s...
-
rtcRequire()
Enables you to install and use npm packages as part of your test scripts. npm is a package manager for JavaScript that makes it easy to share and reuse code. With npm support in testRTC, you can now l...
-
rtcActivateWebhook()
Invoke a REST/HTTP API to an external system. This can be used to interact with other systems that are not accessible via browsers, such as a PSTN telephony infrastructure or an external Database. Arguments ...
-
rtcSetTestExpectation()
Indicate expected outcome for the specific probe execution. This is used to decide if a test has successfully passed or failed. The condition is evaluated at the end of the test, based on collected information ...
-
rtcSetEventsExpectation()
Indicate expected outcome for the specific probe execution between two application defined events. This is used to decide if a test has successfully passed or failed. This is a variation of .rtcSetTestExpecta...
-
rtcSetCustomExpectation()
Indicate the expected outcome for the specific probe execution. This is used to decide if a test has successfully passed or failed. Unlike .rtcSetTestExpectation() , this script command enables you to create your own calcula...
-
rtcSetCustomEventsExpectation()
Indicate the expected outcome for the specific probe execution. This is used to decide if a test has successfully passed or failed. Unlike .rtcSetTestExpectation() , this script command enables you to create your own calculation as an...
-
rtcSetNetworkProfile()
Change the network profile during a test run dynamically to simulate changing network conditions. Arguments Name Type Description profile name string The name of the network ...
-
rtcSetNetwork()
Change the network configuration during a test run dynamically to simulate changing network conditions. Also see rtcSetNetworkProfile(). Arguments Name Type Description profile JSON object A JSON object descri...
-
rtcEvent()
Add a vertical event line on graphs shown. rtcEvent() can be used to mark certain actions taken by the test script to find out how they affect the media trans...
-
rtcSetAdditionalInfo()
Add additional information to the test result. rtcSetAdditionalInfo() can be used to indicate certain aspects of a test that are important when trying to troubleshoot the results. This can work nicely in conjunction with mon...
-
rtcFail()
Instructs the probe to fail gracefully at the call of this command, providing a verbose fail reason. rtcFail() can be used to fail a running script at a given point in time and provide a textual explanation for the failu...
-
rtcFailAll()
Instructs the probe to fail gracefully and force failure on all other probes running the script, providing a verbose fail reason. This command will also cause all other probes to stop executing their script and fail (without ...
-
rtcWarning()
Instructs the probe to add a warning to the test result for this probe, providing a verbose warning message. rtcWarning() can be used to add a warning notice to the test result for the running probe. This can be useful i...
-
rtcIgnoreErrorContains()
Instructs the test run to ignore errors that contain certain text. rtcIgnoreErrorContains() enables you to force the test to succeed when certain types of failure messages are caught and you’d like to ignore ...
-
rtcCaptureCallData()
Instruct testRTC to collect webrtc-internals at that point in time. Instruct testRTC to collect webrtc-internals at that point in time. testRTC has two ways of collecting data: By “downloading” the webrtc-internals dump file at the end of a...
-
rtcCallWhenDone()
Instructs the probe to run a specific function when the test completes, either prematurely or properly. rtcCallWhenDone() can be used by applications to try to gracefully close a session or to collect...
-
rtcSetMetricFromThresholdTime()
Calculate the time it takes for a media related metric value to reach a certain threshold from an event and store that time in a custom metric. Arguments Name Type Description key string The name of the ...
-
rtcSetSessionValue()
testRTC allows you to share key/value pairs between the probes that are part of the same session. This script command together with .rtcWaitForSessionValue() can be used for such information sharing and for sy...
-
rtcWaitForSessionValue()
testRTC allows you to share key/value pairs between the probes that are part of the same session. This script command together with .rtcSetSessionValue() can be used for such information sharing and for synchronization across...
-
rtcSetTestValue()
testRTC allows you to share key/value pairs between the probes in the same test run. This script command together with .rtcWaitForTestValue() can be used for such information sharing and for synchronization across ...
-
rtcWaitForTestValue()
testRTC allows you to share key/value pairs between the probes that are part of the test run. This script command together with .rtcSetTestValue() can be used for such information sharing and for synchronization across probes. T...
-
rtcWaitForExternalValue()
This script command waits until the requested external value is received or a specified timeout is reached. If the external event is received, then the callback function provided shall be invoke...