mash_ruves
13 years agoNew Contributor
Accessing multiple instance of same 'exe' name
Hi,
What I want to do for my Test App, is a scenario similar to one explained below:
Open 30 instances of Notepad (notepad.exe), and type '1' is 1st instance, '2' in 2nd instance and '3' in 3rd and so on.
And I want to create a loop for above monotonous task.
Please suggest if its possible via TestComplete 9...?
Coz, what I see at present is the name mapping is based on exe name and TC9 tries to add a digit as suffix.
But I want to get this done dynamically.
I hope above query is meaningful.
Thanks,
Manish
Test Script at present:
Sub Test1
Dim edit
Call TestedApps.notepad.Run(1, True)
Set edit = Aliases.notepad.wndNotepad.Edit
Call edit.Click(11, 11)
Call edit.Keys("1")
Call TestedApps.notepad.Run(1, True)
Set edit = Aliases.notepad1.wndNotepad.Edit
Call edit.Click(11, 11)
Call edit.Keys("2")
End Sub
Somewhat expected:
Sub Test1
Dim edit
For i = 1 to 30
Call TestedApps.notepad.Run(1, True)
Set edit = Aliases.notepad(+ Str(i)).wndNotepad.Edit
Call edit.Click(11, 11)
Call edit.Keys(Str(i))
Next
End Sub ' Wanted to explain just the expected logic. Discard the syntax errors ;)
What I want to do for my Test App, is a scenario similar to one explained below:
Open 30 instances of Notepad (notepad.exe), and type '1' is 1st instance, '2' in 2nd instance and '3' in 3rd and so on.
And I want to create a loop for above monotonous task.
Please suggest if its possible via TestComplete 9...?
Coz, what I see at present is the name mapping is based on exe name and TC9 tries to add a digit as suffix.
But I want to get this done dynamically.
I hope above query is meaningful.
Thanks,
Manish
Test Script at present:
Sub Test1
Dim edit
Call TestedApps.notepad.Run(1, True)
Set edit = Aliases.notepad.wndNotepad.Edit
Call edit.Click(11, 11)
Call edit.Keys("1")
Call TestedApps.notepad.Run(1, True)
Set edit = Aliases.notepad1.wndNotepad.Edit
Call edit.Click(11, 11)
Call edit.Keys("2")
End Sub
Somewhat expected:
Sub Test1
Dim edit
For i = 1 to 30
Call TestedApps.notepad.Run(1, True)
Set edit = Aliases.notepad(+ Str(i)).wndNotepad.Edit
Call edit.Click(11, 11)
Call edit.Keys(Str(i))
Next
End Sub ' Wanted to explain just the expected logic. Discard the syntax errors ;)