lundi 4 septembre 2017

Not able to identify custom checkbox element/Need relative xpath

I need relative xpath of the span element

<span class="icon"></span>

in selenium web driver.

<span class="custom-checkbox">
           <input id="personalization1" name="personalization-terms-check" class="personalization-terms-check required" value="accept" type="checkbox">
           <label for="personalization1">
               <span class="icon"></span>
               <span class="order-ready-text">yes! I double-checked all personalization entered above and i'm ready to order</span>
           </label>
</span>

need relative xpath of the span element

<span class="icon">

in above html and I am getting relative path:
//*[@id="main"]/div[3]/div[4]/div[2]/div/span/label/span[1].

Please help me to get an relative xpath or another way to make an click on the span

NOTE:

<span class="icon">

It can be multiple so I need unique relative xpath.

Aucun commentaire:

Enregistrer un commentaire