Class ShadowRoot
Provides a representation of an element's shadow root.
public class ShadowRoot : ISearchContext, IWrapsDriver
- Inheritance
-
ShadowRoot
- Implements
- Inherited Members
Constructors
ShadowRoot(WebDriver, string)
Initializes a new instance of the ShadowRoot class.
public ShadowRoot(WebDriver parentDriver, string id)
Parameters
parentDriverWebDriverThe WebDriver instance that is driving this shadow root.
idstringThe ID value provided to identify the shadow root.
Exceptions
- ArgumentNullException
If
parentDriveroridare null.
Fields
ShadowRootReferencePropertyName
The property name that represents an element shadow root in the wire protocol.
public const string ShadowRootReferencePropertyName = "shadow-6066-11e4-a52e-4f735466cecf"
Field Value
Properties
WrappedDriver
Gets the IWebDriver driving this shadow root.
public IWebDriver WrappedDriver { get; }
Property Value
Methods
FindElement(By)
Finds the first IWebElement using the given method.
public IWebElement FindElement(By by)
Parameters
byByThe locating mechanism to use.
Returns
- IWebElement
The first matching IWebElement on the current context.
Exceptions
- ArgumentNullException
If
byis null.- NoSuchElementException
If no element matches the criteria.
FindElements(By)
Finds all IWebElements within the current context using the given mechanism.
public ReadOnlyCollection<IWebElement> FindElements(By by)
Parameters
byByThe locating mechanism to use.
Returns
- ReadOnlyCollection<IWebElement>
A ReadOnlyCollection<T> of all WebElements matching the current criteria, or an empty list if nothing matches.
Exceptions
- ArgumentNullException
If
byis null.