Page 1 of 1

Ranorex does not continue to perform the following commands

Posted: Fri May 20, 2011 2:26 pm
by Dmitry
Hi, there is one problem.
I automate the installation of one application at one moment when clicking on the NEXT button on the form of installation the new form appears and runs the installation of the database without user intervention, during this time this button is pressed. After the database is installed, I can not do anything else, as Ranorex 3.0.1. does not respond.
//...
repo.App.Database.ButtonNext.Click();//It's problem button
//Installation Microsoft SQL Server, no action is taken, use delay
Report.Info("Database", "Database installed successfully");//this string is entered to the console
Ranorex.Form DatabaseForm = Host.Local.FindSingle("/form[@controlname='DatabaseInstallWizardForm']", 15000);//this command doesn't run and Ranorex will run until it is stopped
As I understand button wait response, because if use Press() method, test case fail with error, that button didn't response during 2 seconds.
How to make the code continues to run?

Re: Ranorex does not continue to perform the following commands

Posted: Fri May 20, 2011 7:17 pm
by slavikf
I not sure, if i have related issue, but i saw few cases, when Ranorex was just stuck at some steps, and was not performing command. And i only could stop it. But for me it usually works, if i restart it. Seems like you got the case, when it doesn't work at all :-(

Re: Ranorex does not continue to perform the following commands

Posted: Fri May 20, 2011 7:59 pm
by Ciege
I've not seen this issue but I too have a script that installs MS SQL.
Do you happen to have a modal window that is open that is waiting for input and not returning control back to Ranorex? It could be that...

Re: Ranorex does not continue to perform the following commands

Posted: Fri May 20, 2011 10:37 pm
by Dmitry
When installing MS SQL I don't have modal windows what waiting for inputting some data, but I think some element doesn't return control back to the Ranorex, but I don't know what to do in such situation. Can you advise something?
Such situation happens not only in this case but in similar too.

Re: Ranorex does not continue to perform the following commands

Posted: Fri May 20, 2011 10:47 pm
by Ciege
I can't give you any specific help since I've not seen the issue but some things to try would be:

1) Make sure to wrap your code in a try/catch block and see if an exception is getting thrown.
2) After you click the Next button, but before you try to Find the database wizard install form, put in some code to wait for the window the next button is on to go away, thus verifying that that current window is out of view.
3) Run your code in debug and break just before this all happens. Bring up a watch window to watch var states then manually step through each line to try and determine the issue.

Re: Ranorex does not continue to perform the following commands

Posted: Sat May 21, 2011 7:51 am
by Dmitry
Ciege, thanks for your answer.
1) When I use try/catch no exception occurred.
2) I make verification for existing form.
3) In debug mode everything is OK and next command always run without any problems.

Re: Ranorex does not continue to perform the following commands

Posted: Mon May 23, 2011 6:01 pm
by Support Team
Dmitry wrote:3) In debug mode everything is OK and next command always run without any problems.
Could you clarify what you mean by "debug mode"? Does this mean when you step through the code with the debugger, you do not experience the hanging issue?

If so, please try to add a short delay of a seconds or so after clicking the button. That's only a bad workaround, but maybe it helps until we get to the real source of the problem.

Could you provide us with a sample application and Ranorex code that we can reproduce the problem with?
And possible a Ranorex snapshot of the problematic application? Thank you!

Regards,
Alex
Ranorex Team

Re: Ranorex does not continue to perform the following commands

Posted: Mon May 23, 2011 9:50 pm
by Dmitry
Support Team wrote:Could you clarify what you mean by "debug mode"? Does this mean when you step through the code with the debugger, you do not experience the hanging issue?
Yes, when I debug code no exception or error occurred and this issue doesn't reproduce. I think that step by step debuging interrupts the execution of processes, which are responsible for the crash.
How can I look additional information about the command performance in the Ranorex?
Support Team wrote: If so, please try to add a short delay of a seconds or so after clicking the button. That's only a bad workaround, but maybe it helps until we get to the real source of the problem.
I added delay, but this didn't help.
Support Team wrote:Could you provide us with a sample application and Ranorex code that we can reproduce the problem with? And possible a Ranorex snapshot of the problematic application? Thank you!
For this moment I can not provide sample application.

One time when I debugged this command the IPC error occured, so I tried to disable BitBridge in the code before button clicking, but in such case this element didn't find at all.

Re: Ranorex does not continue to perform the following commands

Posted: Tue May 24, 2011 6:04 pm
by Support Team
Dmitry wrote:I added delay, but this didn't help.
I still think this is a timing issue, otherwise I cannot explain that it does not occur when debugging. How did you add a delay?

Please, insert following code before and after the command that blocks (causes Ranorex to sleep for 5 seconds):
System.Threading.Thread.Sleep(5000);
Dmitry wrote:For this moment I can not provide sample application.
Without a sample application this problem will be hard to get by. The only thing we can try then is the delay before/after the command as I suggested above.

Regards,
Alex
Ranorex Team

Re: Ranorex does not continue to perform the following commands

Posted: Tue May 24, 2011 9:44 pm
by Dmitry
Support Team wrote:How did you add a delay?
I used simple Delay.Seconds(5).
Support Team wrote:Please, insert following code before and after the command that blocks (causes Ranorex to sleep for 5 seconds):
Code with changes:
System.Threading.Thread.Sleep(5000);
repo.App.Database.ButtonNext.Click();//It's problem button  
System.Threading.Thread.Sleep(5000);
Report.Info("Click the problem button");//this string is entered to console
Report.Info("Next commands);// this string doesn't enter to console
Ranorex.Form DatabaseForm = Host.Local.FindSingle("/form[@controlname='DatabaseInstallWizardForm']", 15000);
When I press Pause button Ranorex highlight Report.Info("Click the problem button") and pressing F10 do nothing. But if run step by step debug it's pass successfully.

I also noticed that if after this fail, run this case one more time, it's pass without any problem (I use virtual machine with Ranorex snapshot to test clean installation).

Re: Ranorex does not continue to perform the following commands

Posted: Thu May 26, 2011 12:50 pm
by Support Team
Hi,
Dmitry wrote:When I press Pause button Ranorex highlight Report.Info("Click the problem button") and pressing F10 do nothing.
What do you mean by pressing the "Pause Button"? The pause button affects Ranorex to abort your script.
You are trying to automate an installer. Is this correct? If yes, which type of installer is it?
Dmitry wrote:But if run step by step debug it's pass successfully.
Do you changed the search timeout in your repository? Maybe Ranorex needs more time to find your element.
Dmitry wrote:For this moment I can not provide sample application.
As Alex wrote, without a sample application this problem will be hard to get by. A sample application and your Ranorex project would be very helpful to nail down your issue.

Regards,
Peter
Ranorex Team