Knowledge Base

  1. Home
  2. Knowledge Base
  3. Technical Support
  4. Script Commands
  5. 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:

rtcInfo()

Add a log message to the console log of the browser. These messages can later be seen in the browser log file that gets collected by testRTC.

When looking at the browser’s console log in testRTC, these log messages will appear in blue.

The rtcInfo() function returns a formatted string using the first argument as a printf-like format.

The first argument is a string that contains zero or more placeholders. Each placeholder is replaced with the converted value from its corresponding argument. Supported placeholders are:

  • %s – String
  • %d – Number (both integer and float)
  • %% – single percent sign (‘%’). This does not consume an argument

Arguments:

Name Type Description
format string printf-like format definition
list of arguments string/number list of arguments

Code example:

.rtcInfo("Info: %s (%d)", "Server is not responding", 500);

rtcProgress()

Using this command, it is possible to add a small status indication of the stage of the probe in the test. Upon test execution, when the probe reaches this command, the probe’s status string in the test execution dashboard will be updated to the string given in this command.

Arguments:

Name Type Description
status string New status to display

Code example:

 .rtcProgress("In a call")

rtcScreenshot()

It is possible to take screenshots of the tested browser during the test. In order to take a screenshot, call .rtcScreenshot() in the desired location in the test script.

In order to see the screenshots, click on the ‘Media’ tab in the probe results page:

Screenshots are stored as part of the test report and can be used for debugging, check video rendering and layouts, and post-mortem analysis.

The number of screenshots per probe is limited. If you need more then contact support.

Arguments:

Name Type Description
name string The name of the screenshot

Code example:

.rtcScreenshot("dialing");

 

Was this article helpful?

Related Articles

Leave a Reply 0 comments

Leave a Reply: