diff --git a/.github/workflows/java-examples.yml b/.github/workflows/java-examples.yml index 8cea55ce5f95..d3d11805b77a 100644 --- a/.github/workflows/java-examples.yml +++ b/.github/workflows/java-examples.yml @@ -67,7 +67,7 @@ jobs: command: | pip install yq xml_content=$(curl -sf https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/) - latest_snapshot=$(echo $xml_content | xq '.content.data."content-item"' | jq -r 'sort_by(.lastModified) | reverse | .[0] | .text') + latest_snapshot=$(echo $xml_content | xq '.content.data."content-item"' | jq -r .text) echo $latest_snapshot cd examples/java mvn -B -U test -Dselenium.version="$latest_snapshot" @@ -81,7 +81,7 @@ jobs: command: | pip install yq $xml_content = Invoke-WebRequest -Uri "https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/" - $latest_snapshot = $xml_content.Content | xq '.content.data.\"content-item\"' | jq -r 'sort_by(.lastModified) | reverse | .[0] | .text' + $latest_snapshot = $xml_content.Content | xq '.content.data.\"content-item\"' | jq -r .text Write-Output $latest_snapshot cd examples/java mvn -B -U test "-Dselenium.version=$latest_snapshot" diff --git a/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java b/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java index 2010cd7b4964..3aef0b4b6e3f 100644 --- a/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java +++ b/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java @@ -1,10 +1,17 @@ package dev.selenium.drivers; import dev.selenium.BaseTest; + +import java.time.Duration; +import java.time.temporal.ChronoUnit; + import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.openqa.selenium.PageLoadStrategy; +import org.openqa.selenium.UnexpectedAlertBehaviour; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeOptions; +import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.chrome.ChromeDriver; public class OptionsTest extends BaseTest { @@ -60,5 +67,107 @@ public void setAcceptInsecureCerts() { driver.quit(); } } + + @Test + public void getBrowserName() { + ChromeOptions chromeOptions = new ChromeOptions(); + String name = chromeOptions.getBrowserName(); + Assertions.assertFalse(name.isEmpty(), "Browser name should not be empty"); + } + + @Test + public void setBrowserVersion() { + ChromeOptions chromeOptions = new ChromeOptions(); + String version = "latest"; + chromeOptions.setBrowserVersion(version); + Assertions.assertEquals(version, chromeOptions.getBrowserVersion()); + } + + @Test + public void setPlatformName() { + ChromeOptions chromeOptions = new ChromeOptions(); + String platform = "OS X 10.6"; + chromeOptions.setPlatformName(platform); + Assertions.assertEquals(platform, chromeOptions.getPlatformName().toString()); + } + + @Test + public void setScriptTimeout() { + ChromeOptions chromeOptions = new ChromeOptions(); + Duration duration = Duration.of(5, ChronoUnit.SECONDS); + chromeOptions.setScriptTimeout(duration); + + WebDriver driver = new ChromeDriver(chromeOptions); + try { + Duration timeout = driver.manage().timeouts().getScriptTimeout(); + Assertions.assertEquals(timeout, duration, "The script timeout should be set to 5 seconds."); + } finally { + driver.quit(); + } + } + + @Test + public void setPageLoadTimeout() { + ChromeOptions chromeOptions = new ChromeOptions(); + Duration duration = Duration.of(5, ChronoUnit.SECONDS); + chromeOptions.setPageLoadTimeout(duration); + + WebDriver driver = new ChromeDriver(chromeOptions); + try { + Duration timeout = driver.manage().timeouts().getPageLoadTimeout(); + Assertions.assertEquals(timeout, duration, "The page load timeout should be set to 5 seconds."); + } finally { + driver.quit(); + } + } + + @Test + public void setImplicitWaitTimeout() { + ChromeOptions chromeOptions = new ChromeOptions(); + Duration duration = Duration.of(5, ChronoUnit.SECONDS); + chromeOptions.setImplicitWaitTimeout(duration); + + WebDriver driver = new ChromeDriver(chromeOptions); + try { + Duration timeout = driver.manage().timeouts().getImplicitWaitTimeout(); + Assertions.assertEquals(timeout, duration, "The implicit wait timeout should be set to 5 seconds."); + } finally { + driver.quit(); + } + } + + @Test + public void setUnhandledPromptBehaviour() { + ChromeOptions chromeOptions = new ChromeOptions(); + chromeOptions.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.DISMISS_AND_NOTIFY); + //verify the capability object is not null + Object capabilityObject = chromeOptions.getCapability(CapabilityType.UNHANDLED_PROMPT_BEHAVIOUR); + Assertions.assertNotNull(capabilityObject, "Capability UNHANDLED_PROMPT_BEHAVIOUR should not be null."); + Assertions.assertEquals(capabilityObject.toString(), UnexpectedAlertBehaviour.DISMISS_AND_NOTIFY.toString()); + } + + @Test + public void setWindowRect() { + ChromeOptions chromeOptions = new ChromeOptions(); + chromeOptions.setCapability(CapabilityType.SET_WINDOW_RECT, true); + //verify the capability object is not null + Object capabilityObject = chromeOptions.getCapability(CapabilityType.SET_WINDOW_RECT); + Assertions.assertNotNull(capabilityObject, "Capability SET_WINDOW_RECT should not be null."); + + Boolean capability = (Boolean) capabilityObject; + Assertions.assertTrue(capability, "The capability SET_WINDOW_RECT should be set to true."); + } + + @Test + public void setStrictFileInteractability() { + ChromeOptions chromeOptions = new ChromeOptions(); + chromeOptions.setCapability(CapabilityType.STRICT_FILE_INTERACTABILITY, true); + //verify the capability object is not null + Object capabilityObject = chromeOptions.getCapability(CapabilityType.STRICT_FILE_INTERACTABILITY); + Assertions.assertNotNull(capabilityObject, "Capability STRICT_FILE_INTERACTABILITY should not be null."); + + Boolean capability = (Boolean) capabilityObject; + Assertions.assertTrue(capability, "The capability STRICT_FILE_INTERACTABILITY should be set to true."); + } } diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.en.md b/website_and_docs/content/documentation/webdriver/drivers/options.en.md index 14ffc923a1a6..dd767e885b2e 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.en.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.en.md @@ -31,7 +31,7 @@ Browser name is set by default when using an Options class instance. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-74" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L36" >}} @@ -58,7 +58,7 @@ it will be automatically downloaded by [Selenium Manager]({{< ref "../../seleniu {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L80-82" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L37" >}} @@ -114,7 +114,7 @@ event fire is returned. {{< tabpane langEqualsHeader=true >}} {{< badge-examples >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L14-L16">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L21-L23">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L9-L10">}} @@ -171,7 +171,7 @@ event fire is returned. {{< tabpane langEqualsHeader=true >}} {{< badge-examples >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L27-L29">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L34-L36">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L19-L20">}} @@ -227,7 +227,7 @@ WebDriver only waits until the initial page is downloaded. {{< tabpane langEqualsHeader=true >}} {{< badge-examples >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L40-L42">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L47-L49">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L29-L30">}} @@ -287,7 +287,7 @@ setting `platformName` sets the OS at the remote-end. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L88-L90">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L38">}} @@ -325,7 +325,7 @@ effect for the entire session. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L60-L61">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L39-40">}} @@ -360,7 +360,7 @@ is imposed when a new session is created by WebDriver. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L96-L98">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L47-48">}} @@ -389,7 +389,7 @@ _TimeoutException_. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L111-L113">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L55-56">}} @@ -416,7 +416,7 @@ is imposed when a new session is created by WebDriver. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L126-L128">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L63-64">}} @@ -454,7 +454,7 @@ user prompt encounters at the remote-end. This is defined by {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L71-72">}} @@ -479,7 +479,7 @@ Indicates whether the remote end supports all of the [resizing and repositioning {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L151-L152">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L79-80">}} @@ -507,7 +507,7 @@ when using _Element Send Keys_ with hidden file upload controls. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L163-L164">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L87-88">}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.ja.md b/website_and_docs/content/documentation/webdriver/drivers/options.ja.md index 0895b84fc365..6df6df28da6b 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.ja.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.ja.md @@ -31,7 +31,7 @@ Browser name is set by default when using an Options class instance. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-74" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L36" >}} @@ -59,7 +59,7 @@ it will be automatically downloaded by [Selenium Manager]({{< ref "../../seleniu {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L80-82" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L37" >}} @@ -112,7 +112,7 @@ WebDriver は [load](https://developer.mozilla.org/ja/docs/Web/API/Window/load_e {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L14-L16">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L21-L23">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L9-L10">}} @@ -168,7 +168,7 @@ WebDriver は、[DOMContentLoaded](https://developer.mozilla.org/ja/docs/Web/API {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L27-L29">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L34-L36">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L19-L20">}} @@ -223,7 +223,7 @@ WebDriver は、最初のページがダウンロードされるまで待機し {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L40-L42">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L47-L49">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L29-L30">}} @@ -281,7 +281,7 @@ fun main() { {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L88-L90">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L38">}} @@ -313,7 +313,7 @@ fun main() { {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L60-L61">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L39-40">}} @@ -345,7 +345,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L96-L98">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L47-48">}} @@ -371,7 +371,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L111-L113">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L55-56">}} @@ -396,7 +396,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L126-L128">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L63-64">}} @@ -433,7 +433,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L71-72">}} @@ -459,7 +459,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L151-L152">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L79-80">}} @@ -486,7 +486,7 @@ WebDriverの `セッション` には特定の `セッションタイムアウ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L163-L164">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L87-88">}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md b/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md index 4325eb4d612a..b5b295536e6f 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md @@ -43,7 +43,7 @@ extremidade remota, a criação da sessão falhará. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-74" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L36" >}} @@ -71,7 +71,7 @@ tiver apenas 80 instalados, a criação da sessão falhará. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L80-82" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L37" >}} @@ -127,7 +127,7 @@ event fire is returned. {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L14-L16">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L21-L23">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L9-L10">}} @@ -183,7 +183,7 @@ event fire is returned. {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L27-L29">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L34-L36">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L19-L20">}} @@ -238,7 +238,7 @@ WebDriver only waits until the initial page is downloaded. {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L40-L42">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L47-L49">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L29-L30">}} @@ -298,7 +298,7 @@ setting `platformName` sets the OS at the remote-end. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L88-L90">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L38">}} @@ -336,7 +336,7 @@ effect for the entire session. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L60-L61">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L39-40">}} @@ -372,7 +372,7 @@ is imposed when a new session is created by WebDriver. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L96-L98">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L47-48">}} @@ -401,7 +401,7 @@ _TimeoutException_. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L111-L113">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L55-56">}} @@ -428,7 +428,7 @@ is imposed when a new session is created by WebDriver. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L126-L128">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L63-64">}} @@ -467,7 +467,7 @@ user prompt encounters at the remote-end. This is defined by {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L71-72">}} @@ -493,7 +493,7 @@ Indicates whether the remote end supports all of the [resizing and repositioning {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L151-L152">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L79-80">}} @@ -522,7 +522,7 @@ when using _Element Send Keys_ with hidden file upload controls. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L163-L164">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L87-88">}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md b/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md index 979ee5244e86..b94b88ac546f 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md @@ -34,7 +34,7 @@ aliases: [ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-74" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L36" >}} @@ -63,7 +63,7 @@ aliases: [ {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L80-82" >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L37" >}} @@ -123,7 +123,7 @@ WebDriver一直等到 [load](https://developer.mozilla.org/en-US/docs/Web/API/Wi {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L14-L16">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L21-L23">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L9-L10">}} @@ -179,7 +179,7 @@ WebDriver一直等到 [DOMContentLoaded](https://developer.mozilla.org/en-US/doc {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L27-L29">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L34-L36">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L19-L20">}} @@ -234,7 +234,7 @@ WebDriver 仅等待初始页面已下载. {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L40-L42">}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L47-L49">}} {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L29-L30">}} @@ -294,7 +294,7 @@ fun main() { {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L88-L90">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L38">}} @@ -329,7 +329,7 @@ fun main() { {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L60-L61">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L39-40">}} @@ -364,7 +364,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L96-L98">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L47-48">}} @@ -392,7 +392,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L111-L113">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L55-56">}} @@ -418,7 +418,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L126-L128">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L63-64">}} @@ -457,7 +457,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L71-72">}} @@ -484,7 +484,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L151-L152">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L79-80">}} @@ -513,7 +513,7 @@ WebDriver创建新会话时, {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-code >}} +{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L163-L164">}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L87-88">}}