Hi Jason and Nate,
Nate, I've slightly updated the howto, the main
difference being that I incorrectly stated that
folder C:\selenium would be created upon extraction.
The folder C:\selenium-0.6.0\selenium is created and
you need to copy the selenium folder to C: for the
instructions to work (you may have figured that bit
out though so don't know if that helps). The other
thing that I found was that I have to be using a
browser on the same computer that the selenium folder
is located on for the testing to work. If this doesn't
solve your problem then I'm not sure what the issue
is, it would be good to know your browser and OS
version in case that is the problem. Like Jason said
this will ONLY work with the Internet Explorer
browser.
Jason,
Yes, I realised that this wasn't the ultimate
sollution and that the reverse proxy method would be
better and more in line with your project goals, but I
couldn't find any simple docs on how to get the proxy
method working. My resistance to the notion of hosting
the selenium test suite along with the web app is that
I might be opening up the web app to new security
issues that I'm not aware of, and I don't want the
public to be able to access my test suite. It took me
about five days to get selenium working for remote
testing and I think a lot of people after spending
that much time trying to get it to work will just
throw it in the too hard basket and not bother (I was
thaaaat close). Thats a real pitty because selenium is
an awesome application! BUT if they can get a working
test up and running in say 10 minutes then they can
quickly get a feel for what selenium is about.
I'd also previously checked out the selenium recorder
for firefox which is equally excellent. It doesn't
really allow you to save your own fully fledged suites
at the moment though and doesn't support
user-extensions.js without some hacking. I've written
to the mailing list for this though and these features
may be supported in the future. Here is an excerpt for
those interested:
Hi Vernon,
Thanks for the request. I don't have enough time to do
it right now,
but I'd like to implement them at some time.
If you want to use your user-extensions.js now, try
the following way:
Unzip the xpi file, unzip chrome/seleniumrecorder.jar
inside it, put
user-extensions.js to content/selenium directory, and
zip them back.
shinya
On 19/10/05, vernon viles wrote:
> Hi,
>
> Great extension. A couple of things that would make
> this even better would be the ability to load whole
> suites rather than just one test and the ability to
> get a user-extensions.js file to load into it. Does
> anyone know of a work around to get a
> user-extensions.js file recognized for the time
being?
>
Cheers
Vernon
--- Jason R Huggins <[EMAIL PROTECTED]>
wrote:
> Vernon Viles wrote on 10/21/2005 01:22:38 PM:
> > Here is a how to for people that are just starting
> > with selenium and want to get up and running
> quickly
> > with Internet Explorer.
>
> Vernon, thank you for (re)compiling this
> information.
>
> Like I said, in my other reply to Nate, though...
> Selenium's true goal is
> to be a cross-browser and cross-platform testing
> tool that lets you test
> web apps *as they are* using a real browser to test
> all the crazy DHTML
> and AJAX that you can throw at it. The HTA solution
> was a quick pragmatic
> hack if you're more interested in testing a remote
> site, and less
> concerned that it's Windows/IE only.
>
> -Jason
>
>
> _______________________________________________
> Selenium-users mailing list
> Selenium-users@lists.public.thoughtworks.org
>
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users
>
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
Last Modified: 12:13pm AEST 22/10/2005
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 running on windows XP and should also work with previous
versions. It will NOT work for testing with other browsers such as
mozilla firefox. This is not the ideal solution for you if you wish
to use other browsers for testing however it does allow you to
quickly see the capabilities of selenium and get stuck into the joys
of selenium with minimum of fuss. If you need to be able to test
with other web browsers as well then the best solution is probably
to use the Selenium Standalone Server reverse proxy method. At time
of writing I think this is still undergoing development however and
may be a little harder to initially install.
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-0.6.0
being created. In the top level of this directory you should see a
folder called "selenium" and a "docs" folder. The "selenium" folder
has everything in it that you need to run selenium. To make things
easier to follow just copy this folder to the root C: drive.
You should now have the following folder available on your C: drive:
C:\selenium
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 (and
ONLY 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
C:\selenium\tests\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 and it most likely means that security restrictions
are preventing you from successfully completing the test. If you
are testing with a browser version other than Internet Explorer 6
then maybe it no longer supports the ".hta" method of overcoming
security restrictions. If you are trying to access the
C:\selenium\MyTestRunner.hta from a remote computer then I don't
think this will work (it did not work for me). You need to be
testing from the same computer that your C:\selenium folder is
located at.
_______________________________________________
Selenium-users mailing list
Selenium-users@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users