HTML and CSS Reference
In-Depth Information
Code View:
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=UTF-8">
<title>elharo.com is a top search results for Elliotte</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">New Test</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>q</td>
<td>elliotte</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>btnG</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>www.elharo.com/</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
Obviously, Listing 2.6 is a real HTML document. You can open this with the Selenium IDE in Firefox and then run
the tests. Because the tests run directly inside the web browser, Selenium helps you find bugs that occur in only
one browser or another. Given the wide variation in browser CSS, HTML, and JavaScript support, this capability
is very useful. HtmlUnit, HttpUnit, JWebUnit, and the like use their own JavaScript engines that do not always
have the same behavior as the browsers' engines. Selenium uses the browsers themselves, not imitations of
them.
The IDE can also export the tests as C#, Java, Perl, Python, or Ruby code so that you can integrate Selenium
tests into other environments. This is especially important for test automation. Listing 2.8 shows the same test
as in Listing 2.7 , but this time in Ruby. However, this will not necessarily catch all the cross-browser bugs you'll
find by running the tests directly in the browser.
Listing 2.8. Automated Test That elharo.com Is in the Top Search Results for Elliotte
Search WWH ::




Custom Search