In this book we have covered all the different aspects of Selenium 1, but with Selenium 2 coming out there are now different things we can do with the browser that were not possible with Selenium 1. Unfortunately we may have spent a considerable amount of time developing Selenium 1 tests, so converting them over to the new style of Selenium 2 may not be feasible.
With this in mind the Selenium Core development team have created the
WebDriverBackedSelenium
object that we can use. This allows us to create our tests with Selenium 1 syntax that we know but have some of the benefits of WebDriver.
String baseUrl = "http://book.theautomatedtester.co.uk"; String remoteControl = "localhost"; Int port = 4444; String browser = "*firefox"; Selenium selenium = new DefaultSelenium(remoteControl, port , browser ,baseUrl); selenium.start() selenium.open("/"); selenium.click("link=chapter1"); // rest of the test code
We then need to change our tests to the following...