I have some form:
<div class="form_item--2c8WB">
<label>
<span class="label--2VxxL required--2nkmI">
"Text"
::after
</span>
<br>
<input type="password" name="newPasswordRepeat" autocomplete="new-password"
aria-invalid="true" aria-required="true"
aria-errormessage="vee_Text2">
</label>
<div class="errors--qVgtm">
<div>Text3</div>
</div>
</div>
I need to find path to Text3
text element, but exactly via input
section:
My way:
//input[@name='newPasswordRepeat']/../../div/div
The path is valid, but it is a long way to go and I want to use the follow-sibling
command. But I can't do that
For example, I'm trying to use the parent::
path:
//input[@name='newPasswordRepeat']/parent::
//input[@name='newPasswordRepeat']::parent::
//input[@name='newPasswordRepeat']::parent
//input[@name='newPasswordRepeat']/parent
//input[@name='newPasswordRepeat']/::parent
No one from this order not working, only
//input[@name='newPasswordRepeat']/..
Also I cannot use following-sibling
, but in this case another way (..
, .
) does not exist.
- How to correctly use
XPath
locators such asparent
,child
, following-sibling`?