- WebTester was written for Selenium RC (aka Selenium 1) using an old protocol
- Beach-Parasol is written for Selenium Webdriver (aka Selenium 2) using the JSONWire Protocol and can be seen as a replacement for WebTester
- a fresh Mozilla Firefox was already installed on my machine
- Parasol still requires old Pharo 1.4, so even when I prefer Pharo 2.0 I downloaded it again
- I installed the current version selenium-server-standalone-2.31.0.jar of Selenium which can be found here
java -jar C:\selenium\selenium-server-standalone-2.31.0.jar -Dwebdriver.firefox.bin="C:\Program Files (x86)\Mozilla Firefox\firefox.exe" pause
Now in Pharo 1.4 image I installed Parasol using:
Gofer new url: 'http://ss3.gemstone.com/ss/Parasol'; package: 'ConfigurationOfParasol'; load. ((Smalltalk at: #ConfigurationOfParasol) project version: #development) load: 'dev'. WAKomEncoded startOn: 8080. Deprecation raiseWarning: false; showWarning: false.
Took a while since it loads Seaside. After anything is set up I can easily script the webdriver/Firefox from a Smalltalk workspace. Here is an example:
"Start the driver and open wikipedia" driver := BPRemoteWebDriver new. driver get: 'http://en.wikipedia.org/'.
"click on search"
(driver findElementByID: 'searchInput') click.
"enter some text"
driver getKeyboard sendKeys: ('Pharo' , (String with: BPKeys return)).
"query some text from the webpage" Transcript show: ((driver findElementByID: 'mw-content-text') findElementByTagName: 'p') getText. driver quit
So it is easy to write SUnit tests or automate some tasks you do on the web using Pharo. With the help of F12 in the webbrowser it is easy to find out about element ids, ... in HTML, so one can easily navigate through pages.
I worked with Selenium in Java and other languages already in the past. Parasol is not as comfortable as with the Selenium IDE recorder - but it works and using Smalltalk usually makes one more productive.
It is nice to see that I can now also control the Firefox browser to automate things and write webtests directly from within Pharo Smalltalk.