How to write following sibling CSS/Xpath expression of username field?

379 Views Asked by At

HTML Code:

<form autocomplete="on" xpath="1">
  <div class="IiD88i _351hSN">
     <input  class="_2IX_2- VJZDxU" autocomplete="off" type="text" value="">
     <span class="_36T8XR"></span>

I can write this one : //input[@type='text']

enter image description here

But how to write it in "following sibling" CSS/xpath of the above code?

1

There are 1 best solutions below

1
On BEST ANSWER

If you want to fetch input node based on its sibling, try:

//label[.='Enter Email/Mobile number']/preceding-sibling::input