This document discusses using Selenium to test Smalltalk-AJAX/SJAX web applications. It covers the differences between Selenium Remote Control and Selenium WebDriver, and how WebDriver provides a more object-oriented API. It also describes how the Selenium libraries have been ported to various Smalltalk dialects, including VisualWorks and Squeak, to allow testing web applications directly from Smalltalk.
6. Selenium Remote Control
Selenium WebDriver
Proxy server + Javascript injection
Native browser automation support (plugin, ...)
✔
✘
maandag 9 september 13
7. Selenium Remote Control
Selenium WebDriver
selenium.click("id=the_link");
WebElement element = driver.findElement(By.id("the_link"));
element.click();
<a
id="the_link"
style="display: none"
href="http://www.wikipedia.org">
Invisible Link to Wikipedia</a>
maandag 9 september 13
8. Selenium Remote Control
Selenium WebDriver
Selenium selenium = new DefaultSelenium("localhost", 4444,
"*firefox", "http://localhost/");
selenium.start();
selenium.open("/page.html");
selenium.click("id=the_link");
More Object-Oriented API
WebDriver driver = new FirefoxDriver();
driver.get("http://localhost/page.html");
WebElement element = driver.findElement(By.id("the_link"));
element.click();
maandag 9 september 13