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

Method GetDomProperty

dotnet/src/webdriver/WebElement.cs:483–492  ·  view source on GitHub ↗

Gets the value of a JavaScript property of this element. The name of the JavaScript property to get the value of. The JavaScript property's current value. Returns a if the value is not set or the property does not exist. Thrown when the target element i

(string propertyName)

Source from the content-addressed store, hash-verified

481 /// value is not set or the property does not exist.</returns>
482 /// <exception cref="StaleElementReferenceException">Thrown when the target element is no longer valid in the document DOM.</exception>
483 public virtual string? GetDomProperty(string propertyName)
484 {
485 Dictionary<string, object> parameters = new Dictionary<string, object>();
486 parameters.Add("id", this.Id);
487 parameters.Add("name", propertyName);
488
489 Response commandResponse = this.Execute(DriverCommand.GetElementProperty, parameters);
490
491 return commandResponse.Value?.ToString();
492 }
493
494 /// <summary>
495 /// Gets the representation of an element's shadow root for accessing the shadow DOM of a web component.

Callers

nothing calls this directly

Calls 2

ExecuteMethod · 0.95
AddMethod · 0.45

Tested by

no test coverage detected