cancel
Showing results for 
Search instead for 
Did you mean: 

how to wait for data change in same object

SOLVED
Contributor

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

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: how to wait for data change in same object

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++
        }    
    }
}

Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

2 REPLIES 2
Community Hero

Re: how to wait for data change in same object

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++
        }    
    }
}

Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

Highlighted
Contributor

Re: how to wait for data change in same object

Thanks for the reply.

 

It's working.

 

Regards,

Nakshatra.