When you are testing a web application that has popup windows (where the popup is a whole new browser window) you will need to make a slight change to the test script to enable it to playback successfully in Internet Explorer (no change is needed for Chrome or Firefox).
If you look at the example website: http://www.libraryinformationsystem.org/popup/parent.html



you will see that we have a button that opens a popup window. If you record a simple script to click on the Open Popup button and then in the window that appears click on Click Me and then Close Me, you will get the following script:

function Test
()
{
    //Click on Open popup
    SeS('Open_popup').DoClick();
       
    //Click on Click me
    SeS('Click_me').DoClick();
    //Click on Close me
    SeS('Close_me').DoClick();
}


If you play this back using Chrome or Firefox it will work correctly as-is. However for IE, we need to add a special function to the *.user.js file of user functions to allow Rapise to connect to the appropriate window:

function AttachToWindow()
{
    switch(g_browserLibrary)
    {
        case 'Internet Explorer HTML':
            // StartTrackingIE
            StopTrackingIE(false);
            g_ieNavigator.process = 0;
            break;
    }
}


Now you need to call this command whenever you want to change between the popup and the main window:

function Test()
{
    //Click on Open popup
    SeS('Open_popup').DoClick();
   
    AttachToWindow();    //Connect to new window
   
    //Click on Click me
    SeS('Click_me').DoClick();
    //Click on Close me
    SeS('Close_me').DoClick();
   
    AttachToWindow();    //Connect to main window
}


Attached to this article is the complete sample test with the function already written.
Attachments

Selected files will be attached to any email sent on saving ticket.

file selected files selected  () Delete Selected

  • Created:
  • by:

Select files to upload

Or drag and drop files here

Uploading …
Done!
Upload More?
There was an error.
Try again?

Save to upload the selected file(s)

Article Info
  • Last Updated: 10/27/2016
  • Article ID: KB224
  • Views: 801