I downloaded the latest Selenium add-on for Firefox and I recorded the following a couple of clicks through a web site. When I saved the test case, it saved like so …
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="https://subdomain.domain.com/" />
<title>selenium_test_case</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">selenium_test_case</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/users/login</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>css=fieldset > div.input.email > #UserEmail</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>css=fieldset > div.input.email > #UserEmail</td>
<td>username</td>
</tr>
<tr>
<td>type</td>
<td>css=fieldset > div.input.password > #UserPassword</td>
<td>password</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>css=div.buttons > div.submit > input.button</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=eventId</td>
<td>AAA</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>css=input.button</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
Is there any way to insert logic into my recorded test case such that if I detect text on the screen after these steps …
<tr>
<td>type</td>
<td>id=eventId</td>
<td>AAA</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>css=input.button</td>
<td></td>
</tr>
these steps will repeat with a different value for “AAA” but if the text on the screen isn’t present, the test case will finish?