Forum Discussion

littlebear's avatar
New Contributor
2 months ago

Referencing an Object and its Properties with GetPropertyValue/CheckProperty


I recently started working in TestComplete and have just learned about scripts as a way to make more complex test steps. Because my tests will probably be used in the future, one of my ideas was to make a make a script that could compare the current date with a certain textbox and see whether date and value in the textbox object are the same. This would mean that the script always had the current date of the test, rather than a hardcoded value.

I thought further that I shouldn't tie this to a certain object in one test, making only that test continuously relevent, I should instead make this script more generic, so I can apply it in multiple tests, or in multiple places in the same test. To do this, I wanted to give my function an argument that would take in a TestComplete object (the objects that are referenced in the test steps).

This is what I have tried so far:

function DateCheck(dateTextObject) {

     aqObject.CheckProperty(dateTextObject, "text", cmpEqual, aqConvert.DateTimeToStr(aqDateTime.Today()));


I am planning for the dateTextObject to be the long NameMapped object that I want to pass in, for example: Aliases.browser.pageLeadMainTestcompletetestDyna.sectionQuickCreateContact.sectionDetails4.textboxDate

When I passed that into my test, however, it gave me an error that told me there was a Type mismatch.

I would appreciate any help you could give to me about this issue. Thanks!

4 Replies