Skip to content

Commit 85d7b19

Browse files
authored
Added Setup and Teardown Python Examples to Organizing and Executing Selenium Code (#1868)
* added setup and teardown python examples to Organizing and Executing Selenium Code * added setup and teardown to other languages [deploy site]
1 parent 26344b4 commit 85d7b19

File tree

5 files changed

+44
-0
lines changed

5 files changed

+44
-0
lines changed

examples/python/tests/getting_started/using_selenium_tests.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,11 @@ def test_eight_components():
2323
assert value == "Received!"
2424

2525
driver.quit()
26+
27+
def setup():
28+
driver = webdriver.Chrome()
29+
driver.get("https://www.selenium.dev/selenium/web/web-form.html")
30+
return driver
31+
32+
def teardown(driver):
33+
driver.quit()

website_and_docs/content/documentation/webdriver/getting_started/using_selenium.en.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,15 @@ In your project's `package.json`, add requirement to `dependencies`:
174174

175175
{{% /tab %}}
176176
{{% tab header="Python" %}}
177+
178+
### Set Up
179+
180+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L27-L30" >}}
181+
182+
### Tear Down
183+
184+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L32-33" >}}
185+
177186
{{< badge-code >}}
178187
{{% /tab %}}
179188
{{< tab header="CSharp" >}}

website_and_docs/content/documentation/webdriver/getting_started/using_selenium.ja.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ In your project's `package.json`, add requirement to `dependencies`:
170170

171171
{{% /tab %}}
172172
{{% tab header="Python" %}}
173+
174+
### Set Up
175+
176+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L27-L30" >}}
177+
178+
### Tear Down
179+
180+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L32-33" >}}
181+
173182
{{< badge-code >}}
174183
{{% /tab %}}
175184
{{< tab header="CSharp" >}}

website_and_docs/content/documentation/webdriver/getting_started/using_selenium.pt-br.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ In your project's `package.json`, adicionar requisito às `dependências`:
170170

171171
{{% /tab %}}
172172
{{% tab header="Python" %}}
173+
174+
### Set Up
175+
176+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L27-L30" >}}
177+
178+
### Tear Down
179+
180+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L32-33" >}}
181+
173182
{{< badge-code >}}
174183
{{% /tab %}}
175184
{{< tab header="CSharp" >}}

website_and_docs/content/documentation/webdriver/getting_started/using_selenium.zh-cn.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,15 @@ In your project's `package.json`, add requirement to `dependencies`:
154154

155155
{{% /tab %}}
156156
{{% tab header="Python" %}}
157+
158+
### Set Up
159+
160+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L27-L30" >}}
161+
162+
### Tear Down
163+
164+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L32-33" >}}
165+
157166
{{< badge-code >}}
158167
{{% /tab %}}
159168
{{< tab header="CSharp" >}}

0 commit comments

Comments
 (0)