UFT not identifying a window in some playback

0
0

I am using descriptive programming in UFT. During playback, I want to check if the Windows print dialog does appear. Then I want to click the Cancel button in that dialog.
My problem: Sporadically QTP fails to identify the printing dialog, so clicking on the cancel button fails.
How can this possibly sometimes fail, sometimes succeed?

My code syntax given below:

Set Window_EnterMeter = browser_servicemanager.Window("regexpwndtitle:=Enter Meters.*") 
Set dialog_Print = Window_EnterMeter.Dialog("regexpwndtitle:=Print")
Set winbtn_CalcelPrint = dialog_Print.WinButton("regexpwndtitle:=Cancel")
fn chckprintpopupwndow
()
{ ''''''''Navigating to that page
call Absolutehighlight(Button_Action)
call Absolutehighlight(Meter_Entry)
call Absolutehighlight(PrintMeter_Opt2)
AbsoluteClick
(PrintMeter_Opt2)
EnterMeters_Window
.WebElement("html id:=ctl00_Save_BTN_C").Click
'''''''By click on abve option window popup print option appears and UFT not identifying that window all times, so clicking on cancel button not doing so TC fails
dialog_Print
.Activate
AbsoluteClick
(winbtn_CalcelPrint)
EnterMeters_Window
.WebElement("html id:=ctl00_Cancel_BTN_C").Click
}
  • You must to post comments
0
0

Your issue may be related to you storing references to objects before you have navigated to the page on which they exist.

Instead, after clicking on the button that opens the Print dialog try something like this (remembering to put in the relevant object identifiers):

Window().Dialog().Activate
AbsoluteClick Window
().Dialog().WinButton()
Window
().WebElement().Click
  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website