Har Recording
Description
Start and stop capturing of HAR data during specific transactions for a cloud device. The capture starts when startHarRecording
is executed. The capture stops when stopHarRecording
is executed or the device is released.
info
Har recording cannot work in parallel with tunneling.
Parameters
Name | Value | Description |
---|---|---|
har file | String | The full path of the requested file download destination. In Appium Server (Appium Open Source) file unique name can be provided in the following format: cloud:file_unique_name For more information see Using the File Repository |
filter | String | Optional parameter. Filter for the content type. If the filter is not given, the value will be according to cloud server configuration. (See configuration for Cloud Admins on PCAP and HAR Support ) You can learn more about the filter here and here. |
Usage
info
Replace <server> with the appropriate URL.
- Public Continuous Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Continuous Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Continuous Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
Example
Har file recording - using file repository
// File with unique name my_har_file must NOT exist in file repository
driver.executeScript("seetest:client.startHarRecording", "cloud:my_har_recording");
// Commands that perform web requests on device
driver.executeScript("seetest:client.stopHarRecording");
// Download file with unique name my_har_recording from file repository using Rest API
CaptureNetworkDump
DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
dc.setCapability(MobileCapabilityType.UDID, "deviceid");
...
...
seetest.startHarRecording("C:\\tmp\\device.zip", "~t text/html");
seetest.stopHarRecording();