diff --git a/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs b/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs index 1a387cb13ba6..618e5361ecce 100644 --- a/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs +++ b/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs @@ -1,9 +1,57 @@ 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/browsers/chrome.en.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md index da6316b5e649..2508b7391598 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" >}} 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.en.md b/website_and_docs/content/documentation/webdriver/drivers/options.en.md index 3bd3b64f5795..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,24 +119,8 @@ 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" >}} -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">}} @@ -176,24 +160,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">}} @@ -232,24 +200,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.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">}}