Module: Appium::Core::Windows::Device

Extended by:
Forwardable
Defined in:
lib/appium_lib_core/windows/device.rb,
lib/appium_lib_core/windows/device/screen.rb

Defined Under Namespace

Modules: Screen

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(_mod) ⇒ Object



79
80
81
# File 'lib/appium_lib_core/windows/device.rb', line 79

def extended(_mod)
  Screen.add_methods
end

Instance Method Details

#start_recording_screen(remote_path: nil, user: nil, pass: nil, method: 'PUT', force_restart: nil, time_limit: nil, fps: nil, preset: nil, video_filter: nil, capture_clicks: nil, capture_cursor: nil, audio_input: nil) ⇒ String

Record the display in background while the automated test is running. This method requires FFMPEG (www.ffmpeg.org/download.html) to be installed and present in PATH. The resulting video uses H264 codec and is ready to be played by media players built-in into web browsers.

Examples:


@driver.start_recording_screen
@driver.start_recording_screen video_filter: 'scale=ifnot(gte(iw\,1024)\,iw\,1024):-2'
@driver.start_recording_screen capture_cursor: true, capture_clicks: true, time_limit: '260'

Parameters:

  • force_restart (Boolean) (defaults to: nil)

    Whether to stop existing recording process forcefully and start a new recording process.

  • time_limit (String) (defaults to: nil)

    Recording time. 600 seconds is by default.

  • fps (Number|String) (defaults to: nil)

    The count of frames per second in the resulting video. Increasing fps value also increases the size of the resulting video file and the CPU usage. Defaults to 15.

  • preset (String) (defaults to: nil)

    A preset is a collection of options that will provide a certain encoding speed to compression ratio. A slower preset will provide better compression (compression is quality per filesize). This means that, for example, if you target a certain file size or constant bit rate, you will achieve better quality with a slower preset. Read trac.ffmpeg.org/wiki/Encode/H.264 for more details. One of the supported encoding presets. Possible values are:

    - ultrafast
    - superfast
    - veryfast (default)
    - faster
    - fast
    - medium
    - slow
    - slower
    - veryslow
    
  • video_filter (String) (defaults to: nil)

    The video filter spec to apply for ffmpeg. See trac.ffmpeg.org/wiki/FilteringGuide for more details on the possible values. Example: Set it to scale=ifnot(gte(iw,1024),iw,1024):-2 in order to limit the video width to 1024px. The height will be adjusted automatically to match the actual screen aspect ratio.

  • capture_cursor (Bool) (defaults to: nil)

    Whether to capture the mouse cursor while recording the screen. Disabled by default.

  • capture_clicks (Bool) (defaults to: nil)

    Whether to capture the click gestures while recording the screen. Disabled by default.

  • audio_input (String) (defaults to: nil)

    If provided then the given audio input will be used to record the computer audio along with the desktop video. The list of available devices could be retrieved using ffmpeg -list_devices true -f dshow -i dummy command.

Returns:

  • (String)

    Base64 encoded content of the recorded media file

Since:

  • Appium 1.18.0



# File 'lib/appium_lib_core/windows/device.rb', line 25