You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: docs/locators.md
+25-23
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
Using Locators
2
2
==============
3
3
4
-
The heart of end to end tests for webpages is finding DOM elements, interacting with them, and getting information about the current state of your application. This doc is an overview of how to locate and perform actions on DOM elements using Protractor.
4
+
The heart of end-to-end tests for webpages is finding DOM elements, interacting with them, and getting information about the current state of your application. This doc is an overview of how to locate and perform actions on DOM elements using Protractor.
5
5
6
6
Overview
7
7
--------
@@ -31,7 +31,7 @@ by.model('name')
31
31
by.binding('bindingname')
32
32
```
33
33
34
-
See a [list of Protractorspecific locators](/docs/api.md#api-protractorby).
34
+
For a list of Protractor-specific locators, see the [Protractor API: ProtractorBy](/docs/api.md#api-protractorby).
35
35
36
36
The locators are passed to the `element` function, as below:
37
37
@@ -54,7 +54,7 @@ element(by.css('my-css'));
54
54
Actions
55
55
-------
56
56
57
-
`element()` returns an ElementFinder object. The ElementFinder knows how to locate the DOM element using the locator you passed in as a parameter, but it has not actually done so yet. It will not contact the browser until an *action* method has been called.
57
+
The `element()` function returns an ElementFinder object. The ElementFinder knows how to locate the DOM element using the locator you passed in as a parameter, but it has not actually done so yet. It will not contact the browser until an *action* method has been called.
If you're familiar with WebDriver and WebElements, or you're just curious about the WebElements mentioned above, you may be wondering how they relate to ElementFinders.
@@ -163,7 +165,7 @@ var myButton = element(locator);
163
165
// No command has been sent to the browser yet.
164
166
```
165
167
166
-
Not until you call an action will the browser recieve any commands.
168
+
The browser will not receive any commands until you call an action.
167
169
168
170
```js
169
171
myButton.click();
@@ -174,5 +176,5 @@ ElementFinders also enable chaining to find subelements, such as `element(locato
174
176
175
177
All WebElement actions are wrapped in this way and available on the ElementFinder, in addition to a couple helper methods like `isPresent`.
176
178
177
-
You may always access the underlying WebElement using `element(locator).getWebElement()`, but you should not need to.
179
+
You can always access the underlying WebElement using `element(locator).getWebElement()`, but you should not need to.
0 commit comments