Page 1 of 1

Validation keeps repeating when I don't want it to

Posted: Wed Aug 17, 2016 4:41 pm
by Peter546
Hi there

I have two separate recordings under one test case. In one recording I have a variable that reads in 4 four barcodes from a csv file.

The next recording is supposed to validate the results after all the barcodes have been entered. The problem I am having is that the validation runs every time after each barcode has been entered. I just want it to run once all 4 barcodes have been entered, not after each one.

I have had to create a separate test case for the validation to work around this but is there anyway to do what I want under one test case?

Thanks, Peter

Re: Validation keeps repeating when I don't want it to

Posted: Wed Aug 17, 2016 4:56 pm
by krstcs
Actually, what you already figured out is the correct way to handle it.

Each test case is a for-each loop that loops over each row of data from your data connector. It sounds like your connector has 4 rows (1 for each barcode).

What you should do is move the validation out of the barcode entry test case and into a parent test case, after the barcode test case.

It should look like this:

TestSuite
--TestCaseParent (will run once since there is no data connector)
----TestCaseBarCodeEntry -> Barcode data connector (will run once for EACH row of data in the connector)
------ModuleBarCodeEntry
----Validation

Edit: Note that the problem with this setup is that only part of your test is data driven. The validation will have to be set to the specific values, so if the data changes in the future, your validation will fail until you manually change it. My suggestion would be to figure out a better structure for the data/test case so that you can truly data-drive this scenario.