Skip to content

Commit

Permalink
Xpath note rearrangement (#1884)[deploy site]
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
shbenzer authored Aug 22, 2024
1 parent 9d1f0ed commit 0fde8cc
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 >}}
Original file line number Diff line number Diff line change
Expand Up @@ -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 >}}
Original file line number Diff line number Diff line change
Expand Up @@ -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 >}}
Original file line number Diff line number Diff line change
Expand Up @@ -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 >}}
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 0fde8cc

Please sign in to comment.