Start Screen Recording

Starts recording a screen.

Command availability: IBM RPA SaaS and IBM RPA on premises

Description

Starts recording a screen according to the specifications of frames per second and the monitor from which recording takes place.

Script Syntax

IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.

startRecording [--folder(String)] --screen(Numeric) --fps(Numeric) [--grayscale(Boolean)] [--split(Boolean)] --maxduration(TimeSpan) [--idleframes(Boolean)]

Dependencies

  • You must use the Stop Screen Recording (stopRecording) command to stop the recordings.
  • On Microsoft® Windows Server 2012 R2 you must install Desktop Experience🡥.
  • On Microsoft® Windows Server 2016 and Windows Server 2019 you should use the recommended settings in Windows™ Media Player.
  • On Microsoft® Windows Server 2022, you must install a third-party media player.

Input parameter

The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.

Designer mode label Script mode name Required Accepted variable types Description
Folder folder Optional Text Full directory path where the command saves the recording.
Screen index screen Required Number Monitor used for screen recording.

If the access machine contains more than one configured monitor, this parameter allows specifying the monitor from which the command will record. For example, to specify the desired monitor, consider monitors A and B, where A refers to monitor 1 an B to 2.

✪ Tip: Monitor counting can be obtained using the Count Monitors (countScreens) command.
Frames per second fps Required Number Number of complete frames per second the comand records.
Gray Scale grayscale Optional Boolean When enabled, records the screen in grayscale only.
Split split Optional Boolean When enabled, splits the recording into multiple video files.
Max duration maxduration Only when Split parameter is enabled Time Span Maximum recording time of each video file.
Record idle frames idleframes Optional Boolean When enabled, if there is no action on the screen during recording, the command keeps all idle frames in the final video. Otherwise, the command will convert all idle frames to just one frame.

Example

The command starts recording on monitor "1" and opens the browser with the Start Browser (webStart) command. The Navigate (webNavigate) command navigates to the IBM website. At the end, the recording is terminated by the Stop Screen Recording (stopRecording) command.

// Sets a folder path to save the video.
defVar --name pathsVideosRecorded --type List --innertype String
defVar --name videoPath --type String
getSpecialFolder --folder "MyVideos" videoPath=value
// Starts recording the screen.
startRecording --folder "${videoPath}" --screen 1 --fps 60
   // Opens the browser.
   webStart --name browserChrome --type "Chrome"
   // Navigates to the IBM website.
   webNavigate --url "https://www.ibm.com"
   // Close Browser.
   webClose --name browserChrome
   // Ends the recording.
stopRecording pathsVideosRecorded=value
// Returns the file path with the recorded video.
logMessage --message "${pathsVideosRecorded}" --type "Info"

Limitations

The command depends on the operating system capability to render images to record the video. If a RDP session is not active on a VM, the operating system might not render images and the command will not be able to record videos.

Disconnecting from a VM by using IBM RPA Always On keeps the IBM RPA active on a Windows™ console session, but deactivate the RPD session.