Goals
After completing this lab, you should be able to
- Create and run test suites using Selenium.
Selenium
Installation in Firefox
- You must use Firefox for this part. (You can find similar alternative tools for Chrome or use Selenium RC.)
- Go to Selenium's Home Page.
- Click on "Selenium IDE"
- On the right-hand sidebar, click "Download Selenium" and follow the instructions on that page.
You may need to give permission to Selenium to allow a download/installation.
Using Selenium with Firefox
In Firefox, under "Tools", select "Selenium IDE". You should get a pop-up window that looks something like this:
Here is a brief tour:
- You will create test cases, which are a series of events, by having Selenium record what you do. You can then replay these test cases. Typically, each test case will test some specific functionality.
- Use your mouse to hover over the red button. It should say "Now Recording. Click to stop recording."
- The green arrows are used to replay the test cases.
- You can choose to replay the test case as fast or slow as you want.
- The commands that make up the test case are in the command window. There are lots of different commands available. See the Selenium Web Page for more information about the available commands
Testing Login Functionality (45 pts)
Overview: For this assignment, you will create test cases (described below) for your Login servlet and create a Web page with links to the test cases so that I can grade your test cases. Save the test cases as HTML files. Link to these test cases from your CS335 home page.
The required test cases
- One test case will test the functionality when a user enters a valid username and password. You should go to the authentication page to verify too.
- One test case will test the functionality when a user enters an invalid username and password. Again, go to the authentication page as well.
- For each test case, verify the title of the response page using
the
assertTitle
command. - Name the test cases appropriately.
Grading (45 pts)
This lab is due Tuesday at midnight.
- Web Page: 5 pts
- Test cases: 40 pts