Skip to content

Commit c960ee9

Browse files
added get dom property and get dom attribute method information
1 parent ed84530 commit c960ee9

5 files changed

Lines changed: 228 additions & 10 deletions

File tree

examples/java/src/test/java/dev/selenium/elements/InformationTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ public void informationWithElements() {
6464
String valueInfo = emailTxt.getAttribute("value");
6565
assertEquals(valueInfo,"admin@localhost");
6666

67+
// Fetch Dom Property
68+
String propInfo = emailTxt.getDomProperty("value");
69+
assertEquals(propInfo,"admin@localhost");
70+
71+
// Fetch Dom Attribute
72+
String attrInfo = emailTxt.getDomAttribute("value");
73+
assertEquals(attrInfo,"admin@localhost");
6774

6875
driver.quit();
6976
}

website_and_docs/content/documentation/webdriver/elements/information.en.md

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,9 @@ val text = driver.findElement(By.id("justanotherlink")).getText()
251251

252252

253253

254-
## Fetching Attributes or Properties
254+
## Fetching Attributes and Properties
255+
256+
### Get Attribute
255257

256258
Fetches the run time value associated with a
257259
DOM attribute. It returns the data associated
@@ -281,3 +283,55 @@ driver.get("https://www.selenium.dev/selenium/web/inputs.html")
281283
val attr = driver.findElement(By.name("email_input")).getAttribute("value")
282284
{{< /tab >}}
283285
{{< /tabpane >}}
286+
287+
288+
### Get Dom Property
289+
290+
This method retrieves the value of a specific DOM property of a web element.
291+
292+
{{< tabpane langEqualsHeader=true >}}
293+
{{< tab header="Java" text=true >}}
294+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L67-L69" >}}
295+
{{< /tab >}}
296+
{{< tab header="Python" text=true >}}
297+
298+
{{< /tab >}}
299+
{{< tab header="CSharp" text=true >}}
300+
301+
{{< /tab >}}
302+
{{< tab header="Ruby" text=true >}}
303+
304+
{{< /tab >}}
305+
{{< tab header="JavaScript" text=true >}}
306+
307+
{{< /tab >}}
308+
{{< tab header="Kotlin" >}}
309+
310+
{{< /tab >}}
311+
{{< /tabpane >}}
312+
313+
314+
### Get Dom Attribute
315+
316+
This method retrieves the value of a specific HTML attribute of a web element
317+
318+
{{< tabpane langEqualsHeader=true >}}
319+
{{< tab header="Java" text=true >}}
320+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L71-L73" >}}
321+
{{< /tab >}}
322+
{{< tab header="Python" text=true >}}
323+
324+
{{< /tab >}}
325+
{{< tab header="CSharp" text=true >}}
326+
327+
{{< /tab >}}
328+
{{< tab header="Ruby" text=true >}}
329+
330+
{{< /tab >}}
331+
{{< tab header="JavaScript" text=true >}}
332+
333+
{{< /tab >}}
334+
{{< tab header="Kotlin" >}}
335+
336+
{{< /tab >}}
337+
{{< /tabpane >}}

website_and_docs/content/documentation/webdriver/elements/information.ja.md

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ val text = driver.findElement(By.id("justanotherlink")).getText()
243243
{{< /tab >}}
244244
{{< /tabpane >}}
245245

246-
## Fetching Attributes or Properties
246+
## Fetching Attributes and Properties
247+
248+
### Get Attribute
247249

248250
Fetches the run time value associated with a
249251
DOM attribute. It returns the data associated
@@ -265,13 +267,64 @@ with the DOM attribute or property of the element.
265267
{{< tab header="JavaScript" text=true >}}
266268
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L55-L59">}}
267269
{{< /tab >}}
268-
{{< tab header="Kotlin" >}}
269-
270+
{{< tab header="Kotlin" >}}
270271
// Navigate to URL
271272
driver.get("https://www.selenium.dev/selenium/web/inputs.html")
272273

273274
//fetch the value property associated with the textbox
274275
val attr = driver.findElement(By.name("email_input")).getAttribute("value")
276+
{{< /tab >}}
277+
{{< /tabpane >}}
278+
279+
280+
### Get Dom Property
281+
282+
This method retrieves the value of a specific DOM property of a web element.
283+
284+
{{< tabpane langEqualsHeader=true >}}
285+
{{< tab header="Java" text=true >}}
286+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L67-L69" >}}
287+
{{< /tab >}}
288+
{{< tab header="Python" text=true >}}
289+
290+
{{< /tab >}}
291+
{{< tab header="CSharp" text=true >}}
292+
293+
{{< /tab >}}
294+
{{< tab header="Ruby" text=true >}}
295+
296+
{{< /tab >}}
297+
{{< tab header="JavaScript" text=true >}}
275298

276299
{{< /tab >}}
300+
{{< tab header="Kotlin" >}}
301+
302+
{{< /tab >}}
277303
{{< /tabpane >}}
304+
305+
306+
### Get Dom Attribute
307+
308+
This method retrieves the value of a specific HTML attribute of a web element
309+
310+
{{< tabpane langEqualsHeader=true >}}
311+
{{< tab header="Java" text=true >}}
312+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L71-L73" >}}
313+
{{< /tab >}}
314+
{{< tab header="Python" text=true >}}
315+
316+
{{< /tab >}}
317+
{{< tab header="CSharp" text=true >}}
318+
319+
{{< /tab >}}
320+
{{< tab header="Ruby" text=true >}}
321+
322+
{{< /tab >}}
323+
{{< tab header="JavaScript" text=true >}}
324+
325+
{{< /tab >}}
326+
{{< tab header="Kotlin" >}}
327+
328+
{{< /tab >}}
329+
{{< /tabpane >}}
330+

website_and_docs/content/documentation/webdriver/elements/information.pt-br.md

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,19 +258,21 @@ val text = driver.findElement(By.id("justanotherlink")).getText()
258258
{{< /tab >}}
259259
{{< /tabpane >}}
260260

261-
## Fetching Attributes or Properties
261+
## Fetching Attributes and Properties
262+
263+
### Get Attribute
262264

263265
Fetches the run time value associated with a
264266
DOM attribute. It returns the data associated
265267
with the DOM attribute or property of the element.
266268

267269
{{< tabpane langEqualsHeader=true >}}
268270
{{< tab header="Java" text=true >}}
269-
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L60-L65" >}}
271+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L60-L64" >}}
270272
{{< /tab >}}
271-
{{< tab header="Python" text=true >}}
273+
{{< tab header="Python" text=true >}}
272274
{{< gh-codeblock path="/examples/python/tests/elements/test_information.py#L44-L46" >}}
273-
{{< /tab >}}
275+
{{< /tab >}}
274276
{{< tab header="CSharp" text=true >}}
275277
{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L58-L62" >}}
276278
{{< /tab >}}
@@ -280,13 +282,63 @@ with the DOM attribute or property of the element.
280282
{{< tab header="JavaScript" text=true >}}
281283
{{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L55-L59">}}
282284
{{< /tab >}}
283-
{{< tab header="Kotlin" >}}
284-
285+
{{< tab header="Kotlin" >}}
285286
// Navigate to URL
286287
driver.get("https://www.selenium.dev/selenium/web/inputs.html")
287288

288289
//fetch the value property associated with the textbox
289290
val attr = driver.findElement(By.name("email_input")).getAttribute("value")
291+
{{< /tab >}}
292+
{{< /tabpane >}}
293+
294+
295+
### Get Dom Property
296+
297+
This method retrieves the value of a specific DOM property of a web element.
298+
299+
{{< tabpane langEqualsHeader=true >}}
300+
{{< tab header="Java" text=true >}}
301+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L67-L69" >}}
302+
{{< /tab >}}
303+
{{< tab header="Python" text=true >}}
304+
305+
{{< /tab >}}
306+
{{< tab header="CSharp" text=true >}}
307+
308+
{{< /tab >}}
309+
{{< tab header="Ruby" text=true >}}
310+
311+
{{< /tab >}}
312+
{{< tab header="JavaScript" text=true >}}
290313

291314
{{< /tab >}}
315+
{{< tab header="Kotlin" >}}
316+
317+
{{< /tab >}}
318+
{{< /tabpane >}}
319+
320+
321+
### Get Dom Attribute
322+
323+
This method retrieves the value of a specific HTML attribute of a web element
324+
325+
{{< tabpane langEqualsHeader=true >}}
326+
{{< tab header="Java" text=true >}}
327+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L71-L73" >}}
328+
{{< /tab >}}
329+
{{< tab header="Python" text=true >}}
330+
331+
{{< /tab >}}
332+
{{< tab header="CSharp" text=true >}}
333+
334+
{{< /tab >}}
335+
{{< tab header="Ruby" text=true >}}
336+
337+
{{< /tab >}}
338+
{{< tab header="JavaScript" text=true >}}
339+
340+
{{< /tab >}}
341+
{{< tab header="Kotlin" >}}
342+
343+
{{< /tab >}}
292344
{{< /tabpane >}}

website_and_docs/content/documentation/webdriver/elements/information.zh-cn.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,55 @@ val attr = driver.findElement(By.name("email_input")).getAttribute("value")
277277

278278
{{< /tab >}}
279279
{{< /tabpane >}}
280+
281+
282+
### Get Dom Property
283+
284+
This method retrieves the value of a specific DOM property of a web element.
285+
286+
{{< tabpane langEqualsHeader=true >}}
287+
{{< tab header="Java" text=true >}}
288+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L67-L69" >}}
289+
{{< /tab >}}
290+
{{< tab header="Python" text=true >}}
291+
292+
{{< /tab >}}
293+
{{< tab header="CSharp" text=true >}}
294+
295+
{{< /tab >}}
296+
{{< tab header="Ruby" text=true >}}
297+
298+
{{< /tab >}}
299+
{{< tab header="JavaScript" text=true >}}
300+
301+
{{< /tab >}}
302+
{{< tab header="Kotlin" >}}
303+
304+
{{< /tab >}}
305+
{{< /tabpane >}}
306+
307+
308+
### Get Dom Attribute
309+
310+
This method retrieves the value of a specific HTML attribute of a web element
311+
312+
{{< tabpane langEqualsHeader=true >}}
313+
{{< tab header="Java" text=true >}}
314+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L71-L73" >}}
315+
{{< /tab >}}
316+
{{< tab header="Python" text=true >}}
317+
318+
{{< /tab >}}
319+
{{< tab header="CSharp" text=true >}}
320+
321+
{{< /tab >}}
322+
{{< tab header="Ruby" text=true >}}
323+
324+
{{< /tab >}}
325+
{{< tab header="JavaScript" text=true >}}
326+
327+
{{< /tab >}}
328+
{{< tab header="Kotlin" >}}
329+
330+
{{< /tab >}}
331+
{{< /tabpane >}}

0 commit comments

Comments
 (0)