TestProject Forum
Powered by leading experts in the test automation community

Question for data driven test

Hi, I am new to TestProject and got a problem. I have watched some posts related to data-driven test but still not able to solve mine. Hope someone can help me. My test case can divide into 2 steps,
a. input username & password to log in.
b. search books by inputting book number, where [book number] is the variable in the csv file.
The problem is step b can only execute after login (step a), but after I run the first time, it will fail in 2nd time as the account is already login. The test case is not able to execute the part of inputting username and password again.
So could I only run step a once then run step b multiple times based on the [book number] variable in csv file? Or could I open the browser and login first, then I execute step b?

Hello Tomson, if you haven’t done it already you can add the test to a job and tick the Restart the browser before each test in the browsers selection page. This will open new browser in incognito mode for each test, so you won’t be logged in

Capture

You can reach this page in existing job by choosing edit from the jo options

Capture1

Thank you. It is a way to solve my question. But could TestProject able to run multiple times by login once only? As it takes much time to execute if need to login each time. :slight_smile:

Not with one test, create one test for login and one test for the books search. Add both to the job with the login test first, it will run it and then the data driven tests.

Thank you so much! Sorry for later reply. I was busy yesterday. I will try with your suggestion. :slight_smile:

It would be five different flows, i.e five different test cases for one test scenario
Test scenario is search book by book number in csv
Test cases are
a. Search book by book number on first time login (which you wrote)
b. Search book by book number on already logged system
c. Search book by book number by logging out of already logged system in same browser and machine
d. Search book by book number by logging out of already logged system in different browser but same machine
e.
Search book by book number by logging out of already logged system in different machine

1 Like