From eedcfff4ebde55c2799f1d2bffed36c370ed7989 Mon Sep 17 00:00:00 2001 From: pallavigitwork Date: Fri, 28 Apr 2023 16:46:48 +0530 Subject: [PATCH 1/2] added code for isdisplayed kotlin --- .../documentation/webdriver/elements/information.en.md | 7 ++++++- .../documentation/webdriver/elements/information.ja.md | 6 +++++- .../documentation/webdriver/elements/information.pt-br.md | 6 +++++- .../documentation/webdriver/elements/information.zh-cn.md | 6 +++++- 4 files changed, 21 insertions(+), 4 deletions(-) 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 d28cf5f0d49e..3a3b94e61319 100644 --- a/website_and_docs/content/documentation/webdriver/elements/information.en.md +++ b/website_and_docs/content/documentation/webdriver/elements/information.en.md @@ -61,7 +61,12 @@ await driver.get("https://www.selenium.dev/selenium/web/inputs.html"); let result = await driver.findElement(By.name("email_input")).isDisplayed(); {{< /tab >}} {{< tab header="Kotlin" >}} -// Help us with a PR for code sample + //navigates to url + driver.get("https://www.selenium.dev/selenium/web/inputs.html") + + //returns true if element is displayed else returns false + val flag = driver.findElement(By.name("email_input")).isDisplayed() + {{< /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 2b5fb4fdf7ef..92587bc6eb45 100644 --- a/website_and_docs/content/documentation/webdriver/elements/information.ja.md +++ b/website_and_docs/content/documentation/webdriver/elements/information.ja.md @@ -61,7 +61,11 @@ await driver.get("https://www.selenium.dev/selenium/web/inputs.html"); let result = await driver.findElement(By.name("email_input")).isDisplayed(); {{< /tab >}} {{< tab header="Kotlin" >}} -// Help us with a PR for code sample +//navigates to url + driver.get("https://www.selenium.dev/selenium/web/inputs.html") + + //returns true if element is displayed else returns false + val flag = driver.findElement(By.name("email_input")).isDisplayed() {{< /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 b1203d0b9ee2..c89473c44465 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 @@ -62,7 +62,11 @@ await driver.get("https://www.selenium.dev/selenium/web/inputs.html"); let result = await driver.findElement(By.name("email_input")).isDisplayed(); {{< /tab >}} {{< tab header="Kotlin" >}} -// Help us with a PR for code sample +//navigates to url + driver.get("https://www.selenium.dev/selenium/web/inputs.html") + + //returns true if element is displayed else returns false + val flag = driver.findElement(By.name("email_input")).isDisplayed() {{< /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 e1a430b04c68..428febe0cb09 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 @@ -55,7 +55,11 @@ await driver.get("https://www.selenium.dev/selenium/web/inputs.html"); let result = await driver.findElement(By.name("email_input")).isDisplayed(); {{< /tab >}} {{< tab header="Kotlin" >}} -// Help us with a PR for code sample +//navigates to url + driver.get("https://www.selenium.dev/selenium/web/inputs.html") + + //returns true if element is displayed else returns false + val flag = driver.findElement(By.name("email_input")).isDisplayed() {{< /tab >}} {{< /tabpane >}} From 67aa7e2b43de96acec5387f3729fd0c8b578b4b6 Mon Sep 17 00:00:00 2001 From: pallavigitwork Date: Thu, 12 Oct 2023 12:31:49 +0530 Subject: [PATCH 2/2] added java github codelines for element interaction --- .../webdriver/elements/interactions.en.md | 47 +++++-------------- .../webdriver/elements/interactions.ja.md | 44 +++++------------ .../webdriver/elements/interactions.pt-br.md | 44 +++++------------ .../webdriver/elements/interactions.zh-cn.md | 43 +++++------------ 4 files changed, 51 insertions(+), 127 deletions(-) diff --git a/website_and_docs/content/documentation/webdriver/elements/interactions.en.md b/website_and_docs/content/documentation/webdriver/elements/interactions.en.md index a207426bedbf..f41b281e1fe9 100644 --- a/website_and_docs/content/documentation/webdriver/elements/interactions.en.md +++ b/website_and_docs/content/documentation/webdriver/elements/interactions.en.md @@ -42,15 +42,11 @@ If the center of the element is [obscured](https://w3c.github.io/webdriver/#dfn- Selenium will return an [element click intercepted](https://w3c.github.io/webdriver/#dfn-element-click-intercepted) error. -{{< tabpane langEqualsHeader=true >}} -{{< badge-examples >}} - {{< tab header="Java" >}} - // Navigate to Url - driver.get("https://www.selenium.dev/selenium/web/inputs.html"); - // Click on the element - driver.findElement(By.name("color_input")).click(); - - {{< /tab >}} + +{{< tabpane text=true langEqualsHeader=true >}} +{{< tab header="Java" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InteractionTest.java#L18-L22" >}} +{{< /tab >}} {{< tab header="Python" >}} # Navigate to url @@ -109,20 +105,11 @@ with a `content-editable` attribute. If it is not editable, [Here](https://www.w3.org/TR/webdriver/#keyboard-actions) is the list of possible keystrokes that WebDriver Supports. -{{< tabpane langEqualsHeader=true >}} -{{< badge-examples >}} - {{< tab header="Java" >}} - // Navigate to Url - driver.get("https://www.selenium.dev/selenium/web/inputs.html"); +{{< tabpane text=true langEqualsHeader=true >}} +{{< tab header="Java" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InteractionTest.java#L27-L32" >}} +{{< /tab >}} - // Clear field to empty it from any previous data - driver.findElement(By.name("email_input")).clear(); - - //Enter Text - driver.findElement(By.name("email_input")).sendKeys("admin@localhost.dev"); - - - {{< /tab >}} {{< tab header="Python" >}} @@ -197,18 +184,10 @@ this means an element is an input element of a form with a `text` type or an ele with a`content-editable` attribute. If these conditions are not met, [an invalid element state](https://w3c.github.io/webdriver/#dfn-invalid-element-state) error is returned. -{{< tabpane langEqualsHeader=true >}} -{{< badge-examples >}} - {{< tab header="Java" >}} - // Navigate to Url - driver.get("https://www.selenium.dev/selenium/web/inputs.html"); - - // Clear field to empty it from any previous data - driver.findElement(By.name("email_input")).clear(); - - - - {{< /tab >}} +{{< tabpane text=true langEqualsHeader=true >}} +{{< tab header="Java" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InteractionTest.java#L38-L40" >}} +{{< /tab >}} {{< tab header="Python" >}} diff --git a/website_and_docs/content/documentation/webdriver/elements/interactions.ja.md b/website_and_docs/content/documentation/webdriver/elements/interactions.ja.md index 7c1d5e5daeb2..5456c3b9ae5f 100644 --- a/website_and_docs/content/documentation/webdriver/elements/interactions.ja.md +++ b/website_and_docs/content/documentation/webdriver/elements/interactions.ja.md @@ -39,14 +39,11 @@ the [center of the element](https://w3c.github.io/webdriver/#dfn-center-point). If the center of the element is [obscured](https://w3c.github.io/webdriver/#dfn-obscuring) for some reason, Selenium will return an [element click intercepted](https://w3c.github.io/webdriver/#dfn-element-click-intercepted) error. -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} - // Navigate to Url - driver.get("https://www.selenium.dev/selenium/web/inputs.html"); - // Click on the element - driver.findElement(By.name("color_input")).click(); - - {{< /tab >}} + +{{< tabpane text=true langEqualsHeader=true >}} +{{< tab header="Java" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InteractionTest.java#L18-L22" >}} +{{< /tab >}} {{< tab header="Python" >}} # Navigate to url @@ -104,19 +101,11 @@ with a `content-editable` attribute. If it is not editable, [Here](https://www.w3.org/TR/webdriver/#keyboard-actions) is the list of possible keystrokes that WebDriver Supports. -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} - // Navigate to Url - driver.get("https://www.selenium.dev/selenium/web/inputs.html"); +{{< tabpane text=true langEqualsHeader=true >}} +{{< tab header="Java" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InteractionTest.java#L27-L32" >}} +{{< /tab >}} - // Clear field to empty it from any previous data - driver.findElement(By.name("email_input")).clear(); - - //Enter Text - driver.findElement(By.name("email_input")).sendKeys("admin@localhost.dev"); - - - {{< /tab >}} {{< tab header="Python" >}} @@ -191,17 +180,10 @@ this means an element is an input element of a form with a `text` type or an ele with a`content-editable` attribute. If these conditions are not met, [an invalid element state](https://w3c.github.io/webdriver/#dfn-invalid-element-state) error is returned. -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} - // Navigate to Url - driver.get("https://www.selenium.dev/selenium/web/inputs.html"); - - // Clear field to empty it from any previous data - driver.findElement(By.name("email_input")).clear(); - - - - {{< /tab >}} +{{< tabpane text=true langEqualsHeader=true >}} +{{< tab header="Java" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InteractionTest.java#L38-L40" >}} +{{< /tab >}} {{< tab header="Python" >}} diff --git a/website_and_docs/content/documentation/webdriver/elements/interactions.pt-br.md b/website_and_docs/content/documentation/webdriver/elements/interactions.pt-br.md index a429e9532efd..1b723ebc9ab0 100644 --- a/website_and_docs/content/documentation/webdriver/elements/interactions.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/elements/interactions.pt-br.md @@ -40,14 +40,11 @@ If the center of the element is [obscured](https://w3c.github.io/webdriver/#dfn- Selenium will return an [element click intercepted](https://w3c.github.io/webdriver/#dfn-element-click-intercepted) error. -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} - // Navigate to Url - driver.get("https://www.selenium.dev/selenium/web/inputs.html"); - // Click on the element - driver.findElement(By.name("color_input")).click(); - - {{< /tab >}} + +{{< tabpane text=true langEqualsHeader=true >}} +{{< tab header="Java" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InteractionTest.java#L18-L22" >}} +{{< /tab >}} {{< tab header="Python" >}} # Navigate to url @@ -106,19 +103,11 @@ with a `content-editable` attribute. If it is not editable, [Here](https://www.w3.org/TR/webdriver/#keyboard-actions) is the list of possible keystrokes that WebDriver Supports. -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} - // Navigate to Url - driver.get("https://www.selenium.dev/selenium/web/inputs.html"); +{{< tabpane text=true langEqualsHeader=true >}} +{{< tab header="Java" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InteractionTest.java#L27-L32" >}} +{{< /tab >}} - // Clear field to empty it from any previous data - driver.findElement(By.name("email_input")).clear(); - - //Enter Text - driver.findElement(By.name("email_input")).sendKeys("admin@localhost.dev"); - - - {{< /tab >}} {{< tab header="Python" >}} @@ -193,17 +182,10 @@ this means an element is an input element of a form with a `text` type or an ele with a`content-editable` attribute. If these conditions are not met, [an invalid element state](https://w3c.github.io/webdriver/#dfn-invalid-element-state) error is returned. -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} - // Navigate to Url - driver.get("https://www.selenium.dev/selenium/web/inputs.html"); - - // Clear field to empty it from any previous data - driver.findElement(By.name("email_input")).clear(); - - - - {{< /tab >}} +{{< tabpane text=true langEqualsHeader=true >}} +{{< tab header="Java" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InteractionTest.java#L38-L40" >}} +{{< /tab >}} {{< tab header="Python" >}} diff --git a/website_and_docs/content/documentation/webdriver/elements/interactions.zh-cn.md b/website_and_docs/content/documentation/webdriver/elements/interactions.zh-cn.md index d7e4a220a616..090043abbcaf 100644 --- a/website_and_docs/content/documentation/webdriver/elements/interactions.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/elements/interactions.zh-cn.md @@ -43,14 +43,10 @@ description: > Selenium将返回一个 [元素点击中断](https://w3c.github.io/webdriver/#dfn-element-click-intercepted) 错误. -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} - // Navigate to Url - driver.get("https://www.selenium.dev/selenium/web/inputs.html"); - // Click on the element - driver.findElement(By.name("color_input")).click(); - - {{< /tab >}} +{{< tabpane text=true langEqualsHeader=true >}} +{{< tab header="Java" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InteractionTest.java#L18-L22" >}} +{{< /tab >}} {{< tab header="Python" >}} # Navigate to url @@ -109,19 +105,11 @@ Selenium将返回一个 [元素点击中断](https://w3c.github.io/webdriver/#df [以下](https://www.w3.org/TR/webdriver/#keyboard-actions) 是WebDriver支持的按键列表. -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} - // Navigate to Url - driver.get("https://www.selenium.dev/selenium/web/inputs.html"); - - // Clear field to empty it from any previous data - driver.findElement(By.name("email_input")).clear(); - - //Enter Text - driver.findElement(By.name("email_input")).sendKeys("admin@localhost.dev"); - +{{< tabpane text=true langEqualsHeader=true >}} +{{< tab header="Java" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InteractionTest.java#L27-L32" >}} +{{< /tab >}} - {{< /tab >}} {{< tab header="Python" >}} @@ -197,17 +185,10 @@ Selenium将返回一个 [元素点击中断](https://w3c.github.io/webdriver/#df 如果不满足这些条件, 将返回 [无效元素状态](https://w3c.github.io/webdriver/#dfn-invalid-element-state) 错误. -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} - // Navigate to Url - driver.get("https://www.selenium.dev/selenium/web/inputs.html"); - - // Clear field to empty it from any previous data - driver.findElement(By.name("email_input")).clear(); - - - - {{< /tab >}} +{{< tabpane text=true langEqualsHeader=true >}} +{{< tab header="Java" >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/elements/InteractionTest.java#L38-L40" >}} +{{< /tab >}} {{< tab header="Python" >}}