Micro Focus QTP (UFT) Forums
Does QTP supports to open same application multiple times!!!!! - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Does QTP supports to open same application multiple times!!!!! (/Thread-Does-QTP-supports-to-open-same-application-multiple-times)



Does QTP supports to open same application multiple times!!!!! - pkiran169 - 03-26-2013

Hi,

My testcase is like this - I want to open the same application multiple times and do click on "Post" button from all the application one after other.

Can any one please help.

Assume i have opened 3 application -
Code:
SwfWindow("Sample Publisher (Named").SetTOProperty "index", 0
SwfWindow("Sample Publisher (Named").SetTOProperty "index", 1
SwfWindow("Sample Publisher (Named").SetTOProperty "index", 2
Here, i have used SetToProperty with index values to identify 3 same application. Till here my code work fine, it is identifying the application perfectly but when i try to click on Post button thru code it's not clicking onthe given application. The code looks like below:
Code:
SwfWindow("Sample Publisher (Named").SetTOProperty "index", 0
If SwfWindow("Sample Publisher (Named").Exist(0) then
    SwfWindow("Sample Publisher (Named").Activate
    SwfWindow("Sample Publisher (Named").SwfListView("listViewPublisher").Select "NGS.Infrastructure.SessionEvents.EnteringState"
SwfWindow("Sample Publisher (Named").SwfButton("PostEvent").Click
    wait(2)
End if
    SwfWindow("Sample Publisher (Named").SetTOProperty "index", 1
'    SwfWindow("Sample Publisher (Named").Activate
If  SwfWindow("Sample Publisher (Named").Exist(5) Then
    SwfWindow("Sample Publisher (Named").SwfListView("listViewPublisher").Select "NGS.Infrastructure.SessionEvents.ExitingState"
SwfWindow("Sample Publisher (Named").SwfButton("Post Event").SetTOProperty "index",1
SwfWindow("Sample Publisher (Named").SwfButton("PostEvent").Click
wait(2)
End If

   SwfWindow("Sample Publisher (Named").SetTOProperty "index", 2
SwfWindow("Sample Publisher (Named").Activate
If  SwfWindow("Sample Publisher (Named").Exist(5) Then
    SwfWindow("Sample Publisher (Named").SwfListView("listViewPublisher").Select "NGS.Infrastructure.ResourceEvents.Stage.StageMoved"
SwfWindow("Sample Publisher (Named").SwfButton("Post Event").Click
wait(2)
End If

Thanks,
Kiran


RE: Does QTP supports to open same application multiple times!!!!! - anil2u - 08-07-2013

Hi,

Can you be sure that the window properties remain same even after clicking on the first 'Post' button. Say you identify the first window with index as '0' then click on Post. Now try to identify the window with index property '0' and see if its really identifying your first window or not.

Let me know how this cropped up.

Cheers