Forum Discussion

michaelzh17's avatar
michaelzh17
Occasional Contributor
8 years ago

Is Excel application installation a need for using of Excel driver?

Hi , 

 

I'm trying to do data - driven testing using excel file. I just find out the machine doesn't have office installed. Only thing it has is a excel viewer.  So can I still use Excel driver in test complete to work with excel file without Excel installed? I tried but every time ending with "an attempt to work with a closed driver" error. 

 

If answer is no, I'll switch to csv file...

 

Thanks,

Michael

 

  • I think if you're using the ACE driver, you need Excel installed.

     

    I think switching to CSV, though, is better anyways.  The files are more easily portable, you can actually do DIFF checking when putting them into source control a LOT easier, and you don't need a proprietary editor to edit the files.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    I think if you're using the ACE driver, you need Excel installed.

     

    I think switching to CSV, though, is better anyways.  The files are more easily portable, you can actually do DIFF checking when putting them into source control a LOT easier, and you don't need a proprietary editor to edit the files.

    • michaelzh17's avatar
      michaelzh17
      Occasional Contributor

      Thanks, Robert.

       

      I'm working on csv now. But get error msg "Cannot update, database or object is read-only."

      here is my code, pretty simple one, do you see any problem..

       

      //code 

      function test_csv(){

      DDT.CSVDriver(Project.Variables.data_file);
      while(!DDT.CurrentDriver.EOF())  // log error point to this line of code 
      var sub_item = DDT.CurrentDriver.Value(0);

      Log.Message(sub_item);
      DDT.CurrentDriver.Next()


      DDT.CloseDriver(DDT.CurrentDriver.Name);

      }

       

      Thanks,

      Michael

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Is Project.Variables.data_file a string containing the file name or is it the actual DBTable file itself?

         

        I tried the following:

         

        function testSomething() {
            DDT.CSVDriver(Project.Variables.dbTable);
            while (!DDT.CurrentDriver.EOF()) {
               Log.Message(DDT.CurrentDriver.Value(0));
               Log.Message(DDT.CurrentDriver.Value(1));  
               DDT.CurrentDriver.Next()     
            }
            DDT.CloseDriver(DDT.CurrentDriver.Name);
        }


        Where the variable contains the string for my CSV file.  Note, I'm using a persistent variable but, so long as the variable contains a string, it works just fine.  So, I would double check and make sure that what you're passing as the Project.Variable.data_file is correct.