Forum Discussion

Typoo's avatar
Typoo
Occasional Contributor
7 years ago

CheckProperty a boucle in testcomplete

Hi, I have a question to validate CheckProperty a boucle in testcomplete :

 

for (var row=0;row<=this.grdDocuments.wRowCount-1;row++)       {

 

aqObject["CheckProperty"](this.grdDocuments,'wValue(row, "Statut")', cmpEqual, 'CP');// error parameters incorrect.

}

If I put :

 

aqObject["CheckProperty"](this.grdDocuments,'wValue(0, "Statut")', cmpEqual, 'CP'); //as Row =0  it works

 

Thank you

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Change your code to the following:

     

    for (var row=0;row<=this.grdDocuments.wRowCount-1;row++)       {
     
    aqObject["CheckProperty"](this.grdDocuments,'wValue(' + row + ', "Statut")', cmpEqual, 'CP');
    }

    row, being a variable, needs to be evaluated as such.  As you had it, the string 'row' was being sent to the wValue property instead of the value of the variable row