From eeebb04403381e625778d2e7aa53e6aa18410757 Mon Sep 17 00:00:00 2001 From: Swastik Baranwal Date: Thu, 19 Dec 2024 23:19:25 +0530 Subject: [PATCH] [py] add more Internet Explorer example code (#2097)[deploy site] * [py] add more Internet Explorer example code * remove extra tag * fix and skip some code --- .../tests/browsers/test_internet_explorer.py | 80 ++++++++++++- .../browsers/internet_explorer.en.md | 101 ++++------------- .../browsers/internet_explorer.ja.md | 99 ++++------------ .../browsers/internet_explorer.pt-br.md | 106 ++++-------------- .../browsers/internet_explorer.zh-cn.md | 99 ++++------------ 5 files changed, 159 insertions(+), 326 deletions(-) diff --git a/examples/python/tests/browsers/test_internet_explorer.py b/examples/python/tests/browsers/test_internet_explorer.py index c3efd343cdf6..617222e4ab30 100644 --- a/examples/python/tests/browsers/test_internet_explorer.py +++ b/examples/python/tests/browsers/test_internet_explorer.py @@ -23,14 +23,82 @@ def test_basic_options_win11(): driver.quit() +@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows") +def test_file_upload_timeout(): + options = webdriver.IeOptions() + options.file_upload_timeout = 2000 + + driver = webdriver.Ie(options=options) + + 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.quit() + + +@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows") +def test_ignore_zoom_level(): + options = webdriver.IeOptions() + options.ignore_zoom_level = True + + driver = webdriver.Ie(options=options) + + 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.quit() + + +@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows") +def test_silent(): + service = webdriver.IeService(service_args=["--silent"]) + driver = webdriver.Ie(service=service) + + driver.quit() + + +@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows") +def test_cmd_options(): + options = webdriver.IeOptions() + options.add_argument("-private") + + driver = webdriver.Ie(options=options) + + driver.quit() + +# Skipping this as it fails on Windows because the value of registry setting in +# HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\TabProcGrowth must be '0' +@pytest.mark.skip +def test_force_create_process_api(): + options = webdriver.IeOptions() + options.force_create_process_api = True + + driver = webdriver.Ie(options=options) + + driver.quit() + @pytest.mark.skipif(sys.platform != "win32", reason="requires Windows") def test_log_to_file(log_path): - service = webdriver.IeService(log_output=log_path, log_level='INFO') + service = webdriver.IeService(log_output=log_path, log_level="INFO") driver = webdriver.Ie(service=service) - with open(log_path, 'r') as fp: + with open(log_path, "r") as fp: assert "Starting WebDriver server" in fp.readline() driver.quit() @@ -50,19 +118,19 @@ def test_log_to_stdout(capfd): @pytest.mark.skipif(sys.platform != "win32", reason="requires Windows") def test_log_level(log_path): - service = webdriver.IeService(log_output=log_path, log_level='WARN') + service = webdriver.IeService(log_output=log_path, log_level="WARN") driver = webdriver.Ie(service=service) - with open(log_path, 'r') as fp: - assert 'Started InternetExplorerDriver server (32-bit)' in fp.readline() + with open(log_path, "r") as fp: + assert "Started InternetExplorerDriver server (32-bit)" in fp.readline() driver.quit() @pytest.mark.skipif(sys.platform != "win32", reason="requires Windows") def test_supporting_files(temp_dir): - service = webdriver.IeService(service_args=["–extract-path="+temp_dir]) + service = webdriver.IeService(service_args=["–extract-path=" + temp_dir]) driver = webdriver.Ie(service=service) 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..3e16a5df84fd 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#L28-L29" >}} {{< /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#L38-L39" >}} {{< /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#L48-L49" >}} {{< /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#L58-L59" >}} {{< /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#L68-L71" >}} {{< /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#L78-L81" >}} {{< /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#L88-L91" >}} {{< /tab >}} {{< tab header="CSharp" >}} using System; @@ -575,8 +518,8 @@ To change the logging output to save to a specific file: Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\ Property value: String representing path to log file {{% /tab %}} -{{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L29" >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L98" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} @@ -605,9 +548,9 @@ To change the logging output to display in the console as STDOUT: Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} -{{< tab header="Python" >}} +{{< tab header="Python" text=true >}} {{< badge-version version="4.11" >}} -{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L41" >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L110" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} @@ -635,8 +578,8 @@ If logging output is specified, the default level is `FATAL` Property key: `InternetExplorerDriverService.IE_DRIVER_LOGLEVEL_PROPERTY`\ Property value: String representation of `InternetExplorerDriverLogLevel.DEBUG.toString()` enum {{% /tab %}} -{{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L53" >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L122" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L85" >}} @@ -662,9 +605,9 @@ Property value: String representation of `InternetExplorerDriverLogLevel.DEBUG.t Property key: `InternetExplorerDriverService.IE_DRIVER_EXTRACT_PATH_PROPERTY`\ Property value: String representing path to supporting files directory {{< /tab >}} -{{< tab header="Python" >}} +{{< tab header="Python" text=true >}} {{< badge-version version="4.11" >}} -{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L65" >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L134" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L98" >}} 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 f70ca13ed7ad..dbf57eb1b683 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#L28-L29" >}} {{< /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#L38-L39" >}} {{< /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#L48-L49" >}} {{< /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#L58-L59" >}} {{< /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#L68-L71" >}} {{< /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#L78-L81" >}} {{< /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#L88-L91" >}} {{< /tab >}} {{< tab header="CSharp" >}} using System; @@ -564,7 +507,7 @@ Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\ Property value: String representing path to log file {{% /tab %}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L29" >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L98" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} @@ -593,9 +536,9 @@ To change the logging output to display in the console as STDOUT: Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} -{{< tab header="Python" >}} +{{< tab header="Python" text=true >}} {{< badge-version version="4.11" >}} -{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L41" >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L110" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} @@ -623,8 +566,8 @@ If logging output is specified, the default level is `FATAL` Property key: `InternetExplorerDriverService.IE_DRIVER_LOGLEVEL_PROPERTY`\ Property value: String representation of `InternetExplorerDriverLogLevel.DEBUG.toString()` enum {{% /tab %}} -{{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L53" >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L122" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L85" >}} @@ -650,9 +593,9 @@ Property value: String representation of `InternetExplorerDriverLogLevel.DEBUG.t Property key: `InternetExplorerDriverService.IE_DRIVER_EXTRACT_PATH_PROPERTY`\ Property value: String representing path to supporting files directory {{< /tab >}} -{{< tab header="Python" >}} +{{< tab header="Python" text=true >}} {{< badge-version version="4.11" >}} -{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L65" >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L134" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L98" >}} 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..394da0b43efb 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#L28-L29" >}} {{< /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#L38-L39" >}} {{< /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#L48-L49" >}} {{< /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#L58-L59" >}} {{< /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#L68-L71" >}} {{< /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#L78-L81" >}} {{< /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#L88-L91" >}} {{< /tab >}} {{< tab header="CSharp" >}} using System; @@ -579,7 +515,7 @@ Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\ Property value: String representing path to log file {{% /tab %}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L29" >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L98" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} @@ -608,9 +544,9 @@ To change the logging output to display in the console as STDOUT: Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} -{{< tab header="Python" >}} +{{< tab header="Python" text=true >}} {{< badge-version version="4.11" >}} -{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L41" >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L110" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} @@ -638,8 +574,8 @@ If logging output is specified, the default level is `FATAL` Property key: `InternetExplorerDriverService.IE_DRIVER_LOGLEVEL_PROPERTY`\ Property value: String representation of `InternetExplorerDriverLogLevel.DEBUG.toString()` enum {{% /tab %}} -{{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L53" >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L122" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L85" >}} @@ -665,9 +601,9 @@ Property value: String representation of `InternetExplorerDriverLogLevel.DEBUG.t Property key: `InternetExplorerDriverService.IE_DRIVER_EXTRACT_PATH_PROPERTY`\ Property value: String representing path to supporting files directory {{< /tab >}} -{{< tab header="Python" >}} +{{< tab header="Python" text=true >}} {{< badge-version version="4.11" >}} -{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L65" >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L134" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L98" >}} 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..a4bf349756e1 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#L28-L29" >}} {{< /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#L38-L39" >}} {{< /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#L48-L49" >}} {{< /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#L58-L59" >}} {{< /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#L68-L71" >}} {{< /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#L78-L81" >}} {{< /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#L88-L91" >}} {{< /tab >}} {{< tab header="CSharp" >}} using System; @@ -574,7 +517,7 @@ Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\ Property value: String representing path to log file {{% /tab %}} {{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L29" >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L98" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} @@ -603,9 +546,9 @@ To change the logging output to display in the console as STDOUT: Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} -{{< tab header="Python" >}} +{{< tab header="Python" text=true >}} {{< badge-version version="4.11" >}} -{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L41" >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L110" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} @@ -633,8 +576,8 @@ If logging output is specified, the default level is `FATAL` Property key: `InternetExplorerDriverService.IE_DRIVER_LOGLEVEL_PROPERTY`\ Property value: String representation of `InternetExplorerDriverLogLevel.DEBUG.toString()` enum {{% /tab %}} -{{< tab header="Python" >}} -{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L53" >}} +{{< tab header="Python" text=true >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L122" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L85" >}} @@ -660,9 +603,9 @@ Property value: String representation of `InternetExplorerDriverLogLevel.DEBUG.t Property key: `InternetExplorerDriverService.IE_DRIVER_EXTRACT_PATH_PROPERTY`\ Property value: String representing path to supporting files directory {{< /tab >}} -{{< tab header="Python" >}} +{{< tab header="Python" text=true >}} {{< badge-version version="4.11" >}} -{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L65" >}} +{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L134" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L98" >}}