0
<span class="tm-button-icon__label taLabel _flex">
   <span class="tm-button-icon__text">
         Demo
   </span>
   <span class="tm-button-icon__inner-description taOption">
         Demo001
   </span>
</span>

Please help on how to click span based element?

  • 1
    Please, could you elaborate? E.g., show the error message and the code you are currently running; double check if the element is visible or inside an iframe. – João Farias Dec 13 '18 at 7:39
  • You can click span elements just like you click on any other element. Define a proper locator and use click() method against that. – Alexey R. Dec 13 '18 at 10:07
0

Try this xpath,it may work

//span[@class="tm-button-icon__label taLabel _flex"][@class='tm-button-icon__inner-description taOption']
  • Hi Ash, your post has been flagged as there's not much of an answer. Are you able to explain why might this work? Where did OP go wrong? What might OP do in future to avoid this? – trashpanda Dec 13 '18 at 11:49
0

Try the below xpath

//span[contains(text(),'Demo')]

//span[contains(text(),'Demo001')]

This will work.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.