Forum Discussion
AlexKaras
13 years agoChampion Level 3
Hi Manish,
You may try Eval() function. The code will be like this:
Sub Test1
Dim edit
Dim obj
For i = 1 to 30
Call TestedApps.notepad.Run(1, True)
Set obj = Eval("Aliases.notepad" & aqConvert.IntToStr(i))
Set edit = obj.wndNotepad.Edit
Call edit.Click(11, 11)
Call edit.Keys(Str(i))
Next
End Sub
Though this will require creation of 30 identical subtrees in Namemapping and Aliases. I think that the better approach is to not use Aliases and work with native TestComplete objects. Something like this:
Sub Test1
Dim edit
Dim obj
For i = 1 to 30
Call TestedApps.notepad.Run(1, True)
Set obj = Sys.WaitProcess("notepad, i)
Set edit = obj.Window("Notepad", "* - Notepad", i).Window("Edit", "", 1)
Call edit.Click(11, 11)
Call edit.Keys(Str(i))
Next
End Sub
You may try Eval() function. The code will be like this:
Sub Test1
Dim edit
Dim obj
For i = 1 to 30
Call TestedApps.notepad.Run(1, True)
Set obj = Eval("Aliases.notepad" & aqConvert.IntToStr(i))
Set edit = obj.wndNotepad.Edit
Call edit.Click(11, 11)
Call edit.Keys(Str(i))
Next
End Sub
Though this will require creation of 30 identical subtrees in Namemapping and Aliases. I think that the better approach is to not use Aliases and work with native TestComplete objects. Something like this:
Sub Test1
Dim edit
Dim obj
For i = 1 to 30
Call TestedApps.notepad.Run(1, True)
Set obj = Sys.WaitProcess("notepad, i)
Set edit = obj.Window("Notepad", "* - Notepad", i).Window("Edit", "", 1)
Call edit.Click(11, 11)
Call edit.Keys(Str(i))
Next
End Sub
Related Content
- 6 years ago
- 10 years ago
Recent Discussions
- 3 days ago
- 3 days ago
- 7 days ago