Skip to content

Commit

Permalink
[py]: add firefox context example for python (#2050)[deploy site]
Browse files Browse the repository at this point in the history
add firefox python context example
  • Loading branch information
navin772 authored Nov 8, 2024
1 parent 1114bfd commit 88c7b5c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
10 changes: 10 additions & 0 deletions examples/python/tests/browsers/test_firefox.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,13 @@ def test_full_page_screenshot(firefox_driver):
assert os.path.exists("full_page_screenshot.png")

driver.quit()


def test_set_context(firefox_driver):
driver = firefox_driver

with driver.context(driver.CONTEXT_CHROME):
driver.execute_script("console.log('Inside Chrome context');")

# Check if the context is back to content
assert driver.execute("GET_CONTEXT")["value"] == "content"
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,9 @@ please refer to the
{{< tab header="Java" >}}
{{< badge-code >}}
{{< /tab >}}
{{% tab header="Python" %}}
{{< badge-code >}}
{{% /tab %}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L149-L150" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ IDはアドオンインストール時の戻り値から取得できます。
{{< tab header="Java" >}}
{{< badge-code >}}
{{< /tab >}}
{{% tab header="Python" %}}
{{< badge-code >}}
{{% /tab %}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L149-L150" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,9 @@ please refer to the
{{< tab header="Java" >}}
{{< badge-code >}}
{{< /tab >}}
{{% tab header="Python" %}}
{{< badge-code >}}
{{% /tab %}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L149-L150" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,9 @@ please refer to the
{{< tab header="Java" >}}
{{< badge-code >}}
{{< /tab >}}
{{% tab header="Python" %}}
{{< badge-code >}}
{{% /tab %}}
{{< tab header="Python" >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L149-L150" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< /tab >}}
Expand Down

0 comments on commit 88c7b5c

Please sign in to comment.