CrossBrowserTesting gives you the ability to record network traffic from our Windows, OSX, and physical mobile devices. You can start a recording one of three ways, depending on the type of test you’re running.
If you’re running a live test and would like to capture a network recording, simply click the “globe” icon from within our live-test toolbar:
Then click the same icon to stop your recording and collect your results. Our HAR’s capture all request/response header content as well as time and duration of the events.
If you’re running an automated test via Selenium, you can do the same thing via our API or a by setting a capability in your test. If you’d like to use the capability method, it’s as easy as sending “recordNetwork” with a value of “true” when requesting your session. This will capture network traffic for the duration of your session. While easy to use, this might not provide the best results as the HAR capture can become quite large, and it can be more difficult to parse out the results you really need.
A more suitable option is to start your capture via our API. You can do this by sending a POST request to our /networks endpoint, as documented in our API reference. The response should contain a “hash” value which can be used as an ID to stop the recording when you’re done. Stopping the capture is also shown in our API reference. This allows you to start the capture, perform any navigation or interaction you’d like via Selenium, then stop the capture and grab the results you want – all automated.
It is important to note that, in the situation where a network recording is on, we are actively resigning your network traffic using our own internal certificate for one hop before the traffic goes out to either the open internet or your local connection. This is how we can successfully capture SSL traffic even though it is encrypted. We try to deliver the results to you as fast as we can, however this resigning process takes additional time and can result in longer test times due to the additional overhead. This is why we recommend turning the network recording on and off via our the API for shorter periods of time. You can always start multiple network recordings in the case you need to capture more results, and there is no limitation to the number of recordings you can capture in one session. This way, you can capture the network events you’d like to see while keeping the rest of your test as fast as possible. Let us know if you have any questions!