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 associate it with a searchable key. By looking up the key (and waiting for it), you can retrieve the value or just block until the key is created.
You can synchronize probes in a session. This is the most common approach since it gives you the flexibility of having separate synchronization mechanisms across the sessions in a test.
- .rtcSetSessionValue() – create a key/value pair shared by the session probes
- .rtcWaitForSessionValue() – wait for a key/value pair that is created in the session
You can synchronize probes in a test. This method is suggested when you have multiple sessions in your test script, but still want to synchronize across all probes and not only in a specific session.
- .rtcSetTestValue() – create a key/value pair shared by all probes in the test run
- .rtcWaitForTestValue() – wait for a key/value pair that is created globally in the test run
You can synchronize and retrieve values in the test from external sources. This method is useful if you need to parse emails or SMS messages that has 2FA (two factor authentication) or joining URL/password information in them.