Ask a Question

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

SOLVED
Andrew_x
Not applicable

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.

6 REPLIES 6
YMinaev
Staff

Hi Andrew,



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).


Currently, it is not possible by default. I have added a suggestion to implement this ability to our DB. As for now, you can try calling the working code snippet using the Run Code Snippet  
operation.
------
Yuri
TestComplete Customer Care Engineer

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
RichB
Not applicable

"Currently, it is not possible by default.  I have added a suggestion to implement this ability to our DB."



Is this still the case?  I notice this was posted over a year ago.  I'm using version 8.60.

Thanks

Hi Rich,



At this moment, the suggestion has not been implemented yet. Your message has increased its rating.



Please try using the workaround suggested by Andrew.
--
Best regards,
Alexey

Eight or so years, and I'm guessing it's not implemented yet?

--
You might not like AI, but it doesn't care about you.

Actually....

While it's not available when going through the wizard, you can go back in after the checkpoint is created and set the "Value" property to be a variable.

2019-08-27 09_03_47-TestComplete - C__MySource_Sandbox_Sandbox.pjs.png


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

You just made my week! Thank you.

 


@tristaanogre wrote:

Actually....

While it's not available when going through the wizard, you can go back in after the checkpoint is created and set the "Value" property to be a variable.

2019-08-27 09_03_47-TestComplete - C__MySource_Sandbox_Sandbox.pjs.png


 

--
You might not like AI, but it doesn't care about you.
cancel
Showing results for 
Search instead for 
Did you mean: