Forum Discussion
6 Replies
- anna_v
Staff
Hi,
To figure out what's wrong, we'll need to look into your script code. Could you please attach it here? Does your script generate any errors while playing it back ? If any error occurs, on which script line does it occur and what's the exact error text?
Also, please specify what TestComplete and Excel versions are you using?Thanks in advance.
Ann - tinauserFrequent ContributorHi, thanks for the answer.
There is not really much code here: the translation of the keyword test is as follows:
function Test2()
{
Project.Variables.myXlsTable.Reset();
for(; !Project.Variables.myXlsTable.IsEOF();)
{
//Posts an information message to the test log.
Log.Message("", Project.Variables.myXlsTable.Value("Msg"));
Project.Variables.myXlsTable.Next();
}
}
where myXlstable is the .xls table attached before. some messages are trunkated.
TC version: 8.70.727
Excel version: 14.0 (2010 professional plus) - anna_v
Staff
Hi,
Could you please clarify how you populated the myXlsTable variable in your project? Is it a Project or ProjectSuite variable?
I have created a ProjectSuite variable and the following script code works correctly with your Excel table:
function Test2()
{
ProjectSuite.Variables.myXlsTable.Reset();
while(!ProjectSuite.Variables.myXlsTable.IsEOF())
{
Log.Message(ProjectSuite.Variables.myXlsTable.Value("Msg"));
ProjectSuite.Variables.myXlsTable.Next();
}Ann
- tinauserFrequent ContributorHallo Ann,
I did not write a script in this case, I just did a data driven loop within a simple keyword test.
The code you see is just the code automatically generated by test complete:
1. I attached a log action
2. Rightclick->make Datadriven loop...->used the wizard (create new variable, browse for the xls file, select the worksheet).
3.Modified the log so that it uses value from the table in the additional information.
I think that differently from the script, in the keyword test the DBobject is a keywordtest variable.
Are you sure it work properly?Look for instance at the message that should be read in row 16: is that complete? - tinauserFrequent ContributorYes, very much indeed.
So it is enough to insert a dummy row and start the DDT from row 2.
Thanks!