Creating Manual Selenium IDE Test Cases: A Step-by-Step Guide
Learn how to build automated web tests in Selenium IDE by manually adding commands. This tutorial provides a practical guide to creating test cases without using the recording feature, demonstrating how to precisely control test steps and build more complex and robust automated testing scenarios.
Creating Selenium IDE Test Cases Manually
Introduction to Manual Test Case Creation
Selenium IDE allows you to create automated tests by manually adding commands instead of relying solely on its recording feature. This approach gives you more control and allows for more complex test scenarios. This tutorial demonstrates creating manual test cases in Selenium IDE using a search operation and login.
Creating a Search Test Case
- Open Selenium IDE: Launch Selenium IDE (ensure it's installed and configured in your Firefox browser).
- Create a New Project: Create a new project (e.g., "ManualTests").
- Create a New Test Case: Within the project, add a new test case (e.g., "SearchTest").
- Add Commands: Manually add commands to perform the actions you need. Remember to choose the correct locator strategy (ID, name, XPath, CSS, etc.) for each element. For example, to perform a Google search:
Search Test Commands
Command | Target | Value |
---|---|---|
open | https://www.google.com | |
clickAt | id=APjFqb | |
type | id=APjFqb | Selenium WebDriver |
clickAt | name=btnK |
After adding the commands, click "Run" to execute the test.
(Selenium IDE will show the test execution status and any error messages in the log.)
Creating a Login Test Case
- Add a New Test Case: Click "Add new test" in Selenium IDE to create another test case (e.g., "LoginTest").
- Add Login Commands: Add commands similar to the search test, but this time, target the login form elements of a website (e.g., Rediffmail). You will need to locate the "Sign-in" link, username field, password field, and the login button using appropriate locators.
Login Test Commands (Illustrative)
Command | Target | Value |
---|---|---|
open | https://mail.rediff.com/cgi-bin/login.cgi | |
click | id=login1 | |
type | id=login1 | testuser@example.com |
click | id=password | |
type | id=password | TestPassword123 |
click | name=proceed |
After adding your login commands, run the test.
(Selenium IDE will indicate success or failure. Check the log for details.)
Saving Your Test Suite
Save your Selenium IDE project (e.g., as "ManualTests"). This saves all your created test cases.