Forum Discussion

Adagio's avatar
Adagio
Frequent Contributor
7 years ago

How to detect a Mask-Overlay on any object

Hello,

 

I'm running into some issues to detect a mask-overlay in an Angular app. 

Issue: When I click a button 'Update', there's a process running to make updates, and till the time this process runs, there's a mask-overlay on the controls. At this time, click on controls(buttons underlying the overlay)  wouldn't work, but the some of the properties of the button such as Enable, Exists and Visible are 'True'.  I'm looking for ways to wait for the overlay to disappear before taking any other user actions. Any help would be appreciated!

 

Thank you

Abhi 

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    We have something similar... it's a panel (DIV) in the HTML that is made visible when such a thing happens.  We wrote a little bit of code to check to see if the panel is visible and, if it is, wait for it to go away.

     

    function waitForLoading(timeout) {
        var loadingForm;
        var counter = 0;
        if ((timeout == undefined) || (timeout == null)) {
            timeout = 60;
        }
        Aliases.browser.panelLoading.RefreshMappingInfo();
        Aliases.browser.panelLoading.WaitProperty('Visible', true, 5000);
        while ((Aliases.browser.panelLoading.Visible) && (counter < (timeout * 2))){
            aqUtils.Delay(500, 'Waiting for loading panel to close');
            counter++
        }    
    }

    Obviously, the object itself is going to be different for you than for us so your Aliasing/Mapping would be different.... but this is what we do...

     

    Generally speaking, you as the tester know when these such things should come up so you can add this detection code in to wait for it when you know it's expected.