Windows 7 sp1
Ranorex Version 4.0.4.23593
.Net Runtime 4.0.30319.18052
I am automating an application that brings up another form window when you click on a button in the Main Application.
With Spy, I have been able to identify all of the elements in the sub-form. However, when I run the test (I write my tests in C#), ranorex hangs trying to act on the sub-form. It doesn't time out, it just hangs there. I've tried validating the sub-form, but the same thing happens, ranorex just hangs.
If I click Highlight in Spy, it highlights the elements with no problem.
Is there a reason that Ranorex would not timeout while trying to perform an action on an element?
A couple more pieces of info. In Spy, the sub-form is not a child of the main form, it's viewed as it's own form. Also, the main application goes into a not responding state when the sub-form is open.
Spy can find sub-form, but test stalls when trying to act.
Re: Spy can find sub-form, but test stalls when trying to act.
What is your code for finding the new form? Since the new form is a child of the host and not of your AUT you need to root your find at the host level.
Whis may be the reason for the hang in Ranorex. If Ranorex is trying to query the AUT elements for the new form (if indeed you rooted your find at the form level) it *may* be that the AUT is not releasing control to Ranorex to be able to conduct the find?Also, the main application goes into a not responding state when the sub-form is open.
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...
Ciege...
Re: Spy can find sub-form, but test stalls when trying to act.
Ranorex Spy doesn't show the sub-form as a child of the Main form (The form is nested directly below the Host). So I'm not sure if that's the issue.
One thing I just found out was that Ranorex is able to interact with the sub-form if the sub-form is open when I run the test. But if the test opens that sub-form, it is unable to interact with it. The same thing happens if I try to use the recorder.
I'm thinking that if necessary I can Create a 3 step test case to handle the window. Test Case 1 gets you to the sub-form. Test Case 2 manipulates sub-form. Test Case 3 would complete the test...Not ideal, but it would be workable.
One thing I just found out was that Ranorex is able to interact with the sub-form if the sub-form is open when I run the test. But if the test opens that sub-form, it is unable to interact with it. The same thing happens if I try to use the recorder.
I'm thinking that if necessary I can Create a 3 step test case to handle the window. Test Case 1 gets you to the sub-form. Test Case 2 manipulates sub-form. Test Case 3 would complete the test...Not ideal, but it would be workable.
Re: Spy can find sub-form, but test stalls when trying to act.
Again, can you share your snippet of code where you click the button from the main AUT then search for the new form?
Also, did you mark your main method with STAThread?
Also, did you mark your main method with STAThread?
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...
Ciege...
Re: Spy can find sub-form, but test stalls when trying to act.
I'm not sure if this code is what you are looking for. The first line is interacting with the main application form, the 2nd is a right-click menu, the 3rd is a pop up dialog message box. After that the CreateTemporaryOrder sub-form comes up, the last 2 lines are trying to interact with that sub-form.
I'm not sure this is the code you are looking for. Do you also need to look at the Repository.cs that was created as well?
Thanks for the help.
Code: Select all
rano.RWMain.StudyBrowserSearchCriteria.PatientNameRow0.Click(System.Windows.Forms.MouseButtons.Right);
rano.ContextMenuStripRISAdd.DictateFirstSelectedAndQueueRemain.Click();
rano.Message.ButtonOK.Click();
repo.CreateTemporaryOrder.Code.PressKeys("11111111");
repo.CreateTemporaryOrder.Code.DoubleClick("27;6");
Thanks for the help.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Spy can find sub-form, but test stalls when trying to act.
Hello,
Could you please try to add a short delay (e.g. 500ms) before you access your sub-form?
Do you see any difference?
Regards,
Markus (T)
Could you please try to add a short delay (e.g. 500ms) before you access your sub-form?
Do you see any difference?
Regards,
Markus (T)
Re: Spy can find sub-form, but test stalls when trying to act.
That worked! I can't believe I didn't throw in a thead.sleep into my code when I was trying to get it to work. It's just that there was no delay in the sub-form coming up, and nothing timed out in the code.Support Team wrote:Hello,
Could you please try to add a short delay (e.g. 500ms) before you access your sub-form?
Do you see any difference?
Regards,
Markus (T)
Thanks,
Cnim
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Spy can find sub-form, but test stalls when trying to act.
Hello,
That sounds good
Regards,
Markus (T)
That sounds good

Regards,
Markus (T)