Working with OperaDriver
Opera Software, the company that created Opera, has built their own project to support Selenium WebDriver. Since not every web browser will act the same with the sites that we create, it is a good idea to make sure we can test our applications with OperaDriver.
Note
Note that OperaDriver works best with the latest stable release of Opera. Make sure that you update it regularly.
Let's see how easy OperaDriver is to use. In this section, we will see how we can start OperaDriver and get it to click a button on the page. This simple test will give us the confidence to use Selenium WebDriver with Opera:
Update the
setUp()
method to loadOperaDriver()
:driver = new OperaDriver();
Now we will need to find an element. In this section, we will find the link
Chapter 4
:WebElement element = driver.findElement(By.linkText("Chapter 4"));
Now we will need to click on the link:
element.click();
Run your test and it should look like the following:
import org.openqa.selenium.*; import org...