Page 1 of 1

Mouse click on button not consistently working

Posted: Thu Jun 23, 2016 5:02 pm
by relimed
Hello,

Just getting started with Ranorex with our Windows desktop application and using a Validation step for the button before the mouse click. However, even though Ranorex is reporting successful validation and the mouse click, it is not registering with our app every time.

Reports:
00:03.296 Info Validation

Validating AttributeEqual (Text='Continue') on item 'SelectCustomerDialog.ButtonContinue'.
00:03.593 Success Validation

Attribute 'Text' of element for item 'ReLiMedMasterRepository.SelectCustomerDialog.ButtonContinue' does match the specified value.
00:03.718 Info Mouse

Mouse Left Click item 'SelectCustomerDialog.ButtonContinue' at 47;14.

Should I try a wait for or can I change the location to "Center"? I tried changing location of click to Center but it did not save.

This is happening for all buttons I have tried so far.

Thanks,
Lisa

Re: Mouse click on button not consistently working

Posted: Fri Jun 24, 2016 3:37 pm
by stapes
It might be worth checking the 'Enabled' state of the button. You can add and @enabled='true' to the repo item xpath or wait for enabled==true in your code.

Re: Mouse click on button not consistently working

Posted: Fri Jun 24, 2016 4:40 pm
by krstcs
It sounds like the button text is changing as well.

I would suggesting, instead of using a validation step, that you create a copy of the repo element and add "and @enabled='true' and @text='Continue'". You can have as many copies of the same element as you want as long as the names are different, and you can adjust each one's path to look at different properties of the element, so you could have something like this:

Assume you have a single button (in a parent container with id='myContainer') that changes names, the following button repo items can all point to it, depending on the state of the button. The first would be used to validate properties because it is generic, the other two would be used to make Ranorex only find the element if they have the specified text value.

Code: Select all

Container => //container[@id='myContainer']
----Button          => /button
----Button_OK       => /button[@text='OK']
----Button_Continue => /button[@text='Continue']