Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Performance Issues Using '.Exist'
#1
Solved: 9 Years, 11 Months, 2 Weeks ago
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",
"abs_x:=1535",
"abs_y:=704",
"attached text:=3rd Party ML Verified",
"enabled:=True",
"focused:=False",
"height:=20",
"hwnd:=6161660",
"nativeclass:=Static",
"object class:=Static",
"regexpwndclass:=Static",
"regexpwndtitle:=Yes",
"rightaligned:=False",
"righttoleftlayout:=False",
"righttoleftreading:=False",
"text:=Yes",
"va_name:=",
"visible:=True",
"width:=32",
"window id:=1210",
"windowextendedstyle:=516",
"windowstyle:=1342308352",
"x:=849",
"y:=89"


Reply
#2
Solved: 9 Years, 11 Months, 2 Weeks ago
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.
Reply
#3
Solved: 9 Years, 11 Months, 2 Weeks ago
Cheers SteveS, that worked perfectly.

Didn't realise the default wait time is a whopping 20 seconds unless you specify otherwise
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Exist and Visible Are True When Objects Aren't There - Is there A Better Way? zunebuggy 3 3,150 04-24-2018, 02:12 PM
Last Post: Ankur
  Time Delay issue with Exist mv8167 11 24,841 06-19-2017, 02:56 PM
Last Post: grosorg
  datatable column exist diya 3 12,559 12-11-2012, 11:24 AM
Last Post: elango87
  Check if exist not selected radiobutton sedin 6 7,777 09-12-2012, 12:55 PM
Last Post: sedin
  QC Install issues manisun 0 11,138 08-15-2012, 02:01 AM
Last Post: manisun

Forum Jump:


Users browsing this thread: 1 Guest(s)