Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP not clicking on Yes button in the IE pop up dialog
#1
Not Solved
Hi

I am automating a web application using QTP 11. After the login operation, I get the IE pop up dialog titled -"Internet Explorer" and text inside it - "The page is accessing information that is not under its control. This poses a security risk. Do you want to continue" with a Yes and No button.

I automated it by adding the objects in the repository and writing script

Code:
Browser("Mybrowser").Dialog("Internet Explorer").WinButton("Yes").Click


But the above script some times fails to click the Yes button

I tried descriptive programming like this
Code:
Browser("title:="My Browser").Dialog("text:=Internet Explorer").Winbutton("text:=&Yes").Click

I could not get the Yes button clicked with the above statement

At last I tried to handle it by using a function
Code:
Set oBrw = Browser("title:="My Browser")
Call fnCleanBrowserPopups(oBrw)

Public Function fnCleanBrowserPopups(oBrw)

   'Get the popup dialog
   Set oPopDlg = oBrw.Dialog("ispopupwindow:=True")

   fnCleanBrowserPopups = False
   If oPopDlg.Exist(0) Then
      'There is a popup dialog
      'Get its title
      sPopTitle = oPopDlg.GetROProperty("title")

      Select Case LCase(sPopTitle)
          Case  "Internet Explorer"
            oPopDlg.WinButton("text:=&Yes").Click
            fnCleanBrowserPopups = True
            Reporter.ReportEvent micPass, sPopTitle, "Closed IE dialog popup"
         Case Else
            Reporter.ReportEvent micFail, "Unknown dialog box - ", sPopTitle
      End Select
   End If

End Function
But still no luck. The above function gets the handle to the title of the pop up - sPopTitle = oPopDlg.GetROProperty("title"), but never clicks the Yes button

Please suggest me something here

Regards
Srinivas
Reply
#2
Not Solved
Try this code below:

Code:
IF Browser("Mybrowser").Dialog("Internet Explorer").Exist(0) Then
Browser("Mybrowser").Dialog("Internet Explorer").WinButton("Yes").Activate
Browser("Mybrowser").Dialog("Internet Explorer").WinButton("Yes").Click
End If

Insert the reporter statements accordingly. The code first checks the dialog box exists and then activates the 'Yes' button.
Reply
#3
Not Solved
In Descriptive programming,Use the micclass property to select the yes button by specifying its ordinal identifier(index).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Winbutton slow in clicking kpat 0 1,673 05-23-2016, 12:09 PM
Last Post: kpat
  SAP GUI gets hanged while closing the Windows Pop Up kathirvelnagaraj 0 5,317 10-23-2015, 06:47 PM
Last Post: kathirvelnagaraj
Rolleyes QTP pop up window handling piyush8793 3 16,393 10-15-2015, 11:03 PM
Last Post: Venkateswarluponna
Shy 5 Save button QTP Qtpnew 1 2,220 09-03-2015, 09:52 AM
Last Post: supputuri
  Clicking on sublink venkatesh9032 1 2,515 06-01-2015, 08:26 PM
Last Post: babu123

Forum Jump:


Users browsing this thread: 1 Guest(s)