Page 1 of 1

Attempted Mouse click causes move to top left corner

Posted: Thu Apr 29, 2010 8:14 am
by markvanraalte
Hi,

I am testing a web application (with Ranorex C#) and at one point I need to confirm a dialog alert by clicking on the OK button.

I simply perform the click method on the OK button using:

repo.WebDocumentName.GenericTicketDialog.CloseButton.Click() he name of the button I have taken from the repository.
Sometimes this works fine but sometimes (intermittantly) it fails to click() on the button and moves to the top left corner of the web application. Is there a work around?
Should I test to see if the button exists?

I've tried:
if ( repo.WebDocument.GenericTicketDialog.CloseButtonInfo.Exists())

But that always seems to return true.

How can I fix this?

Re: Attempted Mouse click causes move to top left corner

Posted: Thu Apr 29, 2010 3:12 pm
by Support Team
Hi!

In extreme exceptions it can be possible that the item is valid and short after the item gets the state invalid, but that happens almost never.
markvanraalte wrote:I've tried:
if ( repo.WebDocument.GenericTicketDialog.CloseButtonInfo.Exists())
But that always seems to return true.
Can it be possible that this dialog always exists on your webpage (only set from visible to invisble and vice versa) and it's not generated by an action.
Please copy the path of the element from repository and paste it to SPY so you can check if the element always exists (Dialog should not be visible). This can be a possible solution why you always get true of method Exists().

BTW, I've also tried it with a Dialog in some webpage and the Exists() worked as expected.
Visible -> Exists = true
Not Visible -> Exists = false

Regards,
Peter
Ranorex Support Team