Selenium : Web Testing in Scheme
_Selenium : Web Testing in Scheme_
By Noel Welsh (noel at untyped dot com)
This manual documents Schematics version 1.0
Time-stamp: <2007-05-10 11:59:31 noel>
Keywords: _selenium_, _test_, _testing_, _web testing_,
This little example shows how to use Selenium to search on Google.
To start, you need to download the Selenium RC. I STRONGLY
suggest you download the latest Selenium RC nightly build,
at the time of writing 0.9.1-SNAPSHOT. You can get releases
Start the Selenium RC
java -jar selenium-server.jar
Now start up Dr/MzScheme and run the following:
(require (planet "selenium.ss" ("untyped" "selenium.plt" 1)))
(selenium-server "localhost" 4444 "*firefox" "http://www.google.com/")
(type "q" "Untyped")
"Untyped - Google Search"))
After a period of time you should see a Firefox browser come
up, visit the Google home page, and search for Untyped.
Predicates that can be used to test from exceptions thrown by the Selenium library.
> (selenium-server host port browser target)
selenium-server : string string string string -> selenium-server
Create a connection to the Selenium Remote Control
> (with-selenium server expr ...)
This macro executes the given expressions in a dynamic context where the current Selenium server is server.
The remainder of the commands are as documented in the online Selenium API