Ranorex hanging on looking for non existent forms

Bug reports.
User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Ranorex hanging on looking for non existent forms

Post by artur_gadomski » Fri Jul 30, 2010 1:38 pm

Hi
I am using Ranorex 2.3.2

I have a problem with looking for non existent forms. After I click a button a form should appear but sometimes it doesn't so in my test I make sure that the form appeared before moving on. Problem is sometimes, not always, Ranorex hangs itself while searching for that form.
I tried:
class Program {
public static MyRepository repo = new MyRepository(); 
...
public static void Test() {
    if (repo.SomeForm.OKInfo.Exists()) //OK is a button on form
}
class Program {
public static MyRepository repo = new MyRepository(); 
...
public static void Test() {
    if (repo.SomeForm.SelfInfo.Exists()) 
}
class Program {
...
public static void Test(){
    MyRepository repo = new MyRepository(); 
    if (repo.SomeForm.SelfInfo.Exists())
}
class Program {
...
public static void Test(){
    MyRepository repo = new MyRepository(); 
    if (Validate.NotExists(repo.SomeForm.SelfInfo, "SomeForm does not exist.", false))
}
If Ranorex hangs I pause it and debuger allways points to 'if' line.
I know I could also try to use path to look for this form but I'm trying to avoid hard coding paths into my test. Is there a different way to check existence of a form?
Is there some way to get more information from debugger when it happens?

This is a big problem for me because when I check my overnight test run I often find that last log message is half an hour after I left work and the tests is hanging.

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 hanging on looking for non existent forms

Post by Support Team » Mon Aug 02, 2010 2:33 pm

Hi,

We tried to reproduce your behavior without success. Please can you post us some additional information.
  • Which technology do you automate with Ranorex?
  • Is there an exception or warning in Ranorex Report?
  • Is there only an "if" in the code or also an "else" block. If yes, what does the "else" block execute?
  • Which timeout is set for the object in repository?
Thanks in advance.

Regards,
Peter
Ranorex Team

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: Ranorex hanging on looking for non existent forms

Post by artur_gadomski » Tue Aug 03, 2010 6:24 am

Hi
I am not supprised you can't reproduce it as like I said it happens only once in a while.

I am automating a windows application written in C# on 64 bit Windows 7
There is no exception. XML Test report is not generated(or incomplete as id doesn't appear after stoping execution) but I used console logger to check all logs.
I use simmilar structure in a few places. If there is else block it only does simple reporting. I also use same statement with while loop.
I had timeout set to 5m, since then I reduced it to 30s

Right now I'm trying out Validate.NotExist() method with string parameter for path.

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 hanging on looking for non existent forms

Post by Support Team » Thu Aug 05, 2010 11:55 am

I'm really curious how that hang can happen. All of the methods you tried internally use the same method to search for elements using the given timeout. So, if one Exists method hangs, all others will most probably do the same.
artur_gadomski wrote:If there is else block it only does simple reporting.
Do you mean that if there is an else block, the code does not hang? Could you post a snippet of code that uses your Test method?

To drill down on that problem I need answers to the following questions:
  • Do you experience that behavior only with a single application/control?
  • Can you check the CPU load when execution hangs? That gives us a hint whether it's a busy loop or a deadlock.
  • Does the automated application use Windows Forms or WPF?
  • It could be a problem caused by the Ranorex 32/64 Bit Bridge: Do both the automating and the automated application run in processes using the same bit width (32 vs 64 bit)? (See this section in the Ranorex User Guide.) Please, try to disable the Ranorex bit bridge in the configuration's "General" tab (see User Guide).
Regards,
Alex
Ranorex Team

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: Ranorex hanging on looking for non existent forms

Post by artur_gadomski » Fri Aug 06, 2010 6:33 am

I never looked if code hanged only in statements without else block but my guess would be not.
After I come back from my holiday I will work on stabilizing my tests and try to gather more data.
I haven't noticed the tests hanging lately but probably because they crash before they have a chance to.
I also switched from runing tests from Ranorex Studio to Visual Studio 2008 although I doubt this has anything to do with it.

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 hanging on looking for non existent forms

Post by Support Team » Fri Aug 06, 2010 9:15 am

artur_gadomski wrote:I never looked if code hanged only in statements without else block but my guess would be not.
That would be my guess, too. I just did not know what you meant by "If there is else block it only does simple reporting." in your previous post.

When you have time, please report back on the questions from my previous post. Have a nice holiday! :D

Regards,
Alex
Ranorex Team

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: Ranorex hanging on looking for non existent forms

Post by artur_gadomski » Fri Aug 20, 2010 6:40 am

My tests have been runing with various results for the last week, but none of them hanged so far.
I have changed a couple of things since hanging:
Moved to VisualStudio 2008.
Upgraded to Ranorex 2.3.3
Changed target .Net Framework from 1.0 to 3.5,

Should my hanging behaviour return so shall I :)