Forum Discussion

psoliz's avatar
10 years ago

Variable Data with test complete

I have read the variable help in the test case documentation, if I have missed this below then please point me in the right direction.



Scenario:

Running a test case

Want the input data on a specified field to be random email addresses.

I am not running a loop so I am not concerned with random email addresses all within the same test

I am running test, then running it an hour later, then running it 30 minutes later and so on.

I have a list of email addresses and without refreshing the database to reuse the email addresses over I want the email addresses used in each test case to be sequential.

Meaning use email address 1 on first run

Use email address 2 on second run

Use email address 3 on third run and so on...all of this needs to occur without me having to change the value each individual time and without me having to tell the test script we are now on the 34th run of this test.

2 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3
    You want a project variable to use as an index into your database.  In my attached example, it's called counter.  Set the local value to 1.  When you read the email address out of your database, use the variable to pick it, then increment the variable immediately after.



    By using a project variable instead of a test variable, you will be able to retain the index value between runs.  If your tests end today on email 34, then tomorrow it will pick up with email 35, unless you go into the project and reset the local value manually.
  • tandreys's avatar
    tandreys
    Occasional Contributor
    If you can modified your database, you can add a field for Used addreses. So you query only the unused email addresses.

    After you select the address, you update the used field.