Forum Discussion

Janjan_1's avatar
Janjan_1
Occasional Contributor
14 years ago

Reusing a block of code with unique data each time

I am a very novice user and would greatly appreciate any help or guidance.



I have created a block of code that I will use for numerous test cases.  I would like this block of code to pull in data, (last name, first name, address, city, state and zip), from an excel spreadsheet.  Each time this block of code is used, the client data being pulled in needs to be unique.  I can't figure out how to do this.  I have watched the data-driven testing tutorial, which doesn't fit my case. 



Each time I use the block of code, I have mapped  it back to a unique column on the spreadsheet, then pulled the keyword test into my test case.  I did this repeatedly, for all test cases that I have that need to use this block of code.  The problem arises when I save my work.  The block of code is saved with the last changes and those last changes then populate to each test case I've created, which if run, would all then use the same data.



Thanks!



Jan


12 Replies