Chcę moje selen badanie IDE przypadek uruchomić jak kroki poniżej, aby wybrać datę się automatycznie:Selen IDE: Jak wybrać następny wolny termin od datepicker
- datę Kliknij wyjazdu otworzyć datepicker
- począwszy od dnia aktualnie wybrany, loop Through datami aż do następnej dostępnej datę (w razie potrzeby przejść do następnego miesiąca lub roku, aby znaleźć następny wolny termin)
- Wybierz dostępną datę z datepicker
Czy ktoś może mi pokazać, że jestem nowy w selenach, jak to zrobić w powyższym przykładzie? Cały mój skrypt może w tej chwili otworzyć kalendarz.
Poniżej jest html udało mi się otrzymać, że mecze z powyższym zrzucie ekranu:
//Months drop down
<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">
<option value="2" selected="selected">Mar
</option><option value="3">Apr</option>
<option value="4">May</option>
<option value="5">Jun</option>
<option value="6">Jul</option>
<option value="7">Aug</option>
<option value="8">Sep</option>
<option value="9">Oct</option>
</select>
//Years drop down
<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">
<option value="2016" selected="selected">2016</option>
</select>
<table class="ui-datepicker-calendar">
//days labels
<thead>
<tr>
<th scope="col"><span title="Monday">Mo</span></th>
<th scope="col"><span title="Tuesday">Tu</span></th>
<th scope="col"><span title="Wednesday">We</span></th>
<th scope="col"><span title="Thursday">Th</span></th>
<th scope="col"><span title="Friday">Fr</span></th>
<th scope="col" class="ui-datepicker-week-end"><span title="Saturday">Sa</span></th>
<th scope="col" class="ui-datepicker-week-end"><span title="Sunday">Su</span></th>
</tr>
</thead>
<tbody>
//dates
<tr>
<td class=" ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"> </td>
<td class=" ui-datepicker-unselectable ui-state-disabled " title="No available flights on this date"><span class="ui-state-default">1</span></td>
<td class=" ui-datepicker-unselectable ui-state-disabled " title="No available flights on this date"><span class="ui-state-default">2</span></td>
<td class=" ui-datepicker-unselectable ui-state-disabled " title="No available flights on this date"><span class="ui-state-default">3</span></td>
<td class=" ui-datepicker-unselectable ui-state-disabled " title="No available flights on this date"><span class="ui-state-default">4</span></td>
<td class=" ui-datepicker-week-end ui-datepicker-unselectable ui-state-disabled " title="No available flights on this date"><span class="ui-state-default">5</span></td>
<td class=" ui-datepicker-week-end ui-datepicker-unselectable ui-state-disabled " title="No available flights on this date"><span class="ui-state-default">6</span></td></tr>
<tr>
<td class=" ui-datepicker-unselectable ui-state-disabled " title="No available flights on this date"><span class="ui-state-default">7</span></td>
<td class=" ui-datepicker-unselectable ui-state-disabled " title="No available flights on this date"><span class="ui-state-default">8</span></td>
...same process till last week of dates (bottom row of calendar in screenshot)
<tr>
<td class=" ui-datepicker-days-cell-over ui-datepicker-current-day" title="Click to see flights on this date" data-handler="selectDay" data-event="click" data-month="2" data-year="2016"><a class="ui-state-default ui-state-active" href="#">28</a></td>
<td class=" ui-datepicker-unselectable ui-state-disabled " title="No available flights on this date"><span class="ui-state-default">29</span></td>
<td class=" ui-datepicker-unselectable ui-state-disabled " title="No available flights on this date"><span class="ui-state-default">30</span></td>
<td class=" ui-datepicker-unselectable ui-state-disabled " title="No available flights on this date"><span class="ui-state-default">31</span></td>
<td class=" ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"> </td><td class=" ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"> </td>
<td class=" ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"> </td>
</tr>
</tbody>
</table>
[Proszę nie wpadać na Twoje pytania, zamieszczając nowe pytanie jak prośbą o uwagi] (http: // stackoverflow.com/questions/35241704/selecting-dates-from-a-datepicker-selenium-ide). Twoja nagroda to więcej niż potrzeba. – cybermonkey
Dlaczego używasz "Selenium IDE", a nie żadnych powiązań językowych selenu z webdriverem? Czy byłbyś w porządku z odpowiedzią opartą na python-selen? – alecxe
@alecxe To dlatego, że nasza firma używa głównie selenu ide. W rzeczywistości jestem maniakiem ręcznym, ale chcę nauczyć się trochę automatyzacji, dzięki czemu mogę testować znacznie szybciej. Jeśli Python-Selen pomoże selenowi ide, to tak, idź do niego. Praktycznie po prostu muszę znać polecenia, jak to zrobić. Wydaje mi się, że potrzebuję zrobić storeeval i zapętlić się przez kilka dni, aż znajdę następną dostępną datę, ale po prostu nie mogę wymyślić, jak to zrobić. – BruceyBandit