Forum Discussion

Amrendra's avatar
Amrendra
Occasional Contributor
7 years ago

Re: I have an excel sheet wher column a is test case, column b is either yes or No, column c is name

Hi,

 

This is related to Test Complete Tool. Please and please help

5 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    So... what's the question or problem.  What do you need to do? What answers are you looking for.  The subject is really rather vague and your additional comment doesn't tell us much of anything.  Can you elaborate?

    • Amrendra's avatar
      Amrendra
      Occasional Contributor

      Hi,

       

      I am executing Test case from excel and for every test case I have written separate function which will be executed based on either Yes or No in execute column. I want the result to paste in the same excel with either "Pass" or "Fail" as per the result

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Your best bet in this case is to utilize DDT.ExcelDriver to drive your tests (http://support.smartbear.com/testcomplete/docs/reference/program-objects/ddt/exceldriver.html).  This you can use within code and with a loop to loop through the rows in your excel sheet, check the "yes/no" column to determine if it should run something and then execute the appropriate function.

         

        As for writing it back out to the same Excel sheet, you'll need to use the Sys.OleObject('Excel.Application') object to gain write access to your excel sheet.  The problem is that the sheet is open and in use within the DDT script.  What I would do, if you want to go this route, is to populate some sort of in-memory array within the DDT loop of pass and fail for the test cases that are run and then utilize that object to update your excel sheet outside of the loop.