Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xpath note rearrangement #1884

Merged
merged 8 commits into from
Aug 22, 2024
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/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L29" >}
shbenzer marked this conversation as resolved.
Show resolved Hide resolved
{{< 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/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L29" >}
{{< 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/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L29" >}
{{< 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/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L29" >}
{{< 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