Skip to content

Commit 0d45fb9

Browse files
shbenzerharsha509
andauthored
Refined python example in Organizing and Executing Selenium Code (#1890)
* Removed erroneous remaining badge-code tags * refined first script python example --------- Co-authored-by: Sri Harsha <12621691+harsha509@users.noreply.github.com>
1 parent 3688b1e commit 0d45fb9

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

examples/python/tests/getting_started/using_selenium_tests.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33

44

55
def test_eight_components():
6-
driver = webdriver.Chrome()
7-
8-
driver.get("https://www.selenium.dev/selenium/web/web-form.html")
6+
driver = setup()
97

108
title = driver.title
119
assert title == "Web form"
@@ -22,7 +20,7 @@ def test_eight_components():
2220
value = message.text
2321
assert value == "Received!"
2422

25-
driver.quit()
23+
teardown(driver)
2624

2725
def setup():
2826
driver = webdriver.Chrome()

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ In your project's `package.json`, add requirement to `dependencies`:
143143
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/UsingSeleniumTest.java#L30-L31" >}}
144144
{{< /tab >}}
145145
{{% tab header="Python" %}}
146-
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L10-L11" >}}
146+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L8-L9" >}}
147147
{{< /tab >}}
148148
{{< tab header="CSharp" >}}
149149
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/UsingSeleniumTest.cs#L19-L20" >}}
@@ -177,11 +177,11 @@ In your project's `package.json`, add requirement to `dependencies`:
177177

178178
### Set Up
179179

180-
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L27-L30" >}}
180+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L25-L28" >}}
181181

182182
### Tear Down
183183

184-
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L32-33" >}}
184+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L30-31" >}}
185185

186186
{{% /tab %}}
187187
{{< tab header="CSharp" >}}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ In your project's `package.json`, add requirement to `dependencies`:
139139
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/UsingSeleniumTest.java#L30-L31" >}}
140140
{{< /tab >}}
141141
{{% tab header="Python" %}}
142-
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L10-L11" >}}
142+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L8-L9" >}}
143143
{{< /tab >}}
144144
{{< tab header="CSharp" >}}
145145
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/UsingSeleniumTest.cs#L19-L20" >}}
@@ -173,11 +173,11 @@ In your project's `package.json`, add requirement to `dependencies`:
173173

174174
### Set Up
175175

176-
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L27-L30" >}}
176+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L25-L28" >}}
177177

178178
### Tear Down
179179

180-
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L32-33" >}}
180+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L30-31" >}}
181181

182182
{{% /tab %}}
183183
{{< tab header="CSharp" >}}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ In your project's `package.json`, adicionar requisito às `dependências`:
139139
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/UsingSeleniumTest.java#L30-L31" >}}
140140
{{< /tab >}}
141141
{{% tab header="Python" %}}
142-
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L10-L11" >}}
142+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L8-L9" >}}
143143
{{< /tab >}}
144144
{{< tab header="CSharp" >}}
145145
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/UsingSeleniumTest.cs#L19-L20" >}}
@@ -173,11 +173,11 @@ In your project's `package.json`, adicionar requisito às `dependências`:
173173

174174
### Set Up
175175

176-
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L27-L30" >}}
176+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L25-L28" >}}
177177

178178
### Tear Down
179179

180-
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L32-33" >}}
180+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L30-31" >}}
181181

182182
{{% /tab %}}
183183
{{< tab header="CSharp" >}}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ In your project's `package.json`, add requirement to `dependencies`:
123123
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/UsingSeleniumTest.java#L30-L31" >}}
124124
{{< /tab >}}
125125
{{% tab header="Python" %}}
126-
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L10-L11" >}}
126+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L8-L9" >}}
127127
{{< /tab >}}
128128
{{< tab header="CSharp" >}}
129129
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/UsingSeleniumTest.cs#L19-L20" >}}
@@ -157,11 +157,11 @@ In your project's `package.json`, add requirement to `dependencies`:
157157

158158
### Set Up
159159

160-
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L27-L30" >}}
160+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L25-L28" >}}
161161

162162
### Tear Down
163163

164-
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L32-33" >}}
164+
{{< gh-codeblock path="examples/python/tests/getting_started/using_selenium_tests.py#L30-31" >}}
165165

166166
{{% /tab %}}
167167
{{< tab header="CSharp" >}}

0 commit comments

Comments
 (0)