Forum Discussion
OK, Nuanced variation of the same question:
More detail:
If this table is on the page it will be there the moment the page is rendered and it just gets popped up when a callback starts and moved back when the callback ends, so the only thing that changes is the VisibleOnScreen property
How would you go about distinguishing between an item that doesn't exist anywhere on the page (not in the HTML) and an item that took too long to exist ? In both cases a .Findxxx would come back after some time with a stub. If it is because the table is on the page but TC couldn't find it in time, theres something wrong with the page and I want to at least log a warning. If it's not there at all in the HTML it means I have no controls on the page that call the loading panel, so I can skip right obver this and continue. I can survive without this to be honest, but it would be useful to be able to make sure those control changes run smoothly without having to know beforehand on each page if it has a loading panel or not and write tests ccordingly
Well...
It is a usual and well-known problem with Ajax-enabled pages when they do not contain an indicator that all processing on the page has been completed - when test code fails to find the dynamic objects like LoadingPanel, it is not easy to determine whether the object was not found because the given data processing is over and the object has already been removed from page DOM (so there is no reason to wait for it) or because the data processing has not been started yet (for example, because of slow network or backend overload and thus the code must continue to wait for the object).
How would you go about distinguishing between an item that doesn't exist anywhere on the page (not in the HTML) and an item that took too long to exist ? In both cases a .Findxxx would come back after some time with a stub.
No. If the object is not in the page DOM, then indeed .FindChild() or .FindChildEx() returns an empty stub and testcode must wait until the object appears. (Or the timeout defined by quality of service requirements elapses. In case such requirements exist.)
If test code should delay until the object is gone (e.g. LoadingPanel is hidden), then test code may use the .WaitProperty method. For the discussed example the code may be like this:
LoadingPanel = Aliases.<container>.FindChildEx('loadingPanel', 60000);
// some data processing is triggered here
...
// wait until the data processing is over
LoadingPanel.WaitProperty('Visible', false, 60000);
...
Related Content
- 10 months ago
- 4 months ago
Recent Discussions
- 2 days ago
- 2 days ago
- 5 days ago