Ranorex

timing issue with ControlGetState and ElementGetState?

 
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexPython
View previous topic :: View next topic  
Author Message
jasong



Joined: 26 Oct 2007
Posts: 49
Location: Texas

PostPosted: Wed Dec 05, 2007 11:55 pm    Post subject: timing issue with ControlGetState and ElementGetState?
I am noticing something I just can not explain yet.

When I run my script that checks the state of a control, I am getting for that state a number like '1048577'.

This happens if I use the control or the element.

However, if I step through the code in my IDE (WingIDE) then it correctly returns the state of 1 (unavailable).

I have manually introduced sleep time but that does not seem to do the trick.
Back to top
View user's profile Send private message
Support Team
Site Admin


Joined: 07 Jul 2006
Posts: 344

PostPosted: Thu Dec 06, 2007 12:25 am    Post subject:
Quote:
When I run my script that checks the state of a control, I am getting for that state a number like '1048577'.


1048577 Dec = 100001 Hex
This means STATE_SYSTEM_UNAVAILABLE & STATE_SYSTEM_FOCUSABLE

If you step through the code, then the control is not focusable, so you get only STATE_SYSTEM_UNAVAILABLE = 1.

The State property has bit flags, you can check the state of an element as follown:

Code: click into code to enlarge
if state & Ranorex.STATE_SYSTEM_CHECKED:
    print 'Checked'
if state & Ranorex.STATE_SYSTEM_SELECTED:
    print 'Selected'

Jenö
Ranorex Team
Back to top
View user's profile Send private message Visit poster's website
jasong



Joined: 26 Oct 2007
Posts: 49
Location: Texas

PostPosted: Mon Dec 10, 2007 9:24 pm    Post subject:
awesome!
thank you for your clarification
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexPython All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum