Forum Discussion

kktsenthil's avatar
kktsenthil
Occasional Contributor
10 years ago

How to pass diffe inputs from Excel in each test case execution through keyword Test?

my scenario is I need to pass the input for the fields from excel and if in first iteration of test execution the data should be passed from the excel and save the records and if I execute the same test case again the test date should be taken at the record row in the excel(next test data which is in the excel to avoid the duplicate test case) so when ever if I execute the test the Test Complete should be read the input from the excel. So how can I achieve this in test Complete?

5 Replies

  • Lage's avatar
    Lage
    Contributor

    If I understood you well, I think that what you need is something like that:

     

    2015_05_12_TestComplete_execute if TestData.png

     

    That means, inside the loop, you create an If statment that checks some value inside the excel then goes inside the IF or straight to the Else.

     

    The hard thing here is that you want to update the excel file each time. That should be where the "Note: important!" is. But you can not do this without using a script routine. This script will be hard to create but you can check this page Write data to MS file.

     

    Instead of using a excel I recomend you to usea a Project Table (or Local Table). you can update the values inside the table using the keyword Operation: "Set Variable Value"

     

    Even so, I trully recomend you to rethink your test strategy in order to find the easiest way.

     

    Hope this helps.