You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A robust and versatile Selenium WebDriver extension library to simplify web element and browser interactions.
4
6
5
7
## OverviewOverview
@@ -8,34 +10,58 @@ This library consists of two primary sets of extension methods: WebElementExtens
8
10
## WebElementExtensions
9
11
This class offers a series of helper methods to easily traverse the DOM:
10
12
11
-
**GetParent:** Returns the parent of the current element.
13
+
**GetParent**
14
+
15
+
Returns the parent of the current element.
16
+
17
+
**GetNextSibling**
18
+
19
+
Returns the next sibling of the current element.
20
+
21
+
**GetPreviousSibling**
22
+
23
+
Returns the previous sibling of the current element.
24
+
25
+
**GetSiblingByIndex**
12
26
13
-
**GetNextSibling:**Returns the next sibling of the current element.
27
+
Returns a sibling of the current element at a specified index.
14
28
15
-
**GetPreviousSibling:** Returns the previous sibling of the current element.
29
+
**GetFirstChild**
16
30
17
-
**GetSiblingByIndex:**Returns a sibling of the current element at a specified index.
31
+
Returns the first child of the current element.
18
32
19
-
**GetFirstChild:** Returns the first child of the current element.
33
+
**GetLastChild**
20
34
21
-
**GetLastChild:**Returns the last child of the current element.
35
+
Returns the last child of the current element.
22
36
23
-
**GetChildByIndex:** Returns a child of the current element at a specified index.
37
+
**GetChildByIndex**
24
38
25
-
**GetChildByText:**Returns a child of the current element that matches a specified text.
39
+
Returns a child of the current element at a specified index.
26
40
27
-
**GetChildThatContainsText:** Returns a child of the current element that contains a specified text.
41
+
**GetChildByText**
28
42
29
-
**GetParent(int skip):** Returns the parent of the current element, skipping a specified number of levels.
43
+
Returns a child of the current element that matches a specified text.
44
+
45
+
**GetChildThatContainsText**
46
+
47
+
Returns a child of the current element that contains a specified text.
48
+
49
+
**GetParent(int skip)**
50
+
51
+
Returns the parent of the current element, skipping a specified number of levels.
30
52
31
53
*Please note that the GetParent(int skip) method throws an ArgumentException if the skip parameter is less than 0.*
32
54
33
55
## WebDriverExtensions
34
56
This class includes methods to execute JavaScript scripts directly in the browser:
35
57
36
-
**ExecuteJavaScript:** Executes a JavaScript script in the browser and returns the result casted to a specified type.
58
+
**ExecuteJavaScript:**
59
+
60
+
Executes a JavaScript script in the browser and returns the result casted to a specified type.
61
+
62
+
**ExecuteJavaScriptAndDeserialize:**
37
63
38
-
**ExecuteJavaScriptAndDeserialize:**Executes a JavaScript script in the browser, serializes the result into a JSON string, and then deserializes that string into an object of a specified type.
64
+
Executes a JavaScript script in the browser, serializes the result into a JSON string, and then deserializes that string into an object of a specified type.
39
65
40
66
## Getting Started
41
67
To use these extensions, first add a reference to this library in your project. Then, in your code, use the methods on instances of IWebElement and IWebDriver as required.
0 commit comments