From 0fde8cc56f661bfdc19008a4273b2e36f932fe42 Mon Sep 17 00:00:00 2001 From: Simon Benzer <69980130+shbenzer@users.noreply.github.com> Date: Thu, 22 Aug 2024 14:12:58 -0400 Subject: [PATCH] Xpath note rearrangement (#1884)[deploy site] * added quitting examples for all lanaguges/translations * fixed xpath child note being in wrong place of code example * Update _index.en.md w/ csharp example * Update _index.ja.md w/ csharp example * Update _index.pt-br.md w/ csharp example * Update _index.zh-cn.md w/ csharp example --- .../content/documentation/webdriver/drivers/_index.en.md | 4 ++++ .../content/documentation/webdriver/drivers/_index.ja.md | 4 ++++ .../content/documentation/webdriver/drivers/_index.pt-br.md | 4 ++++ .../content/documentation/webdriver/drivers/_index.zh-cn.md | 4 ++++ .../content/documentation/webdriver/elements/finders.en.md | 2 +- .../content/documentation/webdriver/elements/finders.ja.md | 2 +- .../content/documentation/webdriver/elements/finders.pt-br.md | 2 +- .../content/documentation/webdriver/elements/finders.zh-cn.md | 2 +- 8 files changed, 20 insertions(+), 4 deletions(-) diff --git a/website_and_docs/content/documentation/webdriver/drivers/_index.en.md b/website_and_docs/content/documentation/webdriver/drivers/_index.en.md index 797a010aba7c..d4d194929965 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/drivers/_index.en.md @@ -61,21 +61,25 @@ and it is recommended to always use `quit` to end the session {{< tabpane text=true >}} {{< tab header="Java" >}} +{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L29" >} {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L13" >}} {{% /tab %}} {{< tab header="CSharp" >}} +{< gh-codeblock path="examples/dotnet/HelloSelenium.cs#L13" >} {{< badge-code >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L16" >}} {{< /tab >}} {{< tab header="JavaScript" >}} +{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L28" >} {{< badge-code >}} {{< /tab >}} {{< tab header="Kotlin" >}} +{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L35" >} {{< badge-code >}} {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/_index.ja.md b/website_and_docs/content/documentation/webdriver/drivers/_index.ja.md index 8dee6ebaaf89..6dbc132b0761 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/_index.ja.md +++ b/website_and_docs/content/documentation/webdriver/drivers/_index.ja.md @@ -60,21 +60,25 @@ weight: 3 {{< tabpane text=true >}} {{< tab header="Java" >}} +{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L29" >} {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L13" >}} {{% /tab %}} {{< tab header="CSharp" >}} +{< gh-codeblock path="examples/dotnet/HelloSelenium.cs#L13" >} {{< badge-code >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L16" >}} {{< /tab >}} {{< tab header="JavaScript" >}} +{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L28" >} {{< badge-code >}} {{< /tab >}} {{< tab header="Kotlin" >}} +{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L35" >} {{< badge-code >}} {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/drivers/_index.pt-br.md index 2e335ce8673f..3080c59843e2 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/_index.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/drivers/_index.pt-br.md @@ -61,21 +61,25 @@ and it is recommended to always use `quit` to end the session {{< tabpane text=true >}} {{< tab header="Java" >}} +{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L29" >} {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L13" >}} {{% /tab %}} {{< tab header="CSharp" >}} +{< gh-codeblock path="examples/dotnet/HelloSelenium.cs#L13" >} {{< badge-code >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L16" >}} {{< /tab >}} {{< tab header="JavaScript" >}} +{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L28" >} {{< badge-code >}} {{< /tab >}} {{< tab header="Kotlin" >}} +{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L35" >} {{< badge-code >}} {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/drivers/_index.zh-cn.md index 430c7f34b67e..67f0bb3f4874 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/_index.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/drivers/_index.zh-cn.md @@ -61,21 +61,25 @@ weight: 3 {{< tabpane text=true >}} {{< tab header="Java" >}} +{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L29" >} {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} {{< gh-codeblock path="examples/python/tests/drivers/test_options.py#L13" >}} {{% /tab %}} {{< tab header="CSharp" >}} +{< gh-codeblock path="examples/dotnet/HelloSelenium.cs#L13" >} {{< badge-code >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L16" >}} {{< /tab >}} {{< tab header="JavaScript" >}} +{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L28" >} {{< badge-code >}} {{< /tab >}} {{< tab header="Kotlin" >}} +{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L35" >} {{< badge-code >}} {{< /tab >}} {{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/elements/finders.en.md b/website_and_docs/content/documentation/webdriver/elements/finders.en.md index ecdc2680977f..533e13eab3a9 100644 --- a/website_and_docs/content/documentation/webdriver/elements/finders.en.md +++ b/website_and_docs/content/documentation/webdriver/elements/finders.en.md @@ -314,12 +314,12 @@ driver.get("https://www.example.com") element = driver.find_element(By.TAG_NAME, 'div') # Get all the elements available with tag name 'p' - # NOTE: in order to utilize XPATH from current element, you must add "." to beginning of path elements = element.find_elements(By.TAG_NAME, 'p') for e in elements: print(e.text) ##get elements from parent element using XPATH +##NOTE: in order to utilize XPATH from current element, you must add "." to beginning of path # Get first element of tag 'ul' element = driver.find_element(By.XPATH, '//ul') diff --git a/website_and_docs/content/documentation/webdriver/elements/finders.ja.md b/website_and_docs/content/documentation/webdriver/elements/finders.ja.md index f8f03a1d1fa5..47c4adac366d 100644 --- a/website_and_docs/content/documentation/webdriver/elements/finders.ja.md +++ b/website_and_docs/content/documentation/webdriver/elements/finders.ja.md @@ -300,12 +300,12 @@ driver.get("https://www.example.com") element = driver.find_element(By.TAG_NAME, 'div') # Get all the elements available with tag name 'p' - # NOTE: in order to utilize XPATH from current element, you must add "." to beginning of path elements = element.find_elements(By.TAG_NAME, 'p') for e in elements: print(e.text) ##get elements from parent element using XPATH +##NOTE: in order to utilize XPATH from current element, you must add "." to beginning of path # Get first element of tag 'ul' element = driver.find_element(By.XPATH, '//ul') diff --git a/website_and_docs/content/documentation/webdriver/elements/finders.pt-br.md b/website_and_docs/content/documentation/webdriver/elements/finders.pt-br.md index fd501bc10123..89e20a5414f0 100644 --- a/website_and_docs/content/documentation/webdriver/elements/finders.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/elements/finders.pt-br.md @@ -299,12 +299,12 @@ Para realizar isso, o WebElement pai é encadeado com o 'findElements' para aces element = driver.find_element(By.TAG_NAME, 'div') # Obtém todos os elementos disponíveis com o nome da tag 'p' - # NOTE: in order to utilize XPATH from current element, you must add "." to beginning of path elements = element.find_elements(By.TAG_NAME, 'p') for e in elements: print(e.text) ##get elements from parent element using XPATH +##NOTE: in order to utilize XPATH from current element, you must add "." to beginning of path # Get first element of tag 'ul' element = driver.find_element(By.XPATH, '//ul') diff --git a/website_and_docs/content/documentation/webdriver/elements/finders.zh-cn.md b/website_and_docs/content/documentation/webdriver/elements/finders.zh-cn.md index 36d9980e0401..372a13880ed4 100644 --- a/website_and_docs/content/documentation/webdriver/elements/finders.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/elements/finders.zh-cn.md @@ -309,12 +309,12 @@ driver.get("https://www.example.com") element = driver.find_element(By.TAG_NAME, 'div') # Get all the elements available with tag name 'p' - # NOTE: in order to utilize XPATH from current element, you must add "." to beginning of path elements = element.find_elements(By.TAG_NAME, 'p') for e in elements: print(e.text) ##get elements from parent element using XPATH +##NOTE: in order to utilize XPATH from current element, you must add "." to beginning of path # Get first element of tag 'ul' element = driver.find_element(By.XPATH, '//ul')