WebRTC internals JSON dump from Selenium

24 views
Skip to first unread message

V. Mark Lehky

unread,
Nov 7, 2021, 5:23:31 AM11/7/21
to discuss-webrtc
I am trying to get the JSON trace of WebRTC internals from Selenium, in Java. I already read the guides here:
- https://testrtc.com/webrtc-internals-parameters/

My Selenium code to get the dump is just:

        Object stats = driver.executeAsyncScript( //
                        "var callback = arguments[arguments.size - 1];" + //
                        "var pc = new RTCPeerConnection();" + //
                        "pc.getStats().then(result => { callback(result); });");
        log.info(stats.toString());

The script always timeouts. Is it possible to get this to work?

I am doing this with Selenium 4, Chrome 95 (with matching chromedriver). Possibly useful is the JavaDocs for .executeAsyncScript().

TIA for any help.
Reply all
Reply to author
Forward
0 new messages