Support & information center

Jitsi Meet sample test script

Jitsi Meet is a very popular open source video conferencing engine.

If you are using it, then the script below is a great starting point.

Preparation

There is a “Jitsi example” script in any account created on testRTC. It is used as a sample and starting point for those who are evaluating our service.

The script itself creates a random room on meet.jit.si and then enters that room. If you use the service manually, it ends up looking something like this:

That blue “Join meeting” button? It usually doesn’t exist if you install and host your own Jitsi server “out of the box”. In such a case, make sure to comment out the following lines from the test script code shared at the end of this article:

.waitForElementVisible('.action-btn', 60 * sec) .pause(300) //wait for page render .click(".action-btn")
Code language: JavaScript (javascript)

Why comment them out? Because these wait for the “Join meeting” button to appear and then click it. If you don’t have that in your Jitsi service, then the test script will fail on it, waiting for a button that will never appear on screen.

Using the test script

In testRTC, create a new test script:

  1. Copy the code from the bottom of this article to your test script (or use the existing sample in your account)
  2. Decide the number of probes you want to use
    1. Concurrent probes will be good starting point
    2. Set the Session size to the number of concurrent probes for this sample
  3. Replace the Service URL of the script with the URL where your Jitsi Meet server is installed

Test execution

Run the script. It does everything for you.

If you want, you can join the same room from your browser once you see the URL in the progress messages of the test.

Test script code

/* This example shows how to automate Jitsi based scenarios in testRTC SCENARIO * Browser joins room URL * Browser runs for 2 minutes SCALING To scale the test, change the number of concurrent users and/or the number of users in the session (look at #session:2 in Run Options). THINGS TO PLAY WITH * Probe configurations (look after the script): - Location of probes - Media files to use - Network configuration and quality - Browser version * Number of concurrent users (in a paid account. Evals limited to 2 max) * Session size (Run Options; #session:2 value) * Join with your own browser to the URL of the test (try opening https://meet.jit.si/testRTC0 when the test is running) */ // Variables that we will use in this example var roomUrl = process.env.RTC_SERVICE_URL + "testRTC000" + process.env.RTC_SESSION_IDX; var sec = 1000; var agentType = Number(process.env.RTC_IN_SESSION_ID); var sessionJoinRate = 500; // We set a few expectations. If these don't happen, the test will fail // In Jitsi case, we want to make sure we have: // 1. At least 2 incoming A/V channels // 2. No more than 2 outgoing A/V chanels (2 due to Jitsi's P2P4121 mode) // 3. Media being sent and received client .rtcSetTestExpectation("audio.in >= 1") .rtcSetTestExpectation("audio.out >= 1") .rtcSetTestExpectation("video.in >= 1") .rtcSetTestExpectation("video.out >= 1") .rtcSetTestExpectation("audio.in.bitrate > 0") .rtcSetTestExpectation("audio.out.bitrate > 0") .rtcSetTestExpectation("video.in.bitrate > 0") .rtcSetTestExpectation("video.out.bitrate > 0"); // Join the room client .rtcInfo(roomUrl) .resizeWindow(1280, 720) .rtcProgress('open ' + roomUrl) .pause((sessionJoinRate * agentType) + 10) .url(roomUrl) .waitForElementVisible('.action-btn', 60 * sec) .pause(300) //wait for page render .click(".action-btn") // Now that the browser is connected and in the room, we wait .pause(60 * sec) .rtcScreenshot("in session") /* //Now Lets switch to a 3G network .rtcSetAdditionalInfo("Network degrades to Regular 3G mid call") .rtcEvent("Network 3G", "global") .rtcSetNetworkProfile("Regular 3G") .pause(30 * sec) .rtcScreenshot("3G")*/ .pause(30 * sec) .rtcProgress("Bye");
Code language: JavaScript (javascript)

Was this article helpful?

Related Articles