O'Reilly logo

Selenium 2 Testing Tools Beginner's Guide by David Burns

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – setting up the test

Imagine that you have a number of tests that work on a site that requires you to log in and move to a certain page. Or imagine that you need to have a test that requires you to be on a certain page. In these two situations the quickest way to find out which page you are on and then move to the correct one if need be, is to start testing. This is to make sure that we follow one of the major tenants of test automation, in that you always start from a known place. Let us see this in an example:

Create a new Java class in IDEA:

  1. Import the relevant Selenium Packages.
  2. Create the setup() and teardown() method. I prefer the JUnit 4 style of tests and will show code samples with the annotations.
  3. We need to check that the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required