Forum Discussion

nakshatra's avatar
nakshatra
Contributor
6 years ago

how to wait for data change in same object

Hi All,

 

I have one object it will display 2 different values. 

1. Loading data.

2. Search result-(100)

 

Object name in namemapping: Aliases.browser.panel.searchobject

Actions:

After clicking on search button. First Loading Data will display and after some time serach result-(100) will get display.

 

Now I need to check the count with property check point. But my test case is getting failed. Before coming search result data it is taking Loading Data and performing comparision.

 

Can anyone help me how to wait up to the data change.

 

Thanks in Advance.

 

Regards,

Nakshatra

  • Here is a piece of code that we use for something similar in our web application.  I'd recommend adapting this for your situation to wait for the Loading to go away before proceeding.

     

    function waitForLoading(timeout) {
        var loadingForm;
        var counter = 0;
        if ((timeout == undefined) || (timeout == null)) {
            timeout = 60;
        }
        if (Aliases.browser.WaitAliasChild('panelLoading', 10000).Exists){
            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++
            }    
        }
    }
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Here is a piece of code that we use for something similar in our web application.  I'd recommend adapting this for your situation to wait for the Loading to go away before proceeding.

     

    function waitForLoading(timeout) {
        var loadingForm;
        var counter = 0;
        if ((timeout == undefined) || (timeout == null)) {
            timeout = 60;
        }
        if (Aliases.browser.WaitAliasChild('panelLoading', 10000).Exists){
            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++
            }    
        }
    }
    • nakshatra's avatar
      nakshatra
      Contributor

      Thanks for the reply.

       

      It's working.

       

      Regards,

      Nakshatra.