Skip to content

Commit 430587a

Browse files
shbenzerharsha509
andauthored
Added Python Example to PrintPage Documentation (#2009)[deploy site]
Co-authored-by: Sri Harsha <[email protected]>
1 parent 43aa019 commit 430587a

File tree

5 files changed

+27
-8
lines changed

5 files changed

+27
-8
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import pytest
2+
from selenium import webdriver
3+
from selenium.webdriver.common.print_page_options import PrintOptions
4+
5+
pytest.fixture()
6+
def driver():
7+
driver = webdriver.Chrome()
8+
yield driver
9+
driver.quit()
10+
11+
def test_prints_page(driver):
12+
driver.get("https://www.selenium.dev/")
13+
print_options = PrintOptions()
14+
pdf = driver.print_page(print_options)
15+
assert len(pdf) > 0

website_and_docs/content/documentation/webdriver/interactions/print_page.en.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,9 @@ Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable B
210210
{{< tab header="Ruby" >}}
211211
{{< badge-implementation >}}
212212
{{< /tab >}}
213-
{{< tab header="Python" >}}
214-
{{< badge-code >}}
213+
{{% tab header="Python" %}}
214+
**print_page()**
215+
{{< gh-codeblock path="examples/python/tests/interactions/test_prints_page.py#L11-L15" >}}
215216
{{< /tab >}}
216217
{{< tab header="JavaScript" >}}
217218
{{< badge-implementation >}}

website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,9 @@ Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable B
210210
{{< tab header="Ruby" >}}
211211
{{< badge-implementation >}}
212212
{{< /tab >}}
213-
{{< tab header="Python" >}}
214-
{{< badge-code >}}
213+
{{% tab header="Python" %}}
214+
**print_page()**
215+
{{< gh-codeblock path="examples/python/tests/interactions/test_prints_page.py#L11-L15" >}}
215216
{{< /tab >}}
216217
{{< tab header="JavaScript" >}}
217218
{{< badge-implementation >}}

website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,9 @@ Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable B
210210
{{< tab header="Ruby" >}}
211211
{{< badge-implementation >}}
212212
{{< /tab >}}
213-
{{< tab header="Python" >}}
214-
{{< badge-code >}}
213+
{{% tab header="Python" %}}
214+
**print_page()**
215+
{{< gh-codeblock path="examples/python/tests/interactions/test_prints_page.py#L11-L15" >}}
215216
{{< /tab >}}
216217
{{< tab header="JavaScript" >}}
217218
{{< badge-implementation >}}

website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,9 @@ Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable B
210210
{{< tab header="Ruby" >}}
211211
{{< badge-implementation >}}
212212
{{< /tab >}}
213-
{{< tab header="Python" >}}
214-
{{< badge-code >}}
213+
{{% tab header="Python" %}}
214+
**print_page()**
215+
{{< gh-codeblock path="examples/python/tests/interactions/test_prints_page.py#L11-L15" >}}
215216
{{< /tab >}}
216217
{{< tab header="JavaScript" >}}
217218
{{< badge-implementation >}}

0 commit comments

Comments
 (0)