<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="generator"
 content="Docutils 0.3.6: http://docutils.sourceforge.net/">
  <title>Usage</title>
  <link rel="stylesheet" href="default.css" type="text/css">
</head>
<body>
<div class="document" id="selenium-reference">
<div class="section" id="test-tables">
<h2><a name="test-tables">Overview</a>&nbsp;</h2>
This document details how Selenium can be deployed to test or script
web
applications.<br>
</div>
<div class="section" id="command-reference">
<h2><a name="test-tables">Modes of Operation</a></h2>
Broadly speaking there are two modes of operation for Selenium
TestRunner and Driven<br>
<h3>TestRunner</h3>
<img alt="standalone pic" src="images/SmallStandalone.png"
 style="width: 266px; height: 113px;"><br>
<br>
The TestRunner mode of operation for Selenium is where its HTML &amp;
Javascript
and the test suite are deployed alongside the Application Under Test
(AUT) on a arbitrary web server. The test suite is coded as tables in a
HTML page for each test.<br>
<br>
See <a href="testrunner.html">test runner documentation</a> for more
information.<br>
<h3>Driven</h3>
<img alt="embedded pic" src="images/SmallEmbedded.png"
 style="width: 248px; height: 113px;">&nbsp; <br>
Driven Selenium is where the browser is under the the control of a
process on the same machine. That process is either a Java, .Net, Ruby
or Python
application and it is typically run in conjunction with a unit testing
framework like JUnit or NUnit. Also possible, is a console application
driving a browser interactively. <br>
<br>
The test script is one that would be recognisable to people adept with
unit test frameworks :<br>
<br>
&nbsp; public void testOKClick() {<br>
&nbsp;&nbsp;&nbsp; selenium.verifyTitle("First Page");<br>
&nbsp;&nbsp;&nbsp; selenium.open("/TestPage.html");<br>
&nbsp;&nbsp;&nbsp; selenium.click("OKButton");<br>
&nbsp;&nbsp;&nbsp; selenium.verifyTitle("Another Page");<br>
&nbsp; }<br>
<br>
The difference from normal unit testing is that as part of the startup,
three major things have to happen:<br>
<ol>
  <li>The test framework needs to publish a fresh copy of the AUT.
Selenium prefers to mount its own web server temporarily for the
purposes of testing.</li>
  <li>The test framework needs to publish the static Selenium's HTML
pages and Javascript in an apparent directory
on the same web server as (1).</li>
  <li>The test framework needs to open a browser instance and point it
to Selenium.html served in (2) above.</li>
</ol>
As each of these is a fairly time consuming operation, it is best that
all three of those happen in a one-time setup mode.&nbsp; As such, and
even though these leverage a unit testing framework, this is definately
for acceptance or functional rather than unit-testing.<br>
<br>
Some variations in the accesibility of the the webserver in question
for testing purposes or its scriptablity mean a more complex setup is
required:<br>
<br>
<img alt="Adjacent pic" src="images/SmallAdjacent.png"
 style="width: 239px; height: 229px;"><br>
<br>
See the <a href="driven.html">driven documentation</a> for more
information.<br>
<br>
</div>
</div>
</body>
</html>