Skip to content

Commit

Permalink
[dotnet] Add page print example (#2057)[deploy site]
Browse files Browse the repository at this point in the history
* [.net] Add page print example

* PR feedback

---------

Co-authored-by: Sri Harsha <12621691+harsha509@users.noreply.github.com>
  • Loading branch information
RenderMichael and harsha509 authored Nov 12, 2024
1 parent 71df65a commit 188a509
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
11 changes: 10 additions & 1 deletion examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ public void TestShrinkToFit()
printOptions.ShrinkToFit = true;
bool currentShrinkToFit = printOptions.ShrinkToFit;
}
}

[TestMethod]
public void PrintWithPrintsPageTest()
{
WebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("https://www.selenium.dev/");
PrintOptions printOptions = new PrintOptions();
PrintDocument printedPage = driver.Print(printOptions);
Assert.IsTrue(printedPage.AsBase64EncodedString.StartsWith("JVBER"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable B
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintsPageTest.java#L35-L42" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L81-L88" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-implementation >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable B
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintsPageTest.java#L35-L42" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L81-L88" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-implementation >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable B
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintsPageTest.java#L35-L42" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L81-L88" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-implementation >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Selenium 通过其 PrintOptions、PrintsPage 和 browsingContext 类简化了这
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/PrintsPageTest.java#L35-L42" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-code >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L81-L88" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
{{< badge-implementation >}}
Expand Down

0 comments on commit 188a509

Please sign in to comment.