Scripting Tips for testingRTC

We've put together a list of scripting tips for common issues that our customers deal with and for various other scenarios that you may need to deal with.

  • Working with elements in frames

    You can indicate the frame by the frame name of frame ID. // Access second frame (frame ID 1) in the page client.execute('document.getElementsByTagName("iframe")[1].contentWindow.document.getE...

  • Switching windows and tabs

    Switch to another window The following sample code performs the following flow: Switch to another window Enter user’s credentials Return to the original window Window ID Please note that in all tests, window 0 is sometimes used for the ...

  • Verify page content

    Verify text client.getText('#element', function(result) { // Remove whitespaces - recommended, as many times the text in the // web page includes whitespaces before and after the text var subResult...

  • Understand the test result’s ‘call setup time’ value

    The call setup time is one of the test report quality measurements designed to show the time it took to connect the sessions. Depending on what service you are running in testRTC, you will see the call setup time information ...

  • Debug my script

    The following working methodologies can be used in order to debug a test: VNC – you can open a VNC connection to the tested instance and track the test’s progress. For further information about ho...

  • Our OpenAPI documentation for continuous integration

    testRTC exposes an API for WebRTC service monitoring and testing automation in order to enable programmatic access for developers to our service. View API Documentation Please perform the following steps in order to view our API docu...

  • Specify Chrome command line switches in testRTC

    You can direct testRTC to execute its Chrome browsers with specific command line switches. This is done via the run options of the test script. The full list of command line switches is available online. A few notable swi...

  • How to use external parameters in the test script

    From time to time we see a need to use parameters that should be received from an external source and/or to be shared with other systems. The following code sample demonstrates how we read a URL from external DB and use it in...

  • Configure Monitor Frequency with Cron

    When scheduling a monitor, besides picking one of the simple alternatives testRTC offers “out of the box”, you can express your own monitor’s frequency by using a cron expression. A cron expression is a string consisting of s...

  • Using VNC

    VNC can be used as an additional debugging tool that testRTC offers. It enables you to view how the browsers in a running test behave and to fix the test script accordingly. What is VNC? VNC stands for Virtual Network Computing. It i...

  • Wait for an agent to register

    Sometimes, you want the agents in your test case to log in to the system and register before other agents try and call them or interact with them. To that end, you can use .rtcSetSessionValue() and .rtcWaitForSessionValue...

  • How to bypass password protected web site

    This article assumes you know the username and password, and what you’d like to do is to use the testRTC service to automate the access to that page for your WebRTC testing. So...

  • Using an external Database Firebase

    There are cases where there is a need to store and retrieve information from an external database. For example: Use an external configuration – an external system will configure one or more parameters stored in a DB ...

  • How to check the public IP address of testRTC probes?

    There are times where you may want to know the public IP address of a testRTC probe. This may be needed when you are using some geolocation capabilities or when you limit the service to certain IP addresses. One of the simple...

  • How to wait and click on elements

    When writing your test scripts, you may find yourself needing to click a button. In many cases, this is how the call will look like: client .click(“#callButton”) .pause(50000); What we want to do here is show a slig...

  • Integrating testing and monitoring results with Slack

    You can send testRTC run results with a Slack channel. To that end you will be using the webhook entry field of your test script: How to Create a Slack Webhook: Optional | Create a Slack app: You can skip this and use an existing ...

  • How to use XPath notation with testRTC scripts?

    By default, testRTC enables using CSS notation when you want to refer to different DOM elements on your web application. This applies to script commands such as .setValue(), .click() and .waitForElementVisible(). If you want to us...

  • Using local storage

    At times you may need to be able to put objects in the browser’s local storage. This is especially true if you are trying to login using pre-authenticated tokens and not by using username+password. Here’s how ...

  • Using event-based test expectations

    testRTC enables you to set expectations to check certain metrics throughout the test. These are a kind of assertions that are calculated on the probe level at the end of a test run. To do that, you can use our .rtcSetTestExpe...

  • How to use CSS notation with testRTC scripts?

    By default, testRTC enables using CSS notation when you want to refer to different DOM elements on your web application. This applies to script commands such as .setValue(), .click() and .waitForElementVisible(). This means that w...

  • How to login multiple test user accounts for large stress tests?

    When running a large stress test you need a lot of machines and mock-users. In many cases, you can’t have guest access and need the users to be able to login and identify themselves in your service. Here are two simple ways (...

  • How to test screen sharing using testRTC

    Like everything else you can do with WebRTC, screen sharing is natively supported by testRTC. There are though a few things you should be aware of and prepare in advance with if you want to test and validate your screen shari...

  • Local Storage access for testRTC scripting

    Local storage is a feature provided by web browsers to allow websites and web applications to store data locally on a user’s device. It’s a form of client-side storage, which means the data is stored on the user’s computer ra...