[prev in list] [next in list] [prev in thread] [next in thread]
List: selenium-users
Subject: [Selenium-users] 30-second Selenium tutorial
From: JRHuggins () thoughtworks ! COM (Jason R Huggins)
Date: 2005-01-20 13:56:24
Message-ID: OFF99470C2.07371E4D-ON86256F8F.00752DCE-86256F8F.00795304 () thoughtworks ! com
[Download RAW message or body]
This is a very quick tutorial for those who have downloaded Selenium and
don't know what to do now...
Requirements for this tutorial:
A MS Windows workstation with network connectivity
The first thing that most people want to do is write a test that goes to
google.com, enters a query, and checks the results.
Assuming you downloaded/checked out/installed the Selenium source code to
C:\selenium
1) Open the file C:\selenium\code\javascript\TestRunner.hta
(You can open the file by double-clicking it or by right-clicking on it,
then selecting "Open" from the drop-down menu.)
2) Press the "All tests" button to watch the test run. It should run the
sample test successfully, and report zero failures and zero errors.
Where to go from here:
------------------------------------------------------------
To start changing things up, start by editing the example test file*. For
example, you may want to change the test from google.com to ebay.com.
--> C:\selenium\code\javascript\tests\GoogleTestSearch.html
If you want to write several tests and have them all run as a test suite,
edit the test suite file:
--> C:\selenium\code\javascript\tests\GoogleTestSuite.html
If you want TestRunner.hta to use a different test suite,
--> Edit line 33 of TestRunner.ta where it says:
SRC="./tests/GoogleTestSuite.html"
* I prefer to use Mozilla Composer to edit the file, since it is an HTML
file and Composer is a good HTML editor. However, it is just a plain HTML
file, so you edit it with any text editor you like.
If you're turned off by the fact that the tests are written in HTML, there
is some exciting stuff that we're working on in Selenium that will let you
write in your own preferred language. We call this new stuff "Driven"
Selenium, meaning you can drive any web browser with Selenium and your
favorite language (Java, .Net, Ruby, Python, Squeak, etc.). We call the
original, HTML-style, of writing tests "FIT-style", named after the
Framework for Integrated Tests (FIT) by Ward Cunningham. http://fit.c2.com
------------------------------------------------------------
Some useful links while writing tests:
1) The Selenium Reference - tells you what commands and verifications you
can use in your tests.
http://selenium.thoughtworks.com/seleniumReference.html
2) DOM Inspector - a very useful tool for inspecting the items on a web
page.
http://www.mozilla.org/projects/inspector/
http://books.mozdev.org/html/mozilla-app-b-sect-3.html
Showing how to use DOM inspector with Selenium is out of scope for this
tutorial... 'cause it takes more than 30 seconds. :- )
------------------------------------------------------------
Jason R. Huggins
Senior Developer - ThoughtWorks, Inc.
jrhuggins@thoughtworks.com
selenium.thoughtworks.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.public.thoughtworks.org/pipermail/selenium-users/attachments/20050120/fee197b8/attachment.htm
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic