I had recorded a test using selenium ide. According to the application’s requirement the test case should show error after executing it but it is executing in the selenium ide without showing error. So is it the application not working correct or am i not recording test correctly???
<?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://example.com/" />
<title>enerc2</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">enerc2</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>www.example.com/index/admin</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[@id='site-grid']/table/thead/tr[2]/td[2]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>css=thead > tr > #site-grid_c1 > a[title="Fuel Level after last fueling (Tank Capacity)"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=Site[Tank_Capacity]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=Site[Tank_Capacity]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=Site[Tank_Capacity]</td>
<td>123</td>
</tr>
<tr>
<td>click</td>
<td>name=Site[Tank_Capacity]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=Site[Tank_Capacity]</td>
<td><></td>
</tr>
<tr>
<td>click</td>
<td>name=Site[Tank_Capacity]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=Site[Tank_Capacity]</td>
<td><>+-</td>
</tr>
<tr>
<td>click</td>
<td>name=Site[Tank_Capacity]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>css=div.summary</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
If VALIDATION CODE isn’t present in the application, then, it is pretty obvious that you would not get any error on executing with a special character in the input.
you can try adding a simple alert, just add
javascript:alert('value of the input');and then check the condition.
Or if you are more into coding, try an
if(){}else{}It is definitely with your code, not the testing tool.