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

Method GetScreenshot

dotnet/src/webdriver/WebElement.cs:546–559  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

544 /// </summary>
545 /// <returns>A <see cref="Screenshot"/> object containing the image.</returns>
546 public virtual Screenshot GetScreenshot()
547 {
548 Dictionary<string, object> parameters = new Dictionary<string, object>();
549 parameters.Add("id", this.Id);
550
551 // Get the screenshot as base64.
552 Response screenshotResponse = this.Execute(DriverCommand.ElementScreenshot, parameters);
553
554 screenshotResponse.EnsureValueIsNotNull();
555 string base64 = screenshotResponse.Value.ToString()!;
556
557 // ... and convert it.
558 return new Screenshot(base64);
559 }
560
561 /// <summary>
562 /// Simulates typing text into the element.

Callers

nothing calls this directly

Calls 4

ExecuteMethod · 0.95
EnsureValueIsNotNullMethod · 0.80
AddMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected