diff --git a/examples/java/src/test/java/dev/selenium/elements/InformationTest.java b/examples/java/src/test/java/dev/selenium/elements/InformationTest.java index 02d480fa3dab..1fee46929bf5 100644 --- a/examples/java/src/test/java/dev/selenium/elements/InformationTest.java +++ b/examples/java/src/test/java/dev/selenium/elements/InformationTest.java @@ -64,6 +64,13 @@ public void informationWithElements() { String valueInfo = emailTxt.getAttribute("value"); assertEquals(valueInfo,"admin@localhost"); + // Fetch Dom Property + String propInfo = emailTxt.getDomProperty("value"); + assertEquals(propInfo,"admin@localhost"); + + // Fetch Dom Attribute + String attrInfo = emailTxt.getDomAttribute("value"); + assertEquals(attrInfo,"admin@localhost"); driver.quit(); } diff --git a/website_and_docs/content/documentation/webdriver/elements/information.en.md b/website_and_docs/content/documentation/webdriver/elements/information.en.md index d75aa29a490a..faa92aa55201 100644 --- a/website_and_docs/content/documentation/webdriver/elements/information.en.md +++ b/website_and_docs/content/documentation/webdriver/elements/information.en.md @@ -251,7 +251,9 @@ val text = driver.findElement(By.id("justanotherlink")).getText() -## Fetching Attributes or Properties +## Fetching Attributes and Properties + +### Get Attribute Fetches the run time value associated with a DOM attribute. It returns the data associated @@ -281,3 +283,55 @@ driver.get("https://www.selenium.dev/selenium/web/inputs.html") val attr = driver.findElement(By.name("email_input")).getAttribute("value") {{< /tab >}} {{< /tabpane >}} + + +### Get Dom Property + +This method retrieves the value of a specific DOM property of a web element. + +{{< tabpane langEqualsHeader=true >}} +{{< tab header="Java" text=true >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L67-L69" >}} +{{< /tab >}} + {{< tab header="Python" text=true >}} + + {{< /tab >}} +{{< tab header="CSharp" text=true >}} + +{{< /tab >}} +{{< tab header="Ruby" text=true >}} + +{{< /tab >}} +{{< tab header="JavaScript" text=true >}} + +{{< /tab >}} + {{< tab header="Kotlin" >}} + + {{< /tab >}} +{{< /tabpane >}} + + +### Get Dom Attribute + +This method retrieves the value of a specific HTML attribute of a web element + +{{< tabpane langEqualsHeader=true >}} +{{< tab header="Java" text=true >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L71-L73" >}} +{{< /tab >}} +{{< tab header="Python" text=true >}} + + {{< /tab >}} +{{< tab header="CSharp" text=true >}} + +{{< /tab >}} +{{< tab header="Ruby" text=true >}} + +{{< /tab >}} +{{< tab header="JavaScript" text=true >}} + +{{< /tab >}} + {{< tab header="Kotlin" >}} + + {{< /tab >}} +{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/elements/information.ja.md b/website_and_docs/content/documentation/webdriver/elements/information.ja.md index 416b738ff30e..72f76135c6ee 100644 --- a/website_and_docs/content/documentation/webdriver/elements/information.ja.md +++ b/website_and_docs/content/documentation/webdriver/elements/information.ja.md @@ -243,7 +243,9 @@ val text = driver.findElement(By.id("justanotherlink")).getText() {{< /tab >}} {{< /tabpane >}} -## Fetching Attributes or Properties +## Fetching Attributes and Properties + +### Get Attribute Fetches the run time value associated with a DOM attribute. It returns the data associated @@ -265,13 +267,64 @@ with the DOM attribute or property of the element. {{< tab header="JavaScript" text=true >}} {{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L55-L59">}} {{< /tab >}} -{{< tab header="Kotlin" >}} - + {{< tab header="Kotlin" >}} // Navigate to URL driver.get("https://www.selenium.dev/selenium/web/inputs.html") //fetch the value property associated with the textbox val attr = driver.findElement(By.name("email_input")).getAttribute("value") + {{< /tab >}} +{{< /tabpane >}} + + +### Get Dom Property + +This method retrieves the value of a specific DOM property of a web element. + +{{< tabpane langEqualsHeader=true >}} +{{< tab header="Java" text=true >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L67-L69" >}} +{{< /tab >}} + {{< tab header="Python" text=true >}} + + {{< /tab >}} +{{< tab header="CSharp" text=true >}} + +{{< /tab >}} +{{< tab header="Ruby" text=true >}} + +{{< /tab >}} +{{< tab header="JavaScript" text=true >}} {{< /tab >}} + {{< tab header="Kotlin" >}} + + {{< /tab >}} {{< /tabpane >}} + + +### Get Dom Attribute + +This method retrieves the value of a specific HTML attribute of a web element + +{{< tabpane langEqualsHeader=true >}} +{{< tab header="Java" text=true >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L71-L73" >}} +{{< /tab >}} +{{< tab header="Python" text=true >}} + + {{< /tab >}} +{{< tab header="CSharp" text=true >}} + +{{< /tab >}} +{{< tab header="Ruby" text=true >}} + +{{< /tab >}} +{{< tab header="JavaScript" text=true >}} + +{{< /tab >}} + {{< tab header="Kotlin" >}} + + {{< /tab >}} +{{< /tabpane >}} + diff --git a/website_and_docs/content/documentation/webdriver/elements/information.pt-br.md b/website_and_docs/content/documentation/webdriver/elements/information.pt-br.md index 14455d333078..5d0e5047ca62 100644 --- a/website_and_docs/content/documentation/webdriver/elements/information.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/elements/information.pt-br.md @@ -258,7 +258,9 @@ val text = driver.findElement(By.id("justanotherlink")).getText() {{< /tab >}} {{< /tabpane >}} -## Fetching Attributes or Properties +## Fetching Attributes and Properties + +### Get Attribute Fetches the run time value associated with a DOM attribute. It returns the data associated @@ -266,11 +268,11 @@ with the DOM attribute or property of the element. {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L60-L65" >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L60-L64" >}} {{< /tab >}} -{{< tab header="Python" text=true >}} + {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/elements/test_information.py#L44-L46" >}} -{{< /tab >}} + {{< /tab >}} {{< tab header="CSharp" text=true >}} {{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Elements/InformationTest.cs#L58-L62" >}} {{< /tab >}} @@ -280,13 +282,63 @@ with the DOM attribute or property of the element. {{< tab header="JavaScript" text=true >}} {{< gh-codeblock path="/examples/javascript/test/elements/information.spec.js#L55-L59">}} {{< /tab >}} -{{< tab header="Kotlin" >}} - + {{< tab header="Kotlin" >}} // Navigate to URL driver.get("https://www.selenium.dev/selenium/web/inputs.html") //fetch the value property associated with the textbox val attr = driver.findElement(By.name("email_input")).getAttribute("value") + {{< /tab >}} +{{< /tabpane >}} + + +### Get Dom Property + +This method retrieves the value of a specific DOM property of a web element. + +{{< tabpane langEqualsHeader=true >}} +{{< tab header="Java" text=true >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L67-L69" >}} +{{< /tab >}} + {{< tab header="Python" text=true >}} + + {{< /tab >}} +{{< tab header="CSharp" text=true >}} + +{{< /tab >}} +{{< tab header="Ruby" text=true >}} + +{{< /tab >}} +{{< tab header="JavaScript" text=true >}} {{< /tab >}} + {{< tab header="Kotlin" >}} + + {{< /tab >}} +{{< /tabpane >}} + + +### Get Dom Attribute + +This method retrieves the value of a specific HTML attribute of a web element + +{{< tabpane langEqualsHeader=true >}} +{{< tab header="Java" text=true >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L71-L73" >}} +{{< /tab >}} +{{< tab header="Python" text=true >}} + + {{< /tab >}} +{{< tab header="CSharp" text=true >}} + +{{< /tab >}} +{{< tab header="Ruby" text=true >}} + +{{< /tab >}} +{{< tab header="JavaScript" text=true >}} + +{{< /tab >}} + {{< tab header="Kotlin" >}} + + {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/elements/information.zh-cn.md b/website_and_docs/content/documentation/webdriver/elements/information.zh-cn.md index f45d15f1a5b9..2e7762a644d5 100644 --- a/website_and_docs/content/documentation/webdriver/elements/information.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/elements/information.zh-cn.md @@ -277,3 +277,55 @@ val attr = driver.findElement(By.name("email_input")).getAttribute("value") {{< /tab >}} {{< /tabpane >}} + + +### Get Dom Property + +This method retrieves the value of a specific DOM property of a web element. + +{{< tabpane langEqualsHeader=true >}} +{{< tab header="Java" text=true >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L67-L69" >}} +{{< /tab >}} + {{< tab header="Python" text=true >}} + + {{< /tab >}} +{{< tab header="CSharp" text=true >}} + +{{< /tab >}} +{{< tab header="Ruby" text=true >}} + +{{< /tab >}} +{{< tab header="JavaScript" text=true >}} + +{{< /tab >}} + {{< tab header="Kotlin" >}} + + {{< /tab >}} +{{< /tabpane >}} + + +### Get Dom Attribute + +This method retrieves the value of a specific HTML attribute of a web element + +{{< tabpane langEqualsHeader=true >}} +{{< tab header="Java" text=true >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/elements/InformationTest.java#L71-L73" >}} +{{< /tab >}} +{{< tab header="Python" text=true >}} + + {{< /tab >}} +{{< tab header="CSharp" text=true >}} + +{{< /tab >}} +{{< tab header="Ruby" text=true >}} + +{{< /tab >}} +{{< tab header="JavaScript" text=true >}} + +{{< /tab >}} + {{< tab header="Kotlin" >}} + + {{< /tab >}} +{{< /tabpane >}}