From 71b54702e97e1b6c290b375ce2cd9da2a7e7af60 Mon Sep 17 00:00:00 2001 From: ivonnegattringer Date: Tue, 3 Jun 2025 16:42:56 +0200 Subject: [PATCH 1/5] [dotnet] fix example lines in chrome documentation --- .../content/documentation/webdriver/browsers/chrome.en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 9f49ddf8f0b6..b80df696d866 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md @@ -118,7 +118,7 @@ Add an extension to options: {{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L40">}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L61" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L62-67" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L38" >}} @@ -175,7 +175,7 @@ Set excluded arguments on options: {{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L62" >}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L76" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L82" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L57" >}} From c291e3b0323d34f8e240b99da11480f0f7e04af5 Mon Sep 17 00:00:00 2001 From: ivonnegattringer Date: Tue, 3 Jun 2025 16:54:03 +0200 Subject: [PATCH 2/5] [dotnet] moved examples from option documentation into accoding cs file --- .../SeleniumDocs/Drivers/OptionsTest.cs | 42 +++++++++++++++ .../webdriver/drivers/options.en.md | 54 ++----------------- 2 files changed, 45 insertions(+), 51 deletions(-) diff --git a/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs b/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs index 1a387cb13ba6..208ee55b5ab8 100644 --- a/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs +++ b/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs @@ -1,9 +1,51 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; +using OpenQA.Selenium; +using OpenQA.Selenium.Chrome; namespace SeleniumDocs.Drivers { [TestClass] public class OptionsTest : BaseTest { + [TestMethod] + public void SetPageLoadStrategyNormal() + { + ChromeOptions chromeOptions = new ChromeOptions(); + chromeOptions.PageLoadStrategy = PageLoadStrategy.Normal; + IWebDriver driver = new ChromeDriver(chromeOptions); + try + { + // Navigate to Url + driver.Navigate().GoToUrl("https://selenium.dev"); + } + finally + { + driver.Quit(); + } + } + [TestMethod] + public void SetPageLoadStrategyEager() + { + var chromeOptions = new ChromeOptions(); + chromeOptions.PageLoadStrategy = PageLoadStrategy.Eager; + IWebDriver driver = new ChromeDriver(chromeOptions); + try { + driver.Navigate().GoToUrl("https://selenium.dev"); + } finally { + driver.Quit(); + } + } + [TestMethod] + public void SetPageLoadStrategyNone() + { + var chromeOptions = new ChromeOptions(); + chromeOptions.PageLoadStrategy = PageLoadStrategy.None; + IWebDriver driver = new ChromeDriver(chromeOptions); + try { + driver.Navigate().GoToUrl("https://selenium.dev"); + } finally { + driver.Quit(); + } + } } } \ No newline at end of file diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.en.md b/website_and_docs/content/documentation/webdriver/drivers/options.en.md index 3bd3b64f5795..e6dd72caf4eb 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.en.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.en.md @@ -120,23 +120,7 @@ event fire is returned. {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L7-9">}} {{< /tab >}} {{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -namespace pageLoadStrategy { - class pageLoadStrategy { - public static void Main(string[] args) { - var chromeOptions = new ChromeOptions(); - chromeOptions.PageLoadStrategy = PageLoadStrategy.Normal; - IWebDriver driver = new ChromeDriver(chromeOptions); - try { - driver.Navigate().GoToUrl("https://example.com"); - } finally { - driver.Quit(); - } - } - } -} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L13-14" >}} {{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L11-L12">}} @@ -177,23 +161,7 @@ event fire is returned. {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L15-L17">}} {{< /tab >}} {{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -namespace pageLoadStrategy { - class pageLoadStrategy { - public static void Main(string[] args) { - var chromeOptions = new ChromeOptions(); - chromeOptions.PageLoadStrategy = PageLoadStrategy.Eager; - IWebDriver driver = new ChromeDriver(chromeOptions); - try { - driver.Navigate().GoToUrl("https://example.com"); - } finally { - driver.Quit(); - } - } - } -} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L29-30" >}} {{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L20-L21">}} @@ -233,23 +201,7 @@ WebDriver only waits until the initial page is downloaded. {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L23-L25">}} {{< /tab >}} {{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -namespace pageLoadStrategy { - class pageLoadStrategy { - public static void Main(string[] args) { - var chromeOptions = new ChromeOptions(); - chromeOptions.PageLoadStrategy = PageLoadStrategy.None; - IWebDriver driver = new ChromeDriver(chromeOptions); - try { - driver.Navigate().GoToUrl("https://example.com"); - } finally { - driver.Quit(); - } - } - } -} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L41-42" >}} {{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L29-L30">}} From a26b93bbd2d4bde5efb7edaed3c35aec1eb5d54d Mon Sep 17 00:00:00 2001 From: ivonnegattringer Date: Tue, 17 Jun 2025 11:03:43 +0200 Subject: [PATCH 3/5] fixed text rendering --- .../content/documentation/webdriver/drivers/options.en.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.en.md b/website_and_docs/content/documentation/webdriver/drivers/options.en.md index e6dd72caf4eb..b46d7d214d8f 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.en.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.en.md @@ -119,7 +119,7 @@ event fire is returned. {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L7-9">}} {{< /tab >}} -{{< tab header="CSharp" >}} +{{< tab header="CSharp" text=true >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L13-14" >}} {{< /tab >}} {{< tab header="Ruby" text=true >}} @@ -160,7 +160,7 @@ event fire is returned. {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L15-L17">}} {{< /tab >}} -{{< tab header="CSharp" >}} +{{< tab header="CSharp" text=true >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L29-30" >}} {{< /tab >}} {{< tab header="Ruby" text=true >}} @@ -200,7 +200,7 @@ WebDriver only waits until the initial page is downloaded. {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L23-L25">}} {{< /tab >}} -{{< tab header="CSharp" >}} +{{< tab header="CSharp" text=true >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L41-42" >}} {{< /tab >}} {{< tab header="Ruby" text=true >}} From 50ad5524054cf7d17d9b9e9236547d3785bafa15 Mon Sep 17 00:00:00 2001 From: ivonnegattringer Date: Tue, 17 Jun 2025 17:03:52 +0200 Subject: [PATCH 4/5] updated to consistent formatting in OptionsTest.cs --- .../dotnet/SeleniumDocs/Drivers/OptionsTest.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs b/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs index 208ee55b5ab8..618e5361ecce 100644 --- a/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs +++ b/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs @@ -29,9 +29,12 @@ public void SetPageLoadStrategyEager() var chromeOptions = new ChromeOptions(); chromeOptions.PageLoadStrategy = PageLoadStrategy.Eager; IWebDriver driver = new ChromeDriver(chromeOptions); - try { + try + { driver.Navigate().GoToUrl("https://selenium.dev"); - } finally { + } + finally + { driver.Quit(); } } @@ -41,9 +44,12 @@ public void SetPageLoadStrategyNone() var chromeOptions = new ChromeOptions(); chromeOptions.PageLoadStrategy = PageLoadStrategy.None; IWebDriver driver = new ChromeDriver(chromeOptions); - try { + try + { driver.Navigate().GoToUrl("https://selenium.dev"); - } finally { + } + finally + { driver.Quit(); } } From 26f39a1c779f064e043159131c8e541c6e67b730 Mon Sep 17 00:00:00 2001 From: ivonnegattringer Date: Tue, 17 Jun 2025 17:18:40 +0200 Subject: [PATCH 5/5] [dotnet] updated documentation references for ChromeOptions and DriverOptions --- .../webdriver/browsers/chrome.ja.md | 4 +- .../webdriver/browsers/chrome.pt-br.md | 4 +- .../webdriver/browsers/chrome.zh-cn.md | 4 +- .../webdriver/drivers/options.ja.md | 60 ++---------------- .../webdriver/drivers/options.pt-br.md | 61 ++----------------- .../webdriver/drivers/options.zh-cn.md | 61 ++----------------- 6 files changed, 24 insertions(+), 170 deletions(-) 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 320c853c48a6..192f69d711fe 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md @@ -117,7 +117,7 @@ The `extensions` パラメータはcrxファイルを受け入れます。解凍 {{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L40">}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L61" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L62-67" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L36" >}} @@ -174,7 +174,7 @@ Chrome はさまざまな引数を追加します。 {{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L62" >}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L76" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L82" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L53" >}} 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 eff4166e3196..c490f626dc49 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 @@ -117,7 +117,7 @@ Adicionar uma extensão: {{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L40">}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L61" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L62-67">}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L34" >}} @@ -176,7 +176,7 @@ Exclua parametros: {{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L62" >}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L76" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L82" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L53" >}} 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 c2593bc06c31..6c246ad2cb74 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 @@ -117,7 +117,7 @@ Chrome浏览器的特有功能可以在谷歌的页面找到: [Capabilities & Ch {{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L40">}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L61" >}} +{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L62-67" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L34" >}} @@ -174,7 +174,7 @@ Chrome 添加了各种参数,如果你不希望添加某些参数,可以将 {{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L62" >}} {{% /tab %}} {{< tab header="CSharp" >}} -{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L76" >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L82" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< gh-codeblock path="/examples/ruby/spec/browsers/chrome_spec.rb#L53" >}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.ja.md b/website_and_docs/content/documentation/webdriver/drivers/options.ja.md index a46cf6bacc84..08bd6810f29d 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.ja.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.ja.md @@ -115,24 +115,8 @@ WebDriver は [load](https://developer.mozilla.org/ja/docs/Web/API/Window/load_e {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L7-9">}} {{< /tab >}} -{{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -namespace pageLoadStrategy { - class pageLoadStrategy { - public static void Main(string[] args) { - var chromeOptions = new ChromeOptions(); - chromeOptions.PageLoadStrategy = PageLoadStrategy.Normal; - IWebDriver driver = new ChromeDriver(chromeOptions); - try { - driver.Navigate().GoToUrl("https://example.com"); - } finally { - driver.Quit(); - } - } - } -} +{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L13-14" >}} {{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L11-L12">}} @@ -171,24 +155,8 @@ WebDriver は、[DOMContentLoaded](https://developer.mozilla.org/ja/docs/Web/API {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L15-L17">}} {{< /tab >}} -{{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -namespace pageLoadStrategy { - class pageLoadStrategy { - public static void Main(string[] args) { - var chromeOptions = new ChromeOptions(); - chromeOptions.PageLoadStrategy = PageLoadStrategy.Eager; - IWebDriver driver = new ChromeDriver(chromeOptions); - try { - driver.Navigate().GoToUrl("https://example.com"); - } finally { - driver.Quit(); - } - } - } -} +{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L29-30" >}} {{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L20-L21">}} @@ -226,24 +194,8 @@ WebDriver は、最初のページがダウンロードされるまで待機し {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L23-L25">}} {{< /tab >}} -{{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -namespace pageLoadStrategy { - class pageLoadStrategy { - public static void Main(string[] args) { - var chromeOptions = new ChromeOptions(); - chromeOptions.PageLoadStrategy = PageLoadStrategy.None; - IWebDriver driver = new ChromeDriver(chromeOptions); - try { - driver.Navigate().GoToUrl("https://example.com"); - } finally { - driver.Quit(); - } - } - } -} +{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L41-42" >}} {{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L29-L30">}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md b/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md index 574b772527ec..8f6d943358c3 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md @@ -131,25 +131,8 @@ event fire is returned. {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L7-9">}} -{{< /tab >}} -{{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -namespace pageLoadStrategy { - class pageLoadStrategy { - public static void Main(string[] args) { - var chromeOptions = new ChromeOptions(); - chromeOptions.PageLoadStrategy = PageLoadStrategy.Normal; - IWebDriver driver = new ChromeDriver(chromeOptions); - try { - driver.Navigate().GoToUrl("https://example.com"); - } finally { - driver.Quit(); - } - } - } -} +{{< /tab >}}{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L13-14" >}} {{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L11-L12">}} @@ -188,24 +171,8 @@ event fire is returned. {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L15-L17">}} {{< /tab >}} -{{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -namespace pageLoadStrategy { - class pageLoadStrategy { - public static void Main(string[] args) { - var chromeOptions = new ChromeOptions(); - chromeOptions.PageLoadStrategy = PageLoadStrategy.Eager; - IWebDriver driver = new ChromeDriver(chromeOptions); - try { - driver.Navigate().GoToUrl("https://example.com"); - } finally { - driver.Quit(); - } - } - } -} +{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L29-30" >}} {{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L20-L21">}} @@ -243,24 +210,8 @@ WebDriver only waits until the initial page is downloaded. {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L23-L25">}} {{< /tab >}} -{{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -namespace pageLoadStrategy { - class pageLoadStrategy { - public static void Main(string[] args) { - var chromeOptions = new ChromeOptions(); - chromeOptions.PageLoadStrategy = PageLoadStrategy.None; - IWebDriver driver = new ChromeDriver(chromeOptions); - try { - driver.Navigate().GoToUrl("https://example.com"); - } finally { - driver.Quit(); - } - } - } -} +{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L41-42" >}} {{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L29-L30">}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md b/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md index 035ae4883aae..01bae2762c1b 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md @@ -127,25 +127,8 @@ WebDriver一直等到 [load](https://developer.mozilla.org/en-US/docs/Web/API/Wi {{< /tab >}} {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L7-9">}} -{{< /tab >}} -{{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -namespace pageLoadStrategy { - class pageLoadStrategy { - public static void Main(string[] args) { - var chromeOptions = new ChromeOptions(); - chromeOptions.PageLoadStrategy = PageLoadStrategy.Normal; - IWebDriver driver = new ChromeDriver(chromeOptions); - try { - driver.Navigate().GoToUrl("https://example.com"); - } finally { - driver.Quit(); - } - } - } -} +{{< /tab >}}{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L13-14" >}} {{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L11-L12">}} @@ -184,24 +167,8 @@ WebDriver一直等到 [DOMContentLoaded](https://developer.mozilla.org/en-US/doc {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L15-L17">}} {{< /tab >}} -{{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -namespace pageLoadStrategy { - class pageLoadStrategy { - public static void Main(string[] args) { - var chromeOptions = new ChromeOptions(); - chromeOptions.PageLoadStrategy = PageLoadStrategy.Eager; - IWebDriver driver = new ChromeDriver(chromeOptions); - try { - driver.Navigate().GoToUrl("https://example.com"); - } finally { - driver.Quit(); - } - } - } -} +{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L29-30" >}} {{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L20-L21">}} @@ -239,24 +206,8 @@ WebDriver 仅等待初始页面已下载. {{< tab header="Python" text=true >}} {{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L23-L25">}} {{< /tab >}} -{{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -namespace pageLoadStrategy { - class pageLoadStrategy { - public static void Main(string[] args) { - var chromeOptions = new ChromeOptions(); - chromeOptions.PageLoadStrategy = PageLoadStrategy.None; - IWebDriver driver = new ChromeDriver(chromeOptions); - try { - driver.Navigate().GoToUrl("https://example.com"); - } finally { - driver.Quit(); - } - } - } -} +{{< tab header="CSharp" text=true >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L41-42" >}} {{< /tab >}} {{< tab header="Ruby" text=true >}} {{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L29-L30">}}