@@ -138,8 +138,8 @@ textbox, using css.
138
138
{{< /tabpane >}}
139
139
140
140
## id
141
- We can use the ID attribute available with element in a web page to locate it.
142
- Generally the ID property should be unique for a element on the web page.
141
+ We can use the ID attribute of an element in a web page to locate it.
142
+ Generally the ID property should be unique for each element on the web page.
143
143
We will identify the Last Name field using it.
144
144
145
145
{{< tabpane langEqualsHeader=true >}}
@@ -172,8 +172,8 @@ We will identify the Last Name field using it.
172
172
173
173
174
174
## name
175
- We can use the NAME attribute available with element in a web page to locate it.
176
- Generally the NAME property should be unique for a element on the web page.
175
+ We can use the NAME attribute of an element in a web page to locate it.
176
+ Generally the NAME property should be unique for each element on the web page.
177
177
We will identify the Newsletter checkbox using it.
178
178
179
179
{{< tabpane langEqualsHeader=true >}}
@@ -207,7 +207,7 @@ We will identify the Newsletter checkbox using it.
207
207
## link text
208
208
If the element we want to locate is a link, we can use the link text locator
209
209
to identify it on the web page. The link text is the text displayed of the link.
210
- In the HTML snippet shared, we have a link available, lets see how will we locate it.
210
+ In the HTML snippet shared, we have a link available, let's see how will we locate it.
211
211
{{< tabpane langEqualsHeader=true >}}
212
212
{{< badge-examples >}}
213
213
{{< tab header="Java" >}}
@@ -341,16 +341,15 @@ first name text box. Let us create locator for female radio button using xpath.
341
341
## Relative Locators
342
342
343
343
** Selenium 4** introduces Relative Locators (previously
344
- called as _ Friendly Locators_ ). These locators are helpful when it is not easy to construct a locator for
344
+ called _ Friendly Locators_ ). These locators are helpful when it is not easy to construct a locator for
345
345
the desired element, but easy to describe spatially where the element is in relation to an element that does have
346
346
an easily constructed locator.
347
347
348
348
### How it works
349
349
350
350
Selenium uses the JavaScript function
351
351
[ getBoundingClientRect()] ( https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect )
352
- to determine the size and position of elements on the page, and can use this information to locate neighboring elements.
353
- find the relative elements.
352
+ to determine the size and position of elements on the page, and can use this information to locate neighboring elements.
354
353
355
354
Relative locator methods can take as the argument for the point of origin, either a previously located element reference,
356
355
or another locator. In these examples we'll be using locators only, but you could swap the locator in the final method with
0 commit comments