MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / GetScreenshot

Method GetScreenshot

dotnet/src/webdriver/WebDriver.cs:355–362  ·  view source on GitHub ↗

Gets a object representing the image of the page on the screen. A object containing the image.

()

Source from the content-addressed store, hash-verified

353 /// </summary>
354 /// <returns>A <see cref="Screenshot"/> object containing the image.</returns>
355 public Screenshot GetScreenshot()
356 {
357 Response screenshotResponse = this.Execute(DriverCommand.Screenshot, null);
358
359 screenshotResponse.EnsureValueIsNotNull();
360 string base64 = screenshotResponse.Value.ToString()!;
361 return new Screenshot(base64);
362 }
363
364 /// <summary>
365 /// Gets a <see cref="PrintDocument"/> object representing a PDF-formatted print representation of the page.

Calls 3

ExecuteMethod · 0.95
EnsureValueIsNotNullMethod · 0.80
ToStringMethod · 0.45