From the course: Learning Selenium: Structure, Scale, Run, and Optimize Automated Tests
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Data-driven testing - Selenium Tutorial
From the course: Learning Selenium: Structure, Scale, Run, and Optimize Automated Tests
Data-driven testing
- [Instructor] So this is my login screen, and I've got these default accounts that I want to try and test with this login screen. Normally you would have to write three different tests by copy pasting this test multiple times and then test it with first customer, then second customer, then third customer. Let's see how this current test works. So this test goes to the login page, enters the data about the user and password, and then waits for the page to load and then checks the title is my account. And let's just see it in action. So I'm going to click on Play. It opens the window, enters the password, and then executes the whole test. So this test is passing right now. It's using two page object models, AccountPage and the LoginPage. AccountPage looks like this, which just checks the page title. LoginPage looks like this, which is just email, password, and button submit. Now if you go back to our test, I want to test it with three different usernames. How would I do that? Well…