Take a screenshot of the current session state, saving this image to a file.
Arguments
- file
The file path to save the screenshot to.
- view
Whether to open the interactively view the screenshot. If this is
TRUE
andfile
isNULL
, the screenshot will be deleted after viewing.- session
A
selenider_session
object. If not specified, the global session object (the result ofget_session()
) is used.
See also
Other global actions:
back()
,
current_url()
,
execute_js_fn()
,
get_page_source()
,
open_url()
,
reload()
Examples
session <- selenider_session()
open_url("https://www.google.com")
file_path <- withr::local_tempfile(fileext = ".png")
take_screenshot(file_path)