Forum Discussion

pmakkena's avatar
pmakkena
Occasional Contributor
10 years ago

can some help me with xpath for 2 button .

The 2 sample html are 1) <input id="btnMoveRight" class="arrowBtn" type="button" value=" > " onclick="moveRight('Funds')"> 2)<input id="btnMoveRight" class="arrowBtn" type="button" value=" > " oncl...
  • TanyaYatskovska's avatar
    10 years ago

    Hi Prashant,

    IDs of both buttons are the same. Good approach is to assign different names for different objects.

    Anyway, I noticed that the moveRight function passes different parameters in different objects. You can try using the following XPath expressions:

    //*[@id="btnMoveRight" and contains(@onclick, "Funds")]
    
    //*[@id="btnMoveRight" and contains(@onclick, "Reports")]