Hi All,

Here is a how to for people that are just starting
with selenium and want to get up and running quickly
with Internet Explorer. Feel free to modify this howto
in any way you see fit and use it any way you want. It
is mostly just a very simple compilation of what has
already been discussed in posts in one way or another.

Cheers

Vernon

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
Testing remote sites with Selenium and Internet Explorer 
- A quick HOW TO for dummies by Vernon Viles.

Most of the information for this how to was drawn from posts by
Jason R. Huggins and has simply been compiled into a guide to
get you up and running quickly.


What to expect by following these steps:

By following this how to you will be able to test remote websites
from a windows computer using the Internet Explorer(IE) web browser
and the test files that you create. This is very easy to set up and
overcomes the problem of not being able to test remote sites due to
the built in javascript security features of web browsers. It does
not require you to change any settings of your browser. This how to
only applies to testing with the Internet Explorer browser and may 
not work on future versions of IE. It has been tested to work with
IE 6 and should also work with previous versions.

Steps:

1. Download the latest release of selenium. This doesn't need to be
a special development version, just the normal zip file available
from the selenium website. At time of writing this file was located
here:

URL: http://selenium.thoughtworks.com/download.html
Filename: selenium-0.6.0.zip

2. Unzip the file to a place on the hard disk of the same windows
computer from which you wish to do testing from (this doesn't have
to be the same computer that hosts the website you wish to test).

For the purposes of this how to the zip file will be extracted to
the C: drive resulting in the folder C:\selenium being created.

3. Make a copy of the file named C:\selenium\TestRunner.hta and
name it MyTestRunner.hta (or any other appropriate name, but make
sure it has the extension .hta) An hta file is simply an html file,
but the extension ".hta" means that when navigated to, IE will not
apply the same strict security measures. This file defines the
layout of your testing gui and is what you point your browser to
in order to start testing.

4. Open your newly created MyTestRunner.hta file and edit the "src"
attribute of the line:

<iframe name="testSuiteFrame" id="testSuiteFrame" src="./tests/TestSuite.html">

so that it reads:

<iframe name="testSuiteFrame" id="testSuiteFrame" 
src="./tests/MyTestSuite.html">

(again you can choose a different name to MyTestSuite if you wish)


5. Go to  "C:\selenium\tests" and make a copy of the file named
TestSuite.html and name it MyTestSuite.html (or whatever name you
chose in step 4).

6. Open up the file MyTestSuite.html that you just created. This
file contains a table of the tests that are part of this suite.
Because you want to perform your own tests, edit this table to
contain the names of the tests you would like to perform and the
links to where those tests can be found. For this example we will
remove all entries in the table (EXCEPT the first title row) and
create the row:

<tr><td><a href="./Test1.html">Test1</a></td></tr>

so the table should now look like this:

...
<tbody>
        <tr><td><b>Test Suite</b></td></tr>
        <tr><td><a href="./Test1.html">Test1</a></td></tr>
</tbody>
...

7. You are now ready to create your first test. The easiest way
to start is to simply make a copy of the file named
GoogleTestSearch.html and call it Test1.html. This file represents
a single test that goes to the google website and performs a
search. Later you can come back and modify this test to go to the
web site you wish to test and perform your own tests. Please refer
to the Selenium homepage for a reference of the commands that you
can use.

8. Open up Internet Explorer and type the following into the
address bar:

C:\selenium\MyTestRunner.hta

This should open up a window with your test suite on the left, your
test in the middle and controls on the right. The lower frame holds
what the browser is navigating as the tests are performed. Click
"All" or "Selected" and the test will begin running. Thats it!
You've now performed your first test. Please note that this test
may pass or fail, you should see rows in the test table being
highlighted as the test is being performed and some or all rows
being coloured green for passes and some or all rows being coloured
pink for fails. If you do not see the test being performed and it
seems to get "stuck" on a row then something has gone wrong with
your set up.







_______________________________________________
Selenium-users mailing list
Selenium-users@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users

Reply via email to