skip to Main Content

I am using Browser plugin in Robot framework. I can’t get the xpath or css path for MPP Status. It should give PASS(or FAIL). I have tried a few options but no luck:

Get Text //*[contains(text(), 'MPP Status')]//following-sibling::span

Get Text //*[contains(text(), 'MPP Status')]//following-sibling::span equal 'PASS'

<table _ngcontent-c="" class="table table-vertical">
...    <tbody _ngcontent-c=""><tr _ngcontent-c="" class="ng-star-inserted">
...    <th _ngcontent-c="">MPP Status</th><td _ngcontent-c="">
...    <!---->
...    <!---->
...    <span _ngcontent-c="" class="label label-success ng-star-inserted"> PASS </span>
...    <!---->

2

Answers


  1. Working one should be

    //th[text()="MPP Status"]/following-sibling::td/span
    
    Login or Signup to reply.
  2. What do the ... and <!----> mean? Does that mean you removed markup to try to make it look simpler? If so you’re probably not showing the true hierarchy of the data.

    In html tables, th and td are usually in tr. Assuming that’s how your data is actually structured, try something like this…

    //tr[td[normalize-space()='MPP Status']]/following-sibling::tr//span[1]
    

    or

    //tr[td[normalize-space()='MPP Status']]/following::span[1]
    

    If neither of these work, we’ll need to see more of the structure to determine the correct xpath.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search