Forum Discussion

Andrew_x's avatar
15 years ago
Solved

use a variable as the expected text in a Property Checkpoint for a Keyword test?

When adding a property checkpoint in a keyword test, how can you use a variable as the value to compare (instead of a hardcoded value).



I've added a property checkpoint to my keyword test, and I want to have the expected value taken from a variable.  But the wizard for the checkpoint automatically puts quotes around my code calling the variable, therefore it takes the string literally instead of the value of the variable. 



NOTE: I can get this working in a script, but not in the Keyword test.



The way the code looks for the checkpoint is:



From Keyword Test: 



  • Aliases.Licence.LabelValue.Name, "wText", cmpEqual, "KeywordTests.VerifyLicence.Variables.AddLicence("Licence_Name")", False


From Script (Which works):




  • Call aqObject.CheckProperty(Aliases.Licence.LabelValue.Name, "wText", 0, KeywordTests.VerifyLicence.Variables.AddLicence("Licence_Name"), False)




Notice the quotes around the portion where I'm attempting to use the variable in the keyword test checkpoint.