4 ms·
Position of what? Why? Given following markup: <label for="foobar">Lorem ipsum</label> <input id="foobar"> Does write('omg', 'Lorem ipsum') wri
by hpaavola 13y ago
Position of what? Why?
Given following markup:
<label for="foobar">Lorem ipsum</label>
<input id="foobar">
Does
write('omg', 'Lorem ipsum')
write into #foobar? Just to clarify since position of those two elements might not be similar at all.
- mherrmann 13y agoIn that case, it will write into #foobar because it is smart enough to understand that <input/>s can be written to, and not labels. It works in a way that is very similar to us humans: If someone tells us to "write 'Michael' into the 'First Name' field", we look for the text "First Name" and then to the right and bottom of this text if there is a field that can be written to. So, position in this case is position on the page in (x, y) coordinates. If there are multiple occurrences (eg. two "First Name" fields) then Helium scans the page top-to-bottom, and closest to the element you last interacted with. Like a human would normally also do.