Using Set Variable in a Keyword testcase
What I was trying to do was to simply show the value of a variable in the test log associated with a KEYWORD testcase. For some reason the value of the Project variable named TotalTax is NULL.
I used the Set Variable wizard tool to define the TotalTax variable as the value of an object on the target web page
This worked fine. When I used this wizard, the value of the TotalTax variable was set to "= 26,808.88".
The MODE setting for this parameter was set to OBJECT PROPERTY. The VALUE setting for this parameter was set to
Aliases.browser.pageAutawb21SalestaxwebGotosucce.table.cell5.contentText
Note that the project variable, TotalTax has a TYPE set to STRING. I tried a TYPE set to OBJECT, and then TestComplete complains of a TYPE MISMATCH error when the Set Variable Value statement is executed.
This TYPE MISMATCH error is shown under the Additional Details tab of the test log.
Any help with this question would be appreciated. Thanks.
Here's my thinking:
I'm guessing that you're setting the variable value after some other process. So, it's entirely possible that, at the time that "Set Variable Value" is called, that there is no contentText or object of the type you're looking for. Essentially, a timing issue where the value is not getting set because the component isn't fully rendered yet.
Could you post a screenshot of your keyword test including the steps leading up to the Set Variable Value call?