diff --git a/examples/python/tests/browsers/test_firefox.py b/examples/python/tests/browsers/test_firefox.py index 73c32961ab76..82ebc47abf3e 100644 --- a/examples/python/tests/browsers/test_firefox.py +++ b/examples/python/tests/browsers/test_firefox.py @@ -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" diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md index 833584b6fc5c..d22f53b20ff3 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md @@ -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 >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md index 832de7cc3671..fdfb2f1d2142 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md @@ -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 >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md index f8ba9d2d0775..5c9e8d254221 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md @@ -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 >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md index 699d6cb7bf19..bcfcd6951231 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md @@ -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 >}}