Is there any Sync function to AJAX frames? - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: Is there any Sync function to AJAX frames? (/Thread-Is-there-any-Sync-function-to-AJAX-frames) |
Is there any Sync function to AJAX frames? - QTP_Gaspar - 09-03-2010 Hi ! I have a problem on my scripts about wait time to load pages. Ok, I use the function Brownser(xxx).Page(xxx).Sync to make the QTP wait the page load completely. But I am testing a webpage in C#, with some frames in AJAX. There are some process in the webpage, that doesn`t load the page, but the frame loads. What I mean is that the page will not refreshed, but the system will take some seconds to load some information in the AJAX frame. I was using the WAIT() function to these cases, but it`s terrible because the wait time for the frame is always changing. I am using like Wait(15), it's too much time. So pleeease.... is there anyone able to help me with this issue? I was thinking maybe there is a function on the QTP like: Brownser(xxx).Frame(xxx).Sync.... but I guess not, heheheh... I am not sure if I was clear, sorry... I hope yes! Thank you very much !!! RE: Is there any Sync function to AJAX frames? - cdesserich - 09-08-2010 There are several ways to do dynamic waits for AJAX calls. It all depends on what is changing on the page. For example, sometimes an object exists on the page, but is just hidden, either by having coordinates off the visible area, or by having a height and width of 0, or by having the visible property set to false. Otherwise, objects can be inserted into the DOM via an AJAX call. All of these scenarios require different code. The following examples are registered functions so that they can be called on a WebElement directly. To illustrate waiting for a specific object to have a height and width greater than 0 (thereby making the object visible): Code: '@Description Waits until the test object has width and height greater than zero, pass Null for timeout to accept default of 10 seconds. To wait for the existence of an object: Code: '@Description Waits until the test object exists, pass Null for timeout to accept default of 10 seconds. RE: Is there any Sync function to AJAX frames? - QTP_Gaspar - 09-11-2010 Thank you very much man !! You cleared my mind, and I could solve the problem. Thank you very much. |