Select form elements by associated label
See original GitHub issueGiven markup like:
<label for="your_name">Name</label>
<input id="your_name" />
… I should be able to fill in the input with ptor.findElement(protractor.By.label('Name')).sendKeys('My Name');
.
Is this currently possible?
Issue Analytics
- State:
- Created 10 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Using label elements to associate text labels with form controls
The objective of this technique is to use the label element to explicitly associate a form control with a label. A label is...
Read more >The Label element - HTML: HyperText Markup Language | MDN
To explicitly associate a <label> element with an <input> element, you first need to add the id attribute to the <input> element. Next,...
Read more >jQuery - select the associated label element of a input field
Show activity on this post. There are two ways to specify label for element: Setting label's "for" attribute to element's id. Placing element...
Read more >Form <input> elements must have labels | Axe Rules
Each form element must have a programmatically associated label element. The Algorithm (in simple terms). Ensures that every form element has a programmatically ......
Read more >HTML5 Forms: Label Element - Wufoo
The <label> can be associated with a form control either implicitly by placing the control element inside the label element, or explicitly by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In case anyone runs across this issue from Google and wants a simple solution using
by.addLocator
:This question helped a lot: http://stackoverflow.com/questions/34712495/protractor-select-a-form-element-using-label