Knowledge Base Article

Home Page > Knowledge Base > Rapise

Home Page > Knowledge Base > Rapise > Rapise Web

Article Testing Popup Windows using Internet Explorer

by Adam S on Thursday, October 27, 2016

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
Article Info
Last Updated: 10/27/2016
Article ID: KB224
# Views: 229
Powered by KronoDesk v1.1.0.15 | © Copyright Inflectra Corporation 2011-2017 | Licensed to Inflectra Corporation.