Forum Discussion

hassan_arshad's avatar
11 years ago
Solved

Event handler does not trigger for an overlapping window in HTML5 based web app

Hi,



I have created an event handling routine for an overlapping window that appears in out HTML5 based application. The window appears when there are unsaved changes present on the screen and the screen is tried to Refresh.

The problem is that the Event handler is not being triggered and the window remains intact hampering the test execution process (We do not intend to check “Ignore Overlapping Window” option in project properties).

The event handler routine is as follows:



//USEUNIT GenericObjects

 

function GeneralEvents_OnOverlappingWindow(Sender, Window, OverlappingWindow, LogParams)

{

  var leaveBtn= GenericObjects.LeaveButton();

  var leaveExists = leaveBtn.Exists;

  if (leaveExists == 1){

    leaveBtn.Click();

    Project.Variables.CurrentScreenObject.WaitChild("Textbox*",1000);

        }

  else {

   Project.Variables.CurrentScreenObject.WaitChild("Textbox*",1000);

    }

}

 

The NameMap of the Leave button is as follows:

Sys.Browser("iexplore").Page("http://v303m5qa/m5web/Presentation/Common/CSILogon.aspX?m5site=m5qaora&SessKey=SAUG8VTR7B3&cnum=&wid=0").Panel(6).Panel("dialog_area1").Panel(0).Button(0)

 

We are finding this object through FindChild method in the Generic Objects file.

function LeaveButton(){// leave button on Refresh

  Delay(1000);

  Project.Variables.HomeScreenObject.WaitChild("Button(0)", 10000);

  var leaveBtn= Project.Variables.HomeScreenObject.FindChild("contentText", "Leave", 100);

  var leaveDialog= Project.Variables.HomeScreenObject.FindChild("ObjectIdentifier", "dialog_area1", 100);

  var leaveDlgExists= leaveDialog.Exists;

  var leaveExists= leaveBtn.Exists;

  if (leaveDlgExists==1){

    if(leaveExists==1){

     return leaveBtn;

      }

    else{return 0}

  }

  else {

    return 0

    }

 

  }



 Please let me know the causes of the event handler not being triggered, or if I am making some mistake



Best Regards
  • Hi Hassan,

    The Overlapping Window event will not trigger if the overlapping window does not have a frame.



    I also have exactly the same problem as you.  To get around it I look to see if the element which makes the Overlapping Window exists.

1 Reply

  • Hi Hassan,

    The Overlapping Window event will not trigger if the overlapping window does not have a frame.



    I also have exactly the same problem as you.  To get around it I look to see if the element which makes the Overlapping Window exists.