Trying to insert a variable into a TreeView
We are trying to insert a variable for a child object on a tree. We have set up a datapool with the string we want returned. Our problem is that the user MUST click on the node object to insert the datapool values. It appears that Robot is not wanting to use our variable, but is looking for Object_Label as the actual Treeview value. Our code looks like this:
Dim x as Integer
Dim dp as Long
Dim Object_Label as String
Dim Result as String
For x = 1 to 10
'Open the datapool for access by this and subsequent scripts
dp = SQADatapoolOpen("ObjectLabel",true,SQA_DP_SEQUENTI AL,false)
'Fetch a record from the datapool
Result = Object_Label
Window SetContext, "Caption=ATIS Analyzer - Database", ""
TreeView Click, "ObjectIndex=1;\;ItemText=[EUTEST\.->.->'"&Object_Label]&"',"""""
Toolbar Click, "ObjectIndex=1;\;ItemID=32876", "Coords=18,14"
Window SetContext, "Caption=Rectifier 0", ""
PushButton Click, "Text=OK"
'Close the datapool
Any help would be GREATLY appreciated. ~eupec
Re: Trying to insert a variable into a TreeView
Hi eupec, Haver you pasted your code as it is in Robot ?
It looks to me as if is won't compile, but maybe that's just typos in your message :
=> The TreeView Click line is referencing a Variable names Object_Label]
=> It has missing quotes (or too many, not clear)
The minimum you need to do to for it to compile is this
TreeView Click, "ObjectIndex=1;\;ItemText=[EUTEST\.->.->'" & Object_Label & " ]'",""
But even then, is looks very strange.
I wouldn't expect these square brackets, backslash, and dots in treeview lables. They would mean a treeview structure looking like this :
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[EUTEST\.
<Object_Label>]</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">