cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
Occasional Contributor

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

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

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

10 REPLIES 10
Community Hero

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

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

Occasional Contributor

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

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

Community Hero

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

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Occasional Contributor

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

Hi Robert, 

 

Project.Variables.data_file has the address of the csv file. 

I'm sorry, should be data_file_csv. After changed, the script just hang there when I try to run it...

And as I read the document, I need to add a schema.ini file to pair with the csv file? I created that too...

 

Maybe i should just use the file address directly in the script. 

 

Michael

Occasional Contributor

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

Hi Robert, 

 

Seems working now. 

Thanks for helping with the troubleshooting. 

 

Regards,

Michael

Community Hero

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


@michaelzh17 wrote:

Hi Robert, 

 

Project.Variables.data_file has the address of the csv file. 

I'm sorry, should be data_file_csv. After changed, the script just hang there when I try to run it...

And as I read the document, I need to add a schema.ini file to pair with the csv file? I created that too...

 

Maybe i should just use the file address directly in the script. 

 

Michael


Looking at your screenshot, the file name in data_file_csv is missing the .csv file extension.  So, that may be why you're running into issues.

As for schema.ini... you don't NEED to have it... it's useful to enforce data formats, etc., as they are read from the file as well as if you're not making the first row your column names allows you to define the column names.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Community Hero

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


@michaelzh17 wrote:

Hi Robert, 

 

Seems working now. 

Thanks for helping with the troubleshooting. 

 

Regards,

Michael


Glad it's working!


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Occasional Contributor

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

Hi Robert, 

 

Not sure if I could ask you another question. 

Can I read data from csv file for specific row instead of using 'DDT.CurrentDriver.Next();'?

 

Thanks,

Michael

Community Hero

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

The DDT drivers don't allow for finding information in a particular row once you've established the driver.  In order to do so, you would essentially need to reconfigure the driver via the ADOCommand object to run a different SQL query... this will change the records returned to ONLY be that one record.  If that's acceptable, then yes, you can do it... but if you need to be able to have access to all the records and navigate back and forth within the set of records, than no... the DDT drivers are forward only, read only cursors on the data set.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors