@@ -30,13 +30,15 @@ nature and relationship in the tree to return a value.
30
30
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L20-L25" >}}
31
31
{{< /tab >}}
32
32
{{< tab header="Python" >}}
33
+
33
34
# Navigate to the url
34
35
driver.get("https://www.selenium.dev/selenium/web/inputs.html ")
35
36
36
37
# Get boolean value for is element display
37
38
is_email_visible = driver.find_element(By.NAME, "email_input").is_displayed()
39
+
38
40
{{< /tab >}}
39
- {{< tab header="CSharp" >}}
41
+ {{< tab header="CSharp" text=true >}}
40
42
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L18-L23" >}}
41
43
{{< /tab >}}
42
44
{{< tab header="Ruby" text=true >}}
@@ -46,11 +48,13 @@ is_email_visible = driver.find_element(By.NAME, "email_input").is_displayed()
46
48
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L16-L17">}}
47
49
{{< /tab >}}
48
50
{{< tab header="Kotlin" >}}
51
+
49
52
//navigates to url
50
53
driver.get("https://www.selenium.dev/selenium/web/inputs.html ")
51
54
52
- //returns true if element is displayed else returns false
55
+ //returns true if element is displayed else returns false
53
56
val flag = driver.findElement(By.name("email_input")).isDisplayed()
57
+
54
58
{{< /tab >}}
55
59
{{< /tabpane >}}
56
60
@@ -65,29 +69,29 @@ is_email_visible = driver.find_element(By.NAME, "email_input").is_displayed()
65
69
{{< tab header="Java" text=true >}}
66
70
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L27-L30" >}}
67
71
{{< /tab >}}
68
- {{< tab header="Python" >}}
69
- # Navigate to url
72
+ {{< tab header="Python" >}}
73
+ # Navigate to url
70
74
driver.get("https://www.selenium.dev/selenium/web/inputs.html ")
71
75
72
- # Returns true if element is enabled else returns false
76
+ # Returns true if element is enabled else returns false
73
77
value = driver.find_element(By.NAME, 'button_input').is_enabled()
74
- {{< /tab >}}
75
- {{< tab header="CSharp" >}}
78
+ {{< /tab >}}
79
+ {{< tab header="CSharp" text=true >}}
76
80
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L25-L28" >}}
77
81
{{< /tab >}}
78
82
{{< tab header="Ruby" text=true >}}
79
83
{{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L17">}}
80
84
{{< /tab >}}
81
85
{{< tab header="JavaScript" text=true >}}
82
86
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L23-L24">}}
83
- {{< /tab >}}
84
- {{< tab header="Kotlin" >}}
87
+ {{< /tab >}}
88
+ {{< tab header="Kotlin" >}}
85
89
//navigates to url
86
90
driver.get("https://www.selenium.dev/selenium/web/inputs.html ")
87
91
88
- //returns true if element is enabled else returns false
92
+ //returns true if element is enabled else returns false
89
93
val attr = driver.findElement(By.name("button_input")).isEnabled()
90
- {{< /tab >}}
94
+ {{< /tab >}}
91
95
{{< /tabpane >}}
92
96
93
97
## 要素が選択されているかどうか
@@ -101,14 +105,14 @@ value = driver.find_element(By.NAME, 'button_input').is_enabled()
101
105
{{< tab header="Java" text=true >}}
102
106
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L32-L35" >}}
103
107
{{< /tab >}}
104
- {{< tab header="Python" >}}
105
- # Navigate to url
108
+ {{< tab header="Python" >}}
109
+ # Navigate to url
106
110
driver.get("https://www.selenium.dev/selenium/web/inputs.html ")
107
111
108
- # Returns true if element is checked else returns false
112
+ # Returns true if element is checked else returns false
109
113
value = driver.find_element(By.NAME, "checkbox_input").is_selected()
110
- {{< /tab >}}
111
- {{< tab header="CSharp" >}}
114
+ {{< /tab >}}
115
+ {{< tab header="CSharp" text=true >}}
112
116
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L30-L33" >}}
113
117
{{< /tab >}}
114
118
{{< tab header="Ruby" text=true >}}
@@ -117,13 +121,13 @@ value = driver.find_element(By.NAME, "checkbox_input").is_selected()
117
121
{{< tab header="JavaScript" text=true >}}
118
122
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L30-L31">}}
119
123
{{< /tab >}}
120
- {{< tab header="Kotlin" >}}
121
- //navigates to url
122
- driver.get("https://www.selenium.dev/selenium/web/inputs.html ")
124
+ {{< tab header="Kotlin" >}}
125
+ //navigates to url
126
+ driver.get("https://www.selenium.dev/selenium/web/inputs.html ")
123
127
124
- //returns true if element is checked else returns false
125
- val attr = driver.findElement(By.name("checkbox_input")).isSelected()
126
- {{< /tab >}}
128
+ //returns true if element is checked else returns false
129
+ val attr = driver.findElement(By.name("checkbox_input")).isSelected()
130
+ {{< /tab >}}
127
131
{{< /tabpane >}}
128
132
129
133
## 要素のタグ名を取得
@@ -135,14 +139,14 @@ value = driver.find_element(By.NAME, "checkbox_input").is_selected()
135
139
{{< tab header="Java" text=true >}}
136
140
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L37-L40" >}}
137
141
{{< /tab >}}
138
- {{< tab header="Python" >}}
139
- # Navigate to url
142
+ {{< tab header="Python" >}}
143
+ # Navigate to url
140
144
driver.get("https://www.selenium.dev/selenium/web/inputs.html ")
141
145
142
- # Returns TagName of the element
146
+ # Returns TagName of the element
143
147
attr = driver.find_element(By.NAME, "email_input").tag_name
144
- {{< /tab >}}
145
- {{< tab header="CSharp" >}}
148
+ {{< /tab >}}
149
+ {{< tab header="CSharp" text=true >}}
146
150
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L35-L38" >}}
147
151
{{< /tab >}}
148
152
{{< tab header="Ruby" text=true >}}
@@ -151,13 +155,13 @@ attr = driver.find_element(By.NAME, "email_input").tag_name
151
155
{{< tab header="JavaScript" text=true >}}
152
156
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L37-L38">}}
153
157
{{< /tab >}}
154
- {{< tab header="Kotlin" >}}
155
- //navigates to url
156
- driver.get("https://www.selenium.dev/selenium/web/inputs.html ")
158
+ {{< tab header="Kotlin" >}}
159
+ //navigates to url
160
+ driver.get("https://www.selenium.dev/selenium/web/inputs.html ")
157
161
158
- //returns TagName of the element
159
- val attr = driver.findElement(By.name("email_input")).getTagName()
160
- {{< /tab >}}
162
+ //returns TagName of the element
163
+ val attr = driver.findElement(By.name("email_input")).getTagName()
164
+ {{< /tab >}}
161
165
{{< /tabpane >}}
162
166
163
167
## 要素矩形を取得
@@ -175,14 +179,14 @@ attr = driver.find_element(By.NAME, "email_input").tag_name
175
179
{{< tab header="Java" text=true >}}
176
180
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L42-L46" >}}
177
181
{{< /tab >}}
178
- {{< tab header="Python" >}}
179
- # Navigate to url
182
+ {{< tab header="Python" >}}
183
+ # Navigate to url
180
184
driver.get("https://www.selenium.dev/selenium/web/inputs.html ")
181
185
182
- # Returns height, width, x and y coordinates referenced element
186
+ # Returns height, width, x and y coordinates referenced element
183
187
res = driver.find_element(By.NAME, "range_input").rect
184
- {{< /tab >}}
185
- {{< tab header="CSharp" >}}
188
+ {{< /tab >}}
189
+ {{< tab header="CSharp" text=true >}}
186
190
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L40-L47" >}}
187
191
{{< /tab >}}
188
192
{{< tab header="Ruby" text=true >}}
@@ -191,7 +195,7 @@ res = driver.find_element(By.NAME, "range_input").rect
191
195
{{< tab header="JavaScript" text=true >}}
192
196
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L45">}}
193
197
{{< /tab >}}
194
- {{< tab header="Kotlin" >}}
198
+ {{< tab header="Kotlin" >}}
195
199
// Navigate to url
196
200
driver.get("https://www.selenium.dev/selenium/web/inputs.html ")
197
201
@@ -211,52 +215,48 @@ println(res.getX())
211
215
{{< tab header="Java" text=true >}}
212
216
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L49-L51" >}}
213
217
{{< /tab >}}
214
- {{< tab header="Python" >}}
215
-
216
- # Navigate to Url
218
+ {{< tab header="Python" >}}
219
+ # Navigate to Url
217
220
driver.get('https://www.selenium.dev/selenium/web/colorPage.html ')
218
221
219
- # Retrieves the computed style property 'color' of linktext
222
+ # Retrieves the computed style property 'color' of linktext
220
223
cssValue = driver.find_element(By.ID, "namedColor").value_of_css_property('background-color')
221
224
222
- {{< /tab >}}
223
- {{< tab header="CSharp" >}}
225
+ {{< /tab >}}
226
+ {{< tab header="CSharp" text=true >}}
224
227
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L49-L51" >}}
225
228
{{< /tab >}}
226
- {{< tab header="Ruby" text=true >}}
227
- {{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L38">}}
228
- {{< /tab >}}
229
- {{< tab header="JavaScript" text=true >}}
230
- {{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L76-L78">}}
231
- {{< /tab >}}
232
- {{< tab header="Kotlin" >}}
233
-
229
+ {{< tab header="Ruby" text=true >}}
230
+ {{< gh-codeblock path="/examples/ruby/spec/elements/information_spec.rb#L38">}}
231
+ {{< /tab >}}
232
+ {{< tab header="JavaScript" text=true >}}
233
+ {{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L76-L78">}}
234
+ {{< /tab >}}
235
+ {{< tab header="Kotlin" >}}
234
236
// Navigate to Url
235
237
driver.get("https://www.selenium.dev/selenium/web/colorPage.html ")
236
238
237
239
// Retrieves the computed style property 'color' of linktext
238
240
val cssValue = driver.findElement(By.id("namedColor")).getCssValue("background-color")
239
-
240
- {{< /tab >}}
241
+ {{< /tab >}}
241
242
{{< /tabpane >}}
242
243
243
244
## 要素テキストを取得
244
245
245
246
指定された要素のレンダリングされたテキストを取得します。
246
247
247
-
248
248
{{< tabpane langEqualsHeader=true >}}
249
249
{{< tab header="Java" text=true >}}
250
250
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L54-L57" >}}
251
251
{{< /tab >}}
252
- {{< tab header="Python" >}}
253
- # Navigate to url
252
+ {{< tab header="Python" >}}
253
+ # Navigate to url
254
254
driver.get("https://www.selenium.dev/selenium/web/linked_image.html ")
255
255
256
- # Retrieves the text of the element
256
+ # Retrieves the text of the element
257
257
text = driver.find_element(By.ID, "justanotherlink").text
258
- {{< /tab >}}
259
- {{< tab header="CSharp" >}}
258
+ {{< /tab >}}
259
+ {{< tab header="CSharp" text=true >}}
260
260
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L53-L56" >}}
261
261
{{< /tab >}}
262
262
{{< tab header="Ruby" text=true >}}
@@ -265,13 +265,13 @@ text = driver.find_element(By.ID, "justanotherlink").text
265
265
{{< tab header="JavaScript" text=true >}}
266
266
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L84-L86">}}
267
267
{{< /tab >}}
268
- {{< tab header="Kotlin" >}}
268
+ {{< tab header="Kotlin" >}}
269
269
// Navigate to URL
270
270
driver.get("https://www.selenium.dev/selenium/web/linked_image.html ")
271
271
272
272
// retrieves the text of the element
273
273
val text = driver.findElement(By.id("justanotherlink")).getText()
274
- {{< /tab >}}
274
+ {{< /tab >}}
275
275
{{< /tabpane >}}
276
276
277
277
## Fetching Attributes or Properties
@@ -284,7 +284,8 @@ with the DOM attribute or property of the element.
284
284
{{< tab header="Java" text=true >}}
285
285
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L60-L65" >}}
286
286
{{< /tab >}}
287
- {{< tab header="Python" >}}
287
+ {{< tab header="Python" >}}
288
+
288
289
# Navigate to the url
289
290
driver.get("https://www.selenium.dev/selenium/web/inputs.html ")
290
291
@@ -293,8 +294,9 @@ email_txt = driver.find_element(By.NAME, "email_input")
293
294
294
295
# Fetch the value property associated with the textbox
295
296
value_info = email_txt.get_attribute("value")
296
- {{< /tab >}}
297
- {{< tab header="CSharp" >}}
297
+
298
+ {{< /tab >}}
299
+ {{< tab header="CSharp" text=true >}}
298
300
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L58-L63" >}}
299
301
{{< /tab >}}
300
302
{{< tab header="Ruby" text=true >}}
@@ -303,11 +305,13 @@ value_info = email_txt.get_attribute("value")
303
305
{{< tab header="JavaScript" text=true >}}
304
306
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L55-L59">}}
305
307
{{< /tab >}}
306
- {{< tab header="Kotlin" >}}
308
+ {{< tab header="Kotlin" >}}
309
+
307
310
// Navigate to URL
308
311
driver.get("https://www.selenium.dev/selenium/web/inputs.html ")
309
312
310
313
//fetch the value property associated with the textbox
311
314
val attr = driver.findElement(By.name("email_input")).getAttribute("value")
312
- {{< /tab >}}
313
- {{< /tabpane >}}
315
+
316
+ {{< /tab >}}
317
+ {{< /tabpane >}}
0 commit comments