Pressed() Validation against "Push Button"?

Ask general questions here.
Posts: 68
Joined: Wed Jun 29, 2016 1:19 pm
Location: Frankfurt, Germany

Pressed() Validation against "Push Button"?

Post by dugovic.milan » Thu Feb 16, 2017 9:50 am

Hey guys... Did anyone successfully manage to use Validation Pressed() against "Push" type of button? I'm having issues in my test scenario which is most likely too fast for my execution. Every test case ends with pressing on confirmation button of type "push", but in most cases the button behaves like "out of focus" and the test case eventually fails which is why I'm forced to use InvokeAction(). Such an approach guarantees a successful execution, but still I'm not able to verify if it's "true" and the impartial observer that is checking the course of the test scenario doesn't have a clue what's going on then... The individual steps are just well structured enough and using the same sequence during manual process the test never fails as well.

For those who don't have a clue either, the state "Pressed" by "Push" type of button changes just in the moment of user action. Good example of complete opposite would be something like ON/OFF button that requires user action to change its "Pressed" state.

What is your approach in terms of Push Button Validation? Thank you for your ideas!
Ranorex Explorer @DVAG
Support my Ranorex Ideas & Improvements
My current approach: Ranorex 9.2.0

User avatar
Posts: 450
Joined: Fri Jul 15, 2016 1:35 pm

Re: Pressed() Validation against "Push Button"?

Post by Stub » Thu Feb 16, 2017 12:44 pm

On "PushButton" controls I've been using the "AccessibleState" attribute to determine if they're depressed or not. I look for "Checked" in the state value. That lets me determine whether I need to click them or not to toggle their state as I require.

Not sure if that is applicable to your scenario however.