Page 1 of 1

How to do event handling using Ranorex

Posted: Tue Mar 04, 2014 10:22 pm
by AnishJ
Hi,

Environment:
Flash/Flex application
Web testing

Scenario/Issue:
Sometimes our test cases failed because of not recognizing the button clicks (elements already identified and added in repository)

Reason:
In our application the mouse pointer turns to busy icon image (flash object) when it takes longer time for page submission/load after an action (for e.g.: Click Edit button).However, Ranorex could not identified this change in the mouse pointer (i.e.; normal pointer to busy icon). So it assumes the Edit button click went through successfully and it starts executing the next step in test case. The next action (for e.g.: Click Save button -identified in repository) starts and Save button not appears in the form (User Interface) as mouse pointer is still busy mode.

Could please advice?


Thanks,
AJ

Re: How to do event handling using Ranorex

Posted: Wed Mar 05, 2014 4:39 pm
by Support Team
Hello AJ,

I suggest to add a Webdocument.WaitForDocumentLoaded()-method to your recording in order to overcome the timing issue. If the loading is handled within the flash/flex object itself (the page doesn’t reload) please add a Delay()-method to your recording before the next steps are performed.

Regards,
Robert

Re: How to do event handling using Ranorex

Posted: Mon Mar 10, 2014 10:25 pm
by AnishJ
Hi Robert,

Thanks for the reply,

Could you please let me know how to add Webdocument.WaitForDocumentLoaded()-method in Ranorex Studio. I could not see this option under Add New Action drop down in Recording Module.
Please advise!

Regards,
Anish

Re: How to do event handling using Ranorex

Posted: Mon Mar 10, 2014 11:03 pm
by odklizec
Hi,

You need to create a new User Code action (via Add New Action drop down), in which you can use the suggested method. Here is how the code should look like...
WebDocument webDoc = @"/dom[@domain='your.webpage.com']";
webDoc.WaitForDocumentLoaded();
Alternatively, you can use Wait For Exists action, but this requires recently released Ranorex 5.0. Last option is to write your own Wait method.