diff --git a/examples/python/tests/browsers/test_chrome.py b/examples/python/tests/browsers/test_chrome.py index 5bf81e3fca26..4e54d61316d6 100644 --- a/examples/python/tests/browsers/test_chrome.py +++ b/examples/python/tests/browsers/test_chrome.py @@ -121,3 +121,51 @@ def test_build_checks(capfd): assert expected in err driver.quit() + +def test_network_conditions(): + driver = webdriver.Chrome() + + driver.set_network_conditions(offline=False, latency=250, throughput=500*1024) + driver.get('http://selenium.dev') + + driver.quit() + +def test_logs(): + driver = webdriver.Chrome() + + driver.get('https://www.selenium.dev/webs') + browser_logs = driver.get_log('browser') + + assert 'Failed to load' in browser_logs[0]['message'] + + driver.quit() + +def test_permissions(): + driver = webdriver.Chrome() + + driver.get('https://www.selenium.dev') + + driver.set_permissions('geolocation', 'denied') + + geolocation_permissions = driver.execute_script('return await navigator.permissions.query({name: \'geolocation\'})') + assert geolocation_permissions['state'] == 'denied' + + driver.quit() + +def test_casting(): + + driver = webdriver.Chrome() + + try: + sinks = driver.get_sinks() + if len(sinks) > 0: + device_name = sinks[0]['name'] + driver.start_tab_mirroring(device_name) + driver.stop_casting(device_name) + except: + assert False, 'Exception when starting or stopping casting' + + driver.get('http://selenium.dev') + + driver.quit() + \ No newline at end of file diff --git a/examples/python/tests/browsers/test_edge.py b/examples/python/tests/browsers/test_edge.py index ac0224ebd66c..b4b1e036e7d7 100644 --- a/examples/python/tests/browsers/test_edge.py +++ b/examples/python/tests/browsers/test_edge.py @@ -122,3 +122,47 @@ def test_build_checks(log_path): driver.quit() +def test_network_conditions(): + driver = webdriver.Edge() + + driver.set_network_conditions(offline=False, latency=250, throughput=500*1024) + driver.get('http://selenium.dev') + + driver.quit() + +def test_logs(): + driver = webdriver.Edge() + + driver.get('https://www.selenium.dev/webs') + browser_logs = driver.get_log('browser') + + assert 'Failed to load' in browser_logs[0]['message'] + driver.quit() + +def test_permissions(): + driver = webdriver.Edge() + + driver.get('https://www.selenium.dev') + driver.set_permissions('geolocation', 'denied') + + geolocation_permissions = driver.execute_script('return await navigator.permissions.query({name: \'geolocation\'})') + assert geolocation_permissions['state'] == 'denied' + + driver.quit() + +def test_casting(): + + driver = webdriver.Edge() + + try: + sinks = driver.get_sinks() + if len(sinks) > 0: + device_name = sinks[0]['name'] + driver.start_tab_mirroring(device_name) + driver.stop_casting(device_name) + except: + assert False, 'Exception when starting or stopping casting' + + driver.get('http://selenium.dev') + + driver.quit() diff --git a/examples/python/tests/browsers/test_firefox.py b/examples/python/tests/browsers/test_firefox.py index 4f0ae0a382fb..fe1d0c716392 100644 --- a/examples/python/tests/browsers/test_firefox.py +++ b/examples/python/tests/browsers/test_firefox.py @@ -1,11 +1,11 @@ import os import subprocess -import sys +import pathlib -import pytest from selenium import webdriver + def test_basic_options(): options = webdriver.FirefoxOptions() driver = webdriver.Firefox(options=options) @@ -129,3 +129,31 @@ def test_install_unsigned_addon_directory_slash(firefox_driver, addon_path_dir_s injected = driver.find_element(webdriver.common.by.By.ID, "webextensions-selenium-example") assert injected.text == "Content injected by webextensions-selenium-example" + +def test_full_page_screenshots(): + driver = webdriver.Firefox() + + driver.get("https://www.selenium.dev/") + + path_for_screenshot = str(pathlib.Path().absolute()) + 'screenshot.png' + driver.save_full_page_screenshot(path_for_screenshot) + + driver.quit() + +def test_context(): + driver = webdriver.Firefox() + + driver.context = 'content' + driver.get("https://www.selenium.dev/") + + driver.quit() + +def test_profiles(): + options = webdriver.FirefoxOptions() + firefox_profile = webdriver.FirefoxProfile() + firefox_profile.set_preference("javascript.enabled", False) + options.profile = firefox_profile + + driver = webdriver.Firefox(options) + + driver.quit() diff --git a/examples/python/tests/browsers/test_internet_explorer.py b/examples/python/tests/browsers/test_internet_explorer.py index c3efd343cdf6..e4a8712e68b3 100644 --- a/examples/python/tests/browsers/test_internet_explorer.py +++ b/examples/python/tests/browsers/test_internet_explorer.py @@ -67,3 +67,71 @@ def test_supporting_files(temp_dir): driver = webdriver.Ie(service=service) driver.quit() + +@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows") +def test_file_upload_dialog_timeout(): + options = webdriver.IeOptions() + + options.file_upload_dialog_timeout = 2000 + + driver = webdriver.Ie(options=options) + driver.get('https://www.selenium.dev/') + + driver.quit() + +@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows") +def test_ensure_clean_session(): + options = webdriver.IeOptions() + + options.ensure_clean_session = True + + driver = webdriver.Ie(options=options) + driver.get('https://www.selenium.dev/') + + driver.quit() + +@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows") +def test_ignore_zoom_setting(): + options = webdriver.IeOptions() + + options.ignore_zoom_level = True + + driver = webdriver.Ie(options=options) + driver.get('https://www.selenium.dev/') + + driver.quit() + +@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows") +def test_ignore_protected_mode_settings(): + options = webdriver.IeOptions() + + options.ignore_protected_mode_settings = True + + driver = webdriver.Ie(options=options) + driver.get('https://www.selenium.dev/') + + driver.quit() + +@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows") +def test_silent_capability(): + options = webdriver.IeOptions() + + options.add_argument('-silent') + + driver = webdriver.Ie(options=options) + driver.get('https://www.selenium.dev/') + + driver.quit() + +@pytest.mark.skip(reason="TabProcGrowth is required to be set to 0 value") +def test_command_line_options(): + options = webdriver.IeOptions() + + options.add_argument('-private') + options.force_create_process_api = True + + driver = webdriver.Ie(options=options) + driver.get('https://www.selenium.dev/') + + driver.quit() + diff --git a/examples/python/tests/browsers/test_safari.py b/examples/python/tests/browsers/test_safari.py index ba2677ef0daf..62ddf2432049 100644 --- a/examples/python/tests/browsers/test_safari.py +++ b/examples/python/tests/browsers/test_safari.py @@ -28,6 +28,7 @@ def test_technology_preview(): executable_path='/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver' ) driver = webdriver.Safari(options=options, service=service) + driver.get('http://selenium.dev') driver.quit() diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md index 1bae347db3d0..e497155def40 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md @@ -373,7 +373,7 @@ You can drive Chrome Cast devices, including sharing tabs {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L160-L164" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} @@ -399,7 +399,7 @@ You can simulate various network conditions. {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L128" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} @@ -422,7 +422,7 @@ You can simulate various network conditions. {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L137" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} @@ -445,7 +445,7 @@ You can simulate various network conditions. {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L148" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md index ae73388a0d65..a17d302d6282 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md @@ -376,7 +376,7 @@ Property value: `"true"` or `"false"` {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L160-L164" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md index 29e7473eefae..02ed2cf57a38 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md @@ -373,7 +373,7 @@ Pode comandar dispositivos Chrome Cast, incluindo partilhar abas {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L160-L164" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md index 67212c605e65..2ebdd1866db6 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md @@ -374,7 +374,7 @@ Chromedriver 和 Chrome 浏览器版本应该匹配, 如果它们不匹配, 驱 {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L160-L164" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md index 5964af0fefb5..ec38ed5a44c2 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md @@ -374,7 +374,7 @@ You can drive Chrome Cast devices with Edge, including sharing tabs {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_edge.py#L158-L162" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} @@ -399,7 +399,7 @@ You can simulate various network conditions. {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_edge.py#L128" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} @@ -422,7 +422,7 @@ You can simulate various network conditions. {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_edge.py#L137" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} @@ -445,7 +445,7 @@ You can simulate various network conditions. {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_edge.py#L146" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md index 6a3afad92c2d..b24932f380dc 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md @@ -376,7 +376,7 @@ You can drive Chrome Cast devices with Edge, including sharing tabs {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_edge.py#L158-L162" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md index c28ba3067a6c..d97417016182 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md @@ -376,7 +376,7 @@ You can drive Chrome Cast devices with Edge, including sharing tabs {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_edge.py#L158-L162" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md index b8966197efdc..faf80b2daa7b 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md @@ -376,7 +376,7 @@ You can drive Chrome Cast devices with Edge, including sharing tabs {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_edge.py#L158-L162" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} 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 bbf2534b85f8..9b9dd1fdaa6f 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md @@ -108,13 +108,8 @@ FirefoxOptions options = new FirefoxOptions(); options.setProfile(profile); driver = new FirefoxDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium.webdriver.firefox.options import Options -from selenium.webdriver.firefox.firefox_profile import FirefoxProfile -options=Options() -firefox_profile = FirefoxProfile() -firefox_profile.set_preference("javascript.enabled", False) -options.profile = firefox_profile + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L152-L155" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new FirefoxOptions(); @@ -417,7 +412,7 @@ please refer to the {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_firefox.py#L138-L139" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} @@ -444,7 +439,7 @@ please refer to the {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_firefox.py#L146" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} 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 6c04bb4b2aa1..06242241a7ce 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md @@ -112,13 +112,8 @@ FirefoxOptions options = new FirefoxOptions(); options.setProfile(profile); driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium.webdriver.firefox.options import Options -from selenium.webdriver.firefox.firefox_profile import FirefoxProfile -options=Options() -firefox_profile = FirefoxProfile() -firefox_profile.set_preference("javascript.enabled", False) -options.profile = firefox_profile + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L152-155" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new FirefoxOptions(); @@ -424,7 +419,7 @@ please refer to the {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_firefox.py#L138-139" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} @@ -451,7 +446,7 @@ please refer to the {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_firefox.py#L146" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} 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 aebb96a26145..94d6667bbd61 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 @@ -111,13 +111,8 @@ FirefoxOptions options = new FirefoxOptions(); options.setProfile(profile); driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium.webdriver.firefox.options import Options -from selenium.webdriver.firefox.firefox_profile import FirefoxProfile -options=Options() -firefox_profile = FirefoxProfile() -firefox_profile.set_preference("javascript.enabled", False) -options.profile = firefox_profile + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L152-L155" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new FirefoxOptions(); @@ -422,7 +417,7 @@ please refer to the {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_firefox.py#L138-L139" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} @@ -449,7 +444,7 @@ please refer to the {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_firefox.py#L146" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} 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 87b9e259a869..ff35a18bf7ff 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 @@ -110,13 +110,8 @@ FirefoxOptions options = new FirefoxOptions(); options.setProfile(profile); driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium.webdriver.firefox.options import Options -from selenium.webdriver.firefox.firefox_profile import FirefoxProfile -options=Options() -firefox_profile = FirefoxProfile() -firefox_profile.set_preference("javascript.enabled", False) -options.profile = firefox_profile + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L152-L155" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new FirefoxOptions(); @@ -419,7 +414,7 @@ please refer to the {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_firefox.py#L138-L139" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} @@ -446,7 +441,7 @@ please refer to the {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_firefox.py#L146" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.en.md b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.en.md index 764fc8434308..979b6657bf33 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.en.md @@ -97,16 +97,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.waitForUploadDialogUpTo(Duration.ofSeconds(2)); WebDriver driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.file_upload_dialog_timeout = 2000 -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L75" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new InternetExplorerOptions(); @@ -150,16 +142,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.destructivelyEnsureCleanSession(); WebDriver driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.ensure_clean_session = True -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L86" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new InternetExplorerOptions(); @@ -198,16 +182,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.ignoreZoomSettings(); WebDriver driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.ignore_zoom_level = True -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L97" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new InternetExplorerOptions(); @@ -256,16 +232,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.introduceFlakinessByIgnoringSecurityDomains(); WebDriver driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.ignore_protected_mode_settings = True -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L108" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new InternetExplorerOptions(); @@ -303,16 +271,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.setCapability("silent", true); WebDriver driver = new InternetExplorerDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.set_capability("silent", True) -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L119" >}} {{< /tab >}} {{< tab header="CSharp" >}} InternetExplorerOptions options = new InternetExplorerOptions(); @@ -400,17 +360,8 @@ public class ieTest { } } {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.add_argument('-private') -options.force_create_process_api = True -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L130" >}} {{< /tab >}} {{< tab header="CSharp" >}} using System; @@ -495,16 +446,8 @@ public class ieTest { } } {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.force_create_process_api = True -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L131" >}} {{< /tab >}} {{< tab header="CSharp" >}} using System; diff --git a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.ja.md b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.ja.md index 7beae548b86e..4b104bb5b42c 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.ja.md @@ -94,16 +94,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.waitForUploadDialogUpTo(Duration.ofSeconds(2)); WebDriver driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.file_upload_dialog_timeout = 2000 -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L75" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new InternetExplorerOptions(); @@ -144,16 +136,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.destructivelyEnsureCleanSession(); WebDriver driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.ensure_clean_session = True -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L86" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new InternetExplorerOptions(); @@ -191,16 +175,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.ignoreZoomSettings(); WebDriver driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.ignore_zoom_level = True -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L97" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new InternetExplorerOptions(); @@ -245,16 +221,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.introduceFlakinessByIgnoringSecurityDomains(); WebDriver driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.ignore_protected_mode_settings = True -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L108" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new InternetExplorerOptions(); @@ -290,16 +258,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.setCapability("silent", true); WebDriver driver = new InternetExplorerDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.set_capability("silent", True) -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L119" >}} {{< /tab >}} {{< tab header="CSharp" >}} InternetExplorerOptions options = new InternetExplorerOptions(); @@ -387,17 +347,8 @@ public class ieTest { } } {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.add_argument('-private') -options.force_create_process_api = True -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L130" >}} {{< /tab >}} {{< tab header="CSharp" >}} using System; @@ -480,16 +431,8 @@ public class ieTest { } } {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.force_create_process_api = True -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L131" >}} {{< /tab >}} {{< tab header="CSharp" >}} using System; diff --git a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.pt-br.md index 666f21eb042f..938dd8226c9f 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.pt-br.md @@ -97,17 +97,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.waitForUploadDialogUpTo(Duration.ofSeconds(2)); WebDriver driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.file_upload_dialog_timeout = 2000 -driver = webdriver.Ie(options=options) - -# Navegar para Url -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L75" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new InternetExplorerOptions(); @@ -150,17 +141,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.destructivelyEnsureCleanSession(); WebDriver driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.ensure_clean_session = True -driver = webdriver.Ie(options=options) - -# Navegar para Url -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L86" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new InternetExplorerOptions(); @@ -198,17 +180,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.ignoreZoomSettings(); WebDriver driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.ignore_zoom_level = True -driver = webdriver.Ie(options=options) - -# Navegar para Url -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L97" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new InternetExplorerOptions(); @@ -256,17 +229,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.introduceFlakinessByIgnoringSecurityDomains(); WebDriver driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.ignore_protected_mode_settings = True -driver = webdriver.Ie(options=options) - -# Navegar para Url -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L108" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new InternetExplorerOptions(); @@ -303,17 +267,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.setCapability("silent", true); WebDriver driver = new InternetExplorerDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.set_capability("silent", True) -driver = webdriver.Ie(options=options) - -# Navegar para Url -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L119" >}} {{< /tab >}} {{< tab header="CSharp" >}} InternetExplorerOptions options = new InternetExplorerOptions(); @@ -400,18 +355,8 @@ public class ieTest { } } {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.add_argument('-private') -options.force_create_process_api = True -driver = webdriver.Ie(options=options) - -# Navegar para Url -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L130" >}} {{< /tab >}} {{< tab header="CSharp" >}} using System; @@ -495,17 +440,8 @@ public class ieTest { } } {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.force_create_process_api = True -driver = webdriver.Ie(options=options) - -# Navegar para Url -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L131" >}} {{< /tab >}} {{< tab header="CSharp" >}} using System; diff --git a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md index 9f09e64c2437..f70e424f0ca1 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md @@ -94,16 +94,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.waitForUploadDialogUpTo(Duration.ofSeconds(2)); WebDriver driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.file_upload_dialog_timeout = 2000 -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L75" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new InternetExplorerOptions(); @@ -146,16 +138,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.destructivelyEnsureCleanSession(); WebDriver driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.ensure_clean_session = True -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L86" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new InternetExplorerOptions(); @@ -194,16 +178,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.ignoreZoomSettings(); WebDriver driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.ignore_zoom_level = True -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L97" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new InternetExplorerOptions(); @@ -251,16 +227,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.introduceFlakinessByIgnoringSecurityDomains(); WebDriver driver = new RemoteWebDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.ignore_protected_mode_settings = True -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L108" >}} {{< /tab >}} {{< tab header="CSharp" >}} var options = new InternetExplorerOptions(); @@ -297,16 +265,8 @@ InternetExplorerOptions options = new InternetExplorerOptions(); options.setCapability("silent", true); WebDriver driver = new InternetExplorerDriver(options); {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.set_capability("silent", True) -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L119" >}} {{< /tab >}} {{< tab header="CSharp" >}} InternetExplorerOptions options = new InternetExplorerOptions(); @@ -397,17 +357,8 @@ public class ieTest { } } {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.add_argument('-private') -options.force_create_process_api = True -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L130" >}} {{< /tab >}} {{< tab header="CSharp" >}} using System; @@ -491,16 +442,8 @@ public class ieTest { } } {{< /tab >}} - {{< tab header="Python" >}} -from selenium import webdriver - -options = webdriver.IeOptions() -options.force_create_process_api = True -driver = webdriver.Ie(options=options) - -driver.get("http://www.google.com") - -driver.quit() + {{< tab header="Python" text=true >}} + {{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L131" >}} {{< /tab >}} {{< tab header="CSharp" >}} using System; diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.en.md b/website_and_docs/content/documentation/webdriver/browsers/safari.en.md index 4817f03645df..279560eaeb52 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.en.md @@ -96,7 +96,7 @@ Apple provides a development version of their browser — [Safari Technology Pre {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_safari.py#L26" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md b/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md index 4f19d559e64f..b1679f9a0d6a 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md @@ -96,7 +96,7 @@ To use this version in your code: {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_safari.py#L26" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md index fa20eaf45597..d64d96d26ea4 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md @@ -96,7 +96,7 @@ To use this version in your code: {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_safari.py#L26" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md index ceea608372d3..1b1f6dc5da95 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md @@ -100,7 +100,7 @@ Apple 提供了其浏览器的开发版本 — [Safari Technology Preview](https {{< badge-code >}} {{< /tab >}} {{% tab header="Python" %}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_safari.py#L26" >}} {{% /tab %}} {{< tab header="CSharp" >}} {{< badge-code >}}