Ranorex does not continue to perform the following commands

Ask general questions here.
Dmitry
Posts: 5
Joined: Fri May 20, 2011 2:05 pm

Ranorex does not continue to perform the following commands

Post by Dmitry » Fri May 20, 2011 2:26 pm

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?

User avatar
slavikf
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada
Contact:

Re: Ranorex does not continue to perform the following commands

Post by slavikf » Fri May 20, 2011 7:17 pm

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 :-(

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Ranorex does not continue to perform the following commands

Post by Ciege » Fri May 20, 2011 7:59 pm

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...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

Dmitry
Posts: 5
Joined: Fri May 20, 2011 2:05 pm

Re: Ranorex does not continue to perform the following commands

Post by Dmitry » Fri May 20, 2011 10:37 pm

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.

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Ranorex does not continue to perform the following commands

Post by Ciege » Fri May 20, 2011 10:47 pm

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.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

Dmitry
Posts: 5
Joined: Fri May 20, 2011 2:05 pm

Re: Ranorex does not continue to perform the following commands

Post by Dmitry » Sat May 21, 2011 7:51 am

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.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Ranorex does not continue to perform the following commands

Post by Support Team » Mon May 23, 2011 6:01 pm

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

Dmitry
Posts: 5
Joined: Fri May 20, 2011 2:05 pm

Re: Ranorex does not continue to perform the following commands

Post by Dmitry » Mon May 23, 2011 9:50 pm

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.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Ranorex does not continue to perform the following commands

Post by Support Team » Tue May 24, 2011 6:04 pm

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

Dmitry
Posts: 5
Joined: Fri May 20, 2011 2:05 pm

Re: Ranorex does not continue to perform the following commands

Post by Dmitry » Tue May 24, 2011 9:44 pm

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).

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Ranorex does not continue to perform the following commands

Post by Support Team » Thu May 26, 2011 12:50 pm

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