Handling Multiple IE windows in QTP scripts
Question ID: 104329
0
0

I have a script in which I open an IE browser and using the URL get into the web application. In the web application there will be around 25 links and when I click on each link a Pop Up page opens.

I do some validations in the Pop Up page and then close the pop up page. Some time this works find and sometimes it fails as the validation is done in the parent window instead of pop up page.

Can you let me know how can I force the validations in the second window?

I have given portion of the code below.

Thanks
Sri

enter code here`


Set IE1 = CreateObject("InternetExplorer.Application")
IE1.Visible = True
IE1.StatusBar = 1
IE1.Navigate Browser("Browser Name").Page("Page Name").Output CheckPoint("Getting Link Set oDesc = Description.Create()
oDesc("html tag").Value = "A"
oDesc("micclass").value ="Link"
oDesc("innertext").value ="Enroll"
Set oChild = Browser("Browser Name").Page("Page Name").ChildObjects(oDesc)
iLinkCount = oChild.Count-1
For lCount = 0 to iLinkCount
    Browser("Browser Name").Page("Page Name").Link("Link Name").SetTOProperty "href", oChild(lCount).GetROProperty("href")
    Browser("Browser Name").Page("Page Name").Link("Link Name").SetTOProperty "text", oChild(lCount).GetROProperty("innertext")
    Browser("Browser Name").Page("Page Name").Link("Link Name").SetTOProperty "name", oChild(lCount).GetROProperty("innertext")
    Browser("Browser Name").Page("Page Name").Link("Link Name").SetTOProperty "outerhtml", oChild(lCount).GetROProperty("outerhtml")
    Browser("Browser Name").Page("Page Name").Link("Link Name").Click
................Check Points
    Browser("Browser Name").Page("Page Name").WebButton("Continue PRocessing").Click
................Check Points
    Browser("Browser Name").Page("Page Name").Output CheckPoint("Getting data from pop up page")
................Validations
        Browser("Enrollment Gateway").CloseAllTabs
Next 
Set oChild = Nothing
Set oDesc = Nothing

Marked as spam
Posted by (Questions: 3, Answers: 0)
Asked on February 22, 2011 8:18 pm
35 views
Answers (1)
7
Private answer

Have you tried to use code using the creationtime attribute on the browser?

For example:
Browser(''creationtime:=1'').Close

Marked as spam
Posted by (Questions: 2, Answers: 98)
Answered on October 29, 2012 10:16 am
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top