Selenium IDE is an integrated development environment for Selenium
tests. It is implemented as a Firefox extension, and allows you to
record, edit, and debug tests. Selenium IDE includes the entire
Selenium Core, allowing you to easily and quickly record and play back
tests in the actual environment that they will run. Selenium IDE is not only recording tool: it is a complete IDE.
You can choose to use its recording capability, or you may edit your
scripts by hand. With autocomplete support and the ability to move
commands around quickly, Selenium IDE is the ideal environment for
creating Selenium tests no matter what style of tests you prefer.
Selenium IDE Flow Control - plugin do Selenium IDE pozwalający na tworzenie pętli goto, gotoIf i while
Przykładowy skrypt:
<tr>
<td>label</td>
<td>program_start</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>http://www.adres.strony.com.pl</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>javascript{5000+Math.random()*10000}</td>
<td></td>
</tr>
<tr>
<td>storeElementPresent</td>
<td>//a[@class="klasa_linka"]</td>
<td>jest_link</td>
</tr>
<tr>
<td>gotoIf</td>
<td>storedVars['jest_link'] == false</td>
<td>program_start</td>
</tr>
<tr>
<td>storeAttribute</td>
<td>//a[@class="klasa_linka"]@href</td>
<td>adres</td>
</tr>
<tr>
<td>echo</td>
<td>javascript{storedVars['adres']}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>javascript{storedVars['adres']}</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>javascript{35000+Math.random()*10000}</td>
<td></td>
</tr>
<tr>
<td>goto</td>
<td>program_start</td>
<td></td>
</tr>
Powyższy test otwiera stronkę, czeka od 5-15 sek a następnie szuka na niej linka zawierającego odpowiednią definicję klasy. Jeżeli link nie został znaleziony to wracamy na początek testu. Jeżeli link został znaleziony to otwieramy link i czekamy od 35-45 sek a następnie wracamy na początek programu.
Przyznam się, że zapisałem się kiedyś do jedej ze stronek na których użytkownicy dostają pieniądze za oglądanie stronek przez co najmniej 30 sek. Powyższy skrypt sam znajdował linki i otwierał je więc teoretycznie wystarczyło odpalić Selenium IDE, wystartować skrypt i czekać :]