Start audio recording (FR)
Perfecto Command
mobile:audio.recording:start
Purpose
Starts recording the audio output from the device and creates a WAV file. The file is saved in the media storage server. A URL to the file location is returned in the response to the command and, if supplied, in the Result variable supplied as a parameter.
To hear the audio when using Start Audio in the Perfecto Automation IDE, you need to use the Open Device command and the parameter "Audio Recording" should be set to TRUE.
Parameters
None
Return Value
URL of the audio file that will be created.
To download the audio file, copy-paste this URL from the single test report into a browser.
If you receive an error that the Perfecto security token is missing or required, use the cURL command shown in the following examples instead, including the following information:
-
The download URL copied from the single test report
-
The preferred output information, which can be a file name or a path and file name
Generic download example using cURL
curl -H "Perfecto-Authorization: <your-perfecto-security-token>" <your-download-URL> --output <destination-file-name-or-path-and-file-name>
Specific download example using cURL
curl -H "Perfecto-Authorization: <your-perfecto-security-token>" https://<your-cloud>.app.perfectomobile.com/download-12/report-video/<your-cloud>/52573639677766302b6b4566497a334b586c697353773d3d/30420abae1e7645c04a0f7767d4de096041e436584ae577087bce95fdfa592ad.wav\?fileName\=30420abae1e7645c04a0f7767d4de096041e436584ae577 --output ~/30420abae1e7645c04a0f7767d4de096041e436584ae577.wav
Exceptions
None
Request examples
Java sample
//declare the Map for script parameters
Map<String, Object> params = new HashMap<>();
String audUrl = (String) driver.executeScript("mobile:audio.recording:start", params);
JavaScript sample
var params = {};
String audUrl = browser.executeScript('mobile:audio.recording:start', params);
C# sample
//declare the Map for script parameters
Dictionary<String, Object> pars = new Dictionary<String, Object>();
String audUrl = (String) driver.ExecuteScript("mobile:audio.recording:start", pars);