falcron
15 years agoOccasional Contributor
Referencing an object via a project variable
How is this done?
Currently, the following doesn't appear to be working for me:
I also tried:
I feel like I'm making a dumb coding mistake, but is this possible to do in TestComplete? Where is my error here? I'm assuming it's because I'm seting the object as a string, but given the options given to me of the variables, I'm not sure how to set this as an Object.
In a nutshell I want to be able to store an object name in a variable and reference it later.
Currently, the following doesn't appear to be working for me:
Project.Variables.AddVariable "KittBar", "String"
If Project.Variables.envBrowser = "IEXPLORE" then
Project.Variables.KittBar = "Aliases.IEXPLORE.pageHome.panelContainer.panelContent.panelBgComputers.panelProfileRow.panelSettingsRowSmall.imageKittBarGif"
End If
If Project.Variables.envBrowser = "firefox" then
Project.Variables.KittBar =
"Aliases.firefox.pageHome.panelContainer.panelContent.panelBgComputers.panelProfileRow.panelSettingsRowSmall.imageKittBarGif"
End If
Set objKitt = Project.Variables.KittBar
While objKitt.Exists = TRUE
Call Delay(5000)
Wend
I also tried:
Set KittBar = Project.Variables.envKittBar
While aqObject.CallMethod(KittBar, "Exists") = True
Call Delay(5000)
WEnd
I feel like I'm making a dumb coding mistake, but is this possible to do in TestComplete? Where is my error here? I'm assuming it's because I'm seting the object as a string, but given the options given to me of the variables, I'm not sure how to set this as an Object.
In a nutshell I want to be able to store an object name in a variable and reference it later.