diff --git a/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs b/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs new file mode 100644 index 000000000000..4bc479a025cd --- /dev/null +++ b/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs @@ -0,0 +1,81 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using OpenQA.Selenium; +using OpenQA.Selenium.Chrome; + +namespace SeleniumDocumentation.SeleniumInteractions +{ + [TestClass] + public class PrintOptionsTest + { + [TestMethod] + public void TestOrientation() + { + IWebDriver driver = new ChromeDriver(); + driver.Navigate().GoToUrl("https://selenium.dev"); + PrintOptions printOptions = new PrintOptions(); + printOptions.Orientation = PrintOrientation.Landscape; + PrintOrientation currentOrientation = printOptions.Orientation; + } + + [TestMethod] + public void TestRange() + { + IWebDriver driver = new ChromeDriver(); + driver.Navigate().GoToUrl("https://selenium.dev"); + PrintOptions printOptions = new PrintOptions(); + printOptions.AddPageRangeToPrint("1-3"); // add range of pages + printOptions.AddPageToPrint(5); // add individual page + } + + [TestMethod] + public void TestSize() + { + IWebDriver driver = new ChromeDriver(); + driver.Navigate().GoToUrl("https://www.selenium.dev/"); + PrintOptions printOptions = new PrintOptions(); + PrintOptions.PageSize currentDimensions = printOptions.PageDimensions; + } + + [TestMethod] + public void TestBackgrounds() + { + IWebDriver driver = new ChromeDriver(); + driver.Navigate().GoToUrl("https://www.selenium.dev/"); + PrintOptions printOptions = new PrintOptions(); + printOptions.OutputBackgroundImages = true; + bool currentBackgrounds = printOptions.OutputBackgroundImages; + } + + [TestMethod] + public void TestMargins() + { + IWebDriver driver = new ChromeDriver(); + driver.Navigate().GoToUrl("https://www.selenium.dev/"); + PrintOptions printOptions = new PrintOptions(); + PrintOptions.Margins currentMargins = printOptions.PageMargins; + } + + + [TestMethod] + public void TestScale() + { + IWebDriver driver = new ChromeDriver(); + driver.Navigate().GoToUrl("https://www.selenium.dev/"); + PrintOptions printOptions = new PrintOptions(); + printOptions.ScaleFactor = 0.5; + double currentScale = printOptions.ScaleFactor; + } + + [TestMethod] + public void TestShrinkToFit() + { + IWebDriver driver = new ChromeDriver(); + driver.Navigate().GoToUrl("https://www.selenium.dev/"); + PrintOptions printOptions = new PrintOptions(); + printOptions.ShrinkToFit = true; + bool currentShrinkToFit = printOptions.ShrinkToFit; + } + } + +} \ No newline at end of file diff --git a/website_and_docs/content/documentation/webdriver/interactions/print_page.en.md b/website_and_docs/content/documentation/webdriver/interactions/print_page.en.md index 2edfd0d697d9..149627d341a8 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/print_page.en.md +++ b/website_and_docs/content/documentation/webdriver/interactions/print_page.en.md @@ -19,11 +19,10 @@ Using the `getOrientation()` and `setOrientation()` methods, you can get/set the {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L12-L18" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L12-L19" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -44,11 +43,10 @@ Using the `getPageRanges()` and `setPageRanges()` methods, you can get/set the r {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L21-L27" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L22-L29" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -69,11 +67,10 @@ Using the `getPaperSize()` and `setPaperSize()` methods, you can get/set the pap {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L30-L36" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L32-L38" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -94,11 +91,10 @@ Using the `getPageMargin()` and `setPageMargin()` methods, you can set the margi {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L40-L49" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L51-L57" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -119,11 +115,10 @@ Using `getScale()` and `setScale()` methods, you can get/set the scale of the pa {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L52-L58" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L61-L68" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -144,11 +139,10 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether b {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L61-L67" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L41-L48" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -169,11 +163,10 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether t {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L70-L76" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L71-L78" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md b/website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md index f15d132ca30e..876ab368085a 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md +++ b/website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md @@ -19,11 +19,10 @@ Using the `getOrientation()` and `setOrientation()` methods, you can get/set the {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L12-L18" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L12-L19" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -44,11 +43,10 @@ Using the `getPageRanges()` and `setPageRanges()` methods, you can get/set the r {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L21-L27" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L22-L29" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -69,11 +67,10 @@ Using the `getPaperSize()` and `setPaperSize()` methods, you can get/set the pap {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L30-L36" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L32-L38" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -94,11 +91,10 @@ Using the `getPageMargin()` and `setPageMargin()` methods, you can set the margi {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L40-L49" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L51-L57" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -119,11 +115,10 @@ Using `getScale()` and `setScale()` methods, you can get/set the scale of the pa {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L52-L58" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L61-L68" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -144,11 +139,10 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether b {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L61-L67" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L41-L48" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -169,11 +163,10 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether t {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L70-L76" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L71-L78" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md b/website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md index 48bbccf8ed2b..2f1651ab532e 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md @@ -19,11 +19,10 @@ Using the `getOrientation()` and `setOrientation()` methods, you can get/set the {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L12-L18" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L12-L19" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -44,11 +43,10 @@ Using the `getPageRanges()` and `setPageRanges()` methods, you can get/set the r {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L21-L27" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L22-L29" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -69,11 +67,10 @@ Using the `getPaperSize()` and `setPaperSize()` methods, you can get/set the pap {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L30-L36" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L32-L38" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -94,11 +91,10 @@ Using the `getPageMargin()` and `setPageMargin()` methods, you can set the margi {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L40-L49" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L51-L57" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -119,11 +115,10 @@ Using `getScale()` and `setScale()` methods, you can get/set the scale of the pa {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L52-L58" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L61-L68" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -144,11 +139,10 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether b {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L61-L67" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L41-L48" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -169,11 +163,10 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether t {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L70-L76" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L71-L78" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} diff --git a/website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md b/website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md index b22dcd54a1ff..7d256c468b5c 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md @@ -19,11 +19,10 @@ Using the `getOrientation()` and `setOrientation()` methods, you can get/set the {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L12-L18" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L12-L19" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -44,11 +43,10 @@ Using the `getPageRanges()` and `setPageRanges()` methods, you can get/set the r {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L21-L27" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L22-L29" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -69,11 +67,10 @@ Using the `getPaperSize()` and `setPaperSize()` methods, you can get/set the pap {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L30-L36" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L32-L38" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -94,11 +91,10 @@ Using the `getPageMargin()` and `setPageMargin()` methods, you can set the margi {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L40-L49" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L51-L57" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -119,11 +115,10 @@ Using `getScale()` and `setScale()` methods, you can get/set the scale of the pa {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L52-L58" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L61-L68" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -144,11 +139,10 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether b {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L61-L67" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L41-L48" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}} @@ -169,11 +163,10 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether t {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L70-L76" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L71-L78" >}} {{< /tab >}} {{< tab header="Ruby" >}} {{< badge-code >}} -{{< badge-code >}} {{< /tab >}} {{< tab header="Python" >}} {{< badge-code >}}