How to set ClickAndWait in Selenium IDE?

458 views Asked by At

I'm quite new with Selenium IDE.

I had this table below and I need to do ClickAndWait command for text "OPEN" based on the date in this instance let say "Mon" "15/06/15". As you can see the hyperlink is the OPEN/CLOSED text not in the date.

How do I do that?

enter image description here

<div class="flRoundContain">
 <div class="flInline">
  <span id="flDay_1507937390" class="flDay">
   Mon
  </span>
  <span id="flDate_1507937390" class="flDate">
     15/06/15
  </span>
  <span class="flStat flOpen">
   <a href="/members/bookings/open/event.open.action.xsp"></a>
  </span>
  <span class="flCat">
   All
  </span>
  <span class="flTime">
   All Day
  </span>
 </div>
</div>
<div class="flRoundContain">
    <div class="flInline">
        <span id="flDay_1507937391" class="flDay">
            Tue
        </span>
        <span id="flDate_1507937391" class="flDate">
                    16/06/15
        </span>
        <span class="flStat flOpen">
            <a href="/members/bookings/open/event.open.action.xsp?booking_event_id=1507937391&booking_resource_id=3000000"></a>
        </span>
        <span class="flCat">
            All
        </span>
        <span class="flTime">
            All Day
        </span>
    </div>
</div>

1

There are 1 answers

0
Jsmith2800 On BEST ANSWER

It is possible to do this, the best way however depends on whether the class changes when a link is set to closed and if you would need to click on closed links. The first option is:

<tr>
    <td>clickAndWait</td>
    <td>css=span:contains("15/06/15")+[class="flStat flOpen"]</td>
    <td></td>
</tr>

The + in the middle is what you were after, Basically this will find an element with the class "flStat flOpen" which follows a span element containing that specific date.

However, I'm assuming that if the link is closed the second part of the class would become "flClosed" If this is the case, you may want to use this instead

<tr>
    <td>clickAndWait</td>
    <td>css=span:contains("15/06/15")+[class^="flStat"]</td>
    <td></td>
</tr>

It does the same thing but only looks for the start of the class within the link, so it won't need amending if you need to use it on a closed link