Skip to content

Commit 49f4e58

Browse files
committed
Removed pytest
1 parent 32215dc commit 49f4e58

File tree

5 files changed

+60
-62
lines changed

5 files changed

+60
-62
lines changed

Diff for: examples/python/tests/elements/test_locators.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import pytest
21
from selenium import webdriver
32
from selenium.webdriver.common.by import By
43
from selenium.webdriver.support.relative_locator import locate_with
@@ -67,7 +66,6 @@ def test_find_by_xpath():
6766

6867
driver.quit()
6968

70-
pytest.mark.skip(reason='the examples are tied to an image with an example, on the site')
7169
def find_by_relative_locators():
7270
driver = webdriver.Chrome()
7371
driver.get("https://www.selenium.dev/")

Diff for: website_and_docs/content/documentation/webdriver/elements/locators.en.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ available in Selenium.
8181
driver.findElement(By.className("information"));
8282
{{< /tab >}}
8383
{{< tab header="Python" text=true >}}
84-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L10" >}}
84+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L9" >}}
8585
{{< /tab >}}
8686
{{< tab header="CSharp" >}}
8787
var driver = new ChromeDriver();
@@ -114,7 +114,7 @@ textbox, using css.
114114
driver.findElement(By.cssSelector("#fname"));
115115
{{< /tab >}}
116116
{{< tab header="Python" text=true >}}
117-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L18" >}}
117+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L17" >}}
118118
{{< /tab >}}
119119
{{< tab header="CSharp" >}}
120120
var driver = new ChromeDriver();
@@ -145,7 +145,7 @@ We will identify the Last Name field using it.
145145
driver.findElement(By.id("lname"));
146146
{{< /tab >}}
147147
{{< tab header="Python" text=true >}}
148-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L26" >}}
148+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L25" >}}
149149
{{< /tab >}}
150150
{{< tab header="CSharp" >}}
151151
var driver = new ChromeDriver();
@@ -177,7 +177,7 @@ We will identify the Newsletter checkbox using it.
177177
driver.findElement(By.name("newsletter"));
178178
{{< /tab >}}
179179
{{< tab header="Python" text=true >}}
180-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L34" >}}
180+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L33" >}}
181181
{{< /tab >}}
182182
{{< tab header="CSharp" >}}
183183
var driver = new ChromeDriver();
@@ -207,7 +207,7 @@ In the HTML snippet shared, we have a link available, let's see how will we loca
207207
driver.findElement(By.linkText("Selenium Official Page"));
208208
{{< /tab >}}
209209
{{< tab header="Python" text=true >}}
210-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L42" >}}
210+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L41" >}}
211211
{{< /tab >}}
212212
{{< tab header="CSharp" >}}
213213
var driver = new ChromeDriver();
@@ -238,7 +238,7 @@ In the HTML snippet shared, we have a link available, lets see how will we locat
238238
driver.findElement(By.partialLinkText("Official Page"));
239239
{{< /tab >}}
240240
{{< tab header="Python" text=true >}}
241-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L50" >}}
241+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L49" >}}
242242
{{< /tab >}}
243243
{{< tab header="CSharp" >}}
244244
var driver = new ChromeDriver();
@@ -267,7 +267,7 @@ From the above HTML snippet shared, lets identify the link, using its html tag "
267267
driver.findElement(By.tagName("a"));
268268
{{< /tab >}}
269269
{{< tab header="Python" text=true >}}
270-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L58" >}}
270+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L57" >}}
271271
{{< /tab >}}
272272
{{< tab header="CSharp" >}}
273273
var driver = new ChromeDriver();
@@ -302,7 +302,7 @@ first name text box. Let us create locator for female radio button using xpath.
302302
driver.findElement(By.xpath("//input[@value='f']"));
303303
{{< /tab >}}
304304
{{< tab header="Python" text=true >}}
305-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L66" >}}
305+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L65" >}}
306306
{{< /tab >}}
307307
{{< tab header="CSharp" >}}
308308
var driver = new ChromeDriver();
@@ -338,7 +338,7 @@ others it's as simple as setting a parameter in the FindElement function
338338
driver.findElement(By.className("information"));
339339
{{< /tab >}}
340340
{{< tab header="Python" text=true >}}
341-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L10" >}}
341+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L9" >}}
342342
{{< /tab >}}
343343
{{< tab header="CSharp" >}}
344344
var driver = new ChromeDriver();
@@ -445,7 +445,7 @@ we can locate the text field element using the fact that it is an "input" elemen
445445
By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
446446
{{< /tab >}}
447447
{{< tab header="Python" text=true >}}
448-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L75" >}}
448+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L73" >}}
449449
{{< /tab >}}
450450
{{< tab header="CSharp" >}}
451451
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
@@ -472,7 +472,7 @@ we can locate the text field element using the fact that it is an "input" elemen
472472
By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
473473
{{< /tab >}}
474474
{{< tab header="Python" text=true >}}
475-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L77" >}}
475+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L75" >}}
476476
{{< /tab >}}
477477
{{< tab header="CSharp" >}}
478478
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
@@ -499,7 +499,7 @@ we can locate the cancel button element using the fact that it is a "button" ele
499499
By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
500500
{{< /tab >}}
501501
{{< tab header="Python" text=true >}}
502-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L79" >}}
502+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L77" >}}
503503
{{< /tab >}}
504504
{{< tab header="CSharp" >}}
505505
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
@@ -526,7 +526,7 @@ we can locate the submit button element using the fact that it is a "button" ele
526526
By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
527527
{{< /tab >}}
528528
{{< tab header="Python" text=true >}}
529-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L81" >}}
529+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L79" >}}
530530
{{< /tab >}}
531531
{{< tab header="CSharp" >}}
532532
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
@@ -555,7 +555,7 @@ but its associated [input label element](https://developer.mozilla.org/en-US/doc
555555
By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
556556
{{< /tab >}}
557557
{{< tab header="Python" text=true >}}
558-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L83" >}}
558+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L81" >}}
559559
{{< /tab >}}
560560
{{< tab header="CSharp" >}}
561561
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
@@ -581,7 +581,7 @@ You can also chain locators if needed. Sometimes the element is most easily iden
581581
By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
582582
{{< /tab >}}
583583
{{< tab header="Python" text=true >}}
584-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L85" >}}
584+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L83" >}}
585585
{{< /tab >}}
586586
{{< tab header="CSharp" >}}
587587
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));

Diff for: website_and_docs/content/documentation/webdriver/elements/locators.ja.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ available in Selenium.
7979
driver.findElement(By.className("information"));
8080
{{< /tab >}}
8181
{{< tab header="Python" text=true >}}
82-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L10" >}}
82+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L9" >}}
8383
{{< /tab >}}
8484
{{< tab header="CSharp" >}}
8585
var driver = new ChromeDriver();
@@ -111,7 +111,7 @@ textbox, using css.
111111
driver.findElement(By.cssSelector("#fname"));
112112
{{< /tab >}}
113113
{{< tab header="Python" text=true >}}
114-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L18" >}}
114+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L17" >}}
115115
{{< /tab >}}
116116
{{< tab header="CSharp" >}}
117117
var driver = new ChromeDriver();
@@ -141,7 +141,7 @@ We will identify the Last Name field using it.
141141
driver.findElement(By.id("lname"));
142142
{{< /tab >}}
143143
{{< tab header="Python" text=true >}}
144-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L26" >}}
144+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L25" >}}
145145
{{< /tab >}}
146146
{{< tab header="CSharp" >}}
147147
var driver = new ChromeDriver();
@@ -172,7 +172,7 @@ We will identify the Newsletter checkbox using it.
172172
driver.findElement(By.name("newsletter"));
173173
{{< /tab >}}
174174
{{< tab header="Python" text=true >}}
175-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L34" >}}
175+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L33" >}}
176176
{{< /tab >}}
177177
{{< tab header="CSharp" >}}
178178
var driver = new ChromeDriver();
@@ -201,7 +201,7 @@ In the HTML snippet shared, we have a link available, lets see how will we locat
201201
driver.findElement(By.linkText("Selenium Official Page"));
202202
{{< /tab >}}
203203
{{< tab header="Python" text=true >}}
204-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L42" >}}
204+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L41" >}}
205205
{{< /tab >}}
206206
{{< tab header="CSharp" >}}
207207
var driver = new ChromeDriver();
@@ -231,7 +231,7 @@ In the HTML snippet shared, we have a link available, lets see how will we locat
231231
driver.findElement(By.partialLinkText("Official Page"));
232232
{{< /tab >}}
233233
{{< tab header="Python" text=true >}}
234-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L50" >}}
234+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L49" >}}
235235
{{< /tab >}}
236236
{{< tab header="CSharp" >}}
237237
var driver = new ChromeDriver();
@@ -259,7 +259,7 @@ From the above HTML snippet shared, lets identify the link, using its html tag "
259259
driver.findElement(By.tagName("a"));
260260
{{< /tab >}}
261261
{{< tab header="Python" text=true >}}
262-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L58" >}}
262+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L57" >}}
263263
{{< /tab >}}
264264
{{< tab header="CSharp" >}}
265265
var driver = new ChromeDriver();
@@ -293,7 +293,7 @@ first name text box. Let us create locator for female radio button using xpath.
293293
driver.findElement(By.xpath("//input[@value='f']"));
294294
{{< /tab >}}
295295
{{< tab header="Python" text=true >}}
296-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L66" >}}
296+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L65" >}}
297297
{{< /tab >}}
298298
{{< tab header="CSharp" >}}
299299
var driver = new ChromeDriver();
@@ -328,7 +328,7 @@ others it's as simple as setting a parameter in the FindElement function
328328
driver.findElement(By.className("information"));
329329
{{< /tab >}}
330330
{{< tab header="Python" text=true >}}
331-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L10" >}}
331+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L9" >}}
332332
{{< /tab >}}
333333
{{< tab header="CSharp" >}}
334334
var driver = new ChromeDriver();
@@ -436,7 +436,7 @@ we can locate the text field element using the fact that it is an "input" elemen
436436
By emailLocator = RelativeLocator.with(By.tagName("input")).above(By.id("password"));
437437
{{< /tab >}}
438438
{{< tab header="Python" text=true >}}
439-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L75" >}}
439+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L73" >}}
440440
{{< /tab >}}
441441
{{< tab header="CSharp" >}}
442442
var emailLocator = RelativeBy.WithLocator(By.TagName("input")).Above(By.Id("password"));
@@ -462,7 +462,7 @@ we can locate the text field element using the fact that it is an "input" elemen
462462
By passwordLocator = RelativeLocator.with(By.tagName("input")).below(By.id("email"));
463463
{{< /tab >}}
464464
{{< tab header="Python" text=true >}}
465-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L77" >}}
465+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L75" >}}
466466
{{< /tab >}}
467467
{{< tab header="CSharp" >}}
468468
var passwordLocator = RelativeBy.WithLocator(By.TagName("input")).Below(By.Id("email"));
@@ -488,7 +488,7 @@ we can locate the cancel button element using the fact that it is a "button" ele
488488
By cancelLocator = RelativeLocator.with(By.tagName("button")).toLeftOf(By.id("submit"));
489489
{{< /tab >}}
490490
{{< tab header="Python" text=true >}}
491-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L79" >}}
491+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L77" >}}
492492
{{< /tab >}}
493493
{{< tab header="CSharp" >}}
494494
var cancelLocator = RelativeBy.WithLocator(By.tagName("button")).LeftOf(By.Id("submit"));
@@ -514,7 +514,7 @@ we can locate the submit button element using the fact that it is a "button" ele
514514
By submitLocator = RelativeLocator.with(By.tagName("button")).toRightOf(By.id("cancel"));
515515
{{< /tab >}}
516516
{{< tab header="Python" text=true >}}
517-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L81" >}}
517+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L79" >}}
518518
{{< /tab >}}
519519
{{< tab header="CSharp" >}}
520520
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).RightOf(By.Id("cancel"));
@@ -542,7 +542,7 @@ but its associated [input label element](https://developer.mozilla.org/en-US/doc
542542
By emailLocator = RelativeLocator.with(By.tagName("input")).near(By.id("lbl-email"));
543543
{{< /tab >}}
544544
{{< tab header="Python" text=true >}}
545-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L83" >}}
545+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L81" >}}
546546
{{< /tab >}}
547547
{{< tab header="CSharp" >}}
548548
var emailLocator = RelativeBy.WithLocator(By.tagName("input")).Near(By.Id("lbl-email"));
@@ -567,7 +567,7 @@ You can also chain locators if needed. Sometimes the element is most easily iden
567567
By submitLocator = RelativeLocator.with(By.tagName("button")).below(By.id("email")).toRightOf(By.id("cancel"));
568568
{{< /tab >}}
569569
{{< tab header="Python" text=true >}}
570-
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L85" >}}
570+
{{< gh-codeblock path="examples/python/tests/elements/test_locators.py#L83" >}}
571571
{{< /tab >}}
572572
{{< tab header="CSharp" >}}
573573
var submitLocator = RelativeBy.WithLocator(By.tagName("button")).Below(By.Id("email")).RightOf(By.Id("cancel"));

0 commit comments

Comments
 (0)