![]() |
Performance Issues Using '.Exist' - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Performance Issues Using '.Exist' (/Thread-Performance-Issues-Using-Exist) |
Performance Issues Using '.Exist' - AndyBSG - 12-10-2014 Wondering if anyone can advise me on a performance issue i'm having. On our GUI we have a static text box that may or may not appear depending on the type of transaction that is being processed. As part of my test script if the box does not appear on the screen(which it won'ty do for 99% of the transactions we process), then I want to break out of my processing loop using the following code. Code: If objObject.Exist = False then Exit Do The issue is that adding this test in has seen my scripts go from processing a test every 4 to 5 seconds to now taking almost 30 seconds so has increased the runtime by almost 6 times what it was. Is this just becasue exists isn't very performance friendly or is there some trick or different way of coding it to bring that delay down? If it's any help, here are the attributes of the object being tested. Code: "Class Name:=Static", RE: Performance Issues Using '.Exist' - SteveS - 12-11-2014 Put the maximium wait time in brackets after the exist so: .exist(5) will only wait five seconds before moving on, if you do not specify a wait time I think qtp will wait your default sync time which is probably 25secs going by your example. RE: Performance Issues Using '.Exist' - AndyBSG - 12-12-2014 Cheers SteveS, that worked perfectly. Didn't realise the default wait time is a whopping 20 seconds unless you specify otherwise |