getScreenshotImage: Get the Screenshot PNG image

Description Usage Arguments Value Examples

Description

get the fully loaded page screenshot in JPG format (PNG if in full resolution)

Usage

1
2
3
getScreenshotImage(server, testId, run = 1L, file = NULL,
  repeatView = FALSE, thumbnail = FALSE, fullResolution = FALSE,
  startRender = FALSE, documentComplete = FALSE, dryRun = FALSE, ...)

Arguments

server

A WebPagetest server

testId

test ID string

run

an integer. Which run number on a multiple runs test. Defaults to 1L.

file

Write the result returned to file. Defaults to NULL = don't write to file

repeatView

get the Repeat View (cached view) instead of default First View (primed cache). Defaults to FALSE

thumbnail

logical. Get the thumbnail of actual image. Defaults to FALSE

fullResolution

logical. get full resolution screenshot in PNG format if available. Defaults to FALSE.

startRender

logical. get the page screenshot at the Start Render point (i.e.: when something was first displayed on screen). Defaults to FALSE.

documentComplete

logical. get the page screenshot at the Document Complete point (i.e.: when window.onload was fired) Defaults to FALSE.

dryRun

If TRUE just return the RESTful API URL. Defaults to FALSE

...

Additonal function arguments

Value

If a file argument is given the JPG/PNG returned is written to file. Else a raster is returned via readJPEG|readPNG. If a file is not available when calling an argument (for example fullres, docComplete, ....) a HTTP 404 Not found error is returned.

Examples

1
2
3
4
5
6
7
## Not run: 
  WPT <- server()
  history <- getHistory(WPT, filter = "London")
  tID <- as.character(history[dim(history)[1], "Test ID"])
  screenshot <- getScreenshotImage(WPT, tID)

## End(Not run)

johndharrison/webpagetestr documentation built on May 19, 2019, 5:14 p.m.