Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IE Dialog Box, Print
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
I have a website with an input button named Print. It opens a page which then fires off a Print dialog box via javascript using window.print();. My problem is I have not been able to automatically close it. Does anyone have any experience with this? My code is the following:

Code:
Browser("title:=(.*)Print(.*)").Dialog("regexpwndtitle:=Print").WinButton("text:=Cancel").Click

It says
Quote:Cannot find the "[WinButton]" object's parent "[Dialog]" (class Dialog). Verify that parent properties match an object currently displayed in your application.

I have a Wait command before it that waits for 2 seconds. I'll probably end up changing it to 5 to see if that helps.
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Hello,

Please see if the following helps:

Code:
With Dialog( "micclass:=Dialog" )
    If .Exist( 5 ) Then
        .WinButton( "text:=Cancel" ).Click
    End If
End With
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Awesome. That did the trick!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Dialog boxes in Firefox 13+ skywalker89 1 3,744 08-28-2012, 09:48 AM
Last Post: souvikghosh_diatm
  Dialog box error while QTP scripts run from VM Desktop rahuldps 2 4,853 11-14-2011, 01:47 PM
Last Post: ravi.gajul
  Write a program to print the current folder name in the local system. kannan_panneerselvam 8 8,106 07-09-2011, 11:10 AM
Last Post: souvikghosh_diatm
  QTP Not identifying the Java Dialog box Automation_QA 2 6,606 08-31-2010, 07:02 PM
Last Post: Prafulla
  problem with file "save as dialog box" caze 3 11,155 12-10-2009, 11:44 AM
Last Post: caze

Forum Jump:


Users browsing this thread: 1 Guest(s)