So I have rejoined the land of web automation after a long stint in desktop automation. Things have changed a bit. I have an <input inside a <label
<label class="checkbox-inline">
<input type="checkbox" name="entitled" data-bind="model">
Require approval from another user </label>
The input does not have a unique name (entitled is used by other label/input pairs on the page. the input is not exactly a child element of the label is it?
Any advice on how to address the input object of this page? Snapshot of the div containing this item and the others like it on the page attached. Thanks
lable tag with input inside it
lable tag with input inside it
- Attachments
-
- RolePermissions.rxsnp
- (288.77 KiB) Downloaded 16 times
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: lable tag with input inside it
Hi sstowe,
While the input element does not have any unique attributes, the parent label does have a unique innertext attribute.
Sample RxPath: (do not forget the leading and trailing white space)
Result:
I hope this helps!
Cheers,
Ned
While the input element does not have any unique attributes, the parent label does have a unique innertext attribute.
Sample RxPath: (do not forget the leading and trailing white space)
Code: Select all
//label[@innertext=' Approve Payments ']/input
I hope this helps!
Cheers,
Ned
Re: lable tag with input inside it
It really does. In addition to helping me with this specific question, the light bulb has been turned on to what I have been failing to understand about xpath for a little while. Pretty simple, but it was still alluding me. Thank you.