kenda592
14 years agoNew Contributor
Data Driven Loop Help
Hi there
I am fairly new to TestComplete however I am starting to get my head around it. I will just give you a quick overview of my scenario I need help with. Currently we have keyword test cases which simulate various sales scenarios for Infinity Point of Sale. They all use a spreadsheet to run a data driven loop using things such as product codes, quantities, filenames for saved receipts etc.
There are quite alot of repeated steps for each test, such as user login, adding a product and a few others. So I have started to make keyword tests for these repeated steps so that I can include them in the test cases and any new tests we make, rather than record them all over again.
So far I have made keyword tests that login, add a product from an excel data table, then complete the sale - as these are constant across most of out tests. When I run the test it will use the login keyword test and login, then it will run the add product test taking a product code from the excel worksheet, then finally complete the sale before logging in again and adding the next product in the sheet, and so on.
My problem comes when after all my products have been iterated through in the excel data table, that the data driven loop logs in starts to add a product and then realises that it has come to the end of the spreadsheet. So it kinda works but its pretty messy when the test wants to loop again and ends up failing because it cannot complete due to their being no more products to use as input. Is there some way that I can get the test to realise this and complete before it tries to loop again and fail?
I have two attachements below, one is the old format of test. The new one which I am currently trying to implement calls repeated processes stored in keyword tests. Calling the Login test, add product then a test that completes the sale via whatever method (cash eftpos visa gift card, combos of each etc) and looping through the products which are linked via a worksheet the add_product keyword test uses. Now I can see why it wants to login again and try add another product as the tests are independent of one another and the loop doesnt realise everything is finished, but like i said before it would be great if anyone knew how to help me with my problem!
I am fairly new to TestComplete however I am starting to get my head around it. I will just give you a quick overview of my scenario I need help with. Currently we have keyword test cases which simulate various sales scenarios for Infinity Point of Sale. They all use a spreadsheet to run a data driven loop using things such as product codes, quantities, filenames for saved receipts etc.
There are quite alot of repeated steps for each test, such as user login, adding a product and a few others. So I have started to make keyword tests for these repeated steps so that I can include them in the test cases and any new tests we make, rather than record them all over again.
So far I have made keyword tests that login, add a product from an excel data table, then complete the sale - as these are constant across most of out tests. When I run the test it will use the login keyword test and login, then it will run the add product test taking a product code from the excel worksheet, then finally complete the sale before logging in again and adding the next product in the sheet, and so on.
My problem comes when after all my products have been iterated through in the excel data table, that the data driven loop logs in starts to add a product and then realises that it has come to the end of the spreadsheet. So it kinda works but its pretty messy when the test wants to loop again and ends up failing because it cannot complete due to their being no more products to use as input. Is there some way that I can get the test to realise this and complete before it tries to loop again and fail?
I have two attachements below, one is the old format of test. The new one which I am currently trying to implement calls repeated processes stored in keyword tests. Calling the Login test, add product then a test that completes the sale via whatever method (cash eftpos visa gift card, combos of each etc) and looping through the products which are linked via a worksheet the add_product keyword test uses. Now I can see why it wants to login again and try add another product as the tests are independent of one another and the loop doesnt realise everything is finished, but like i said before it would be great if anyone knew how to help me with my problem!