Falis starting Ranorex during debug in VS 2012

Class library usage, coding and language questions.
stefanb
Posts: 18
Joined: Fri Feb 01, 2013 2:30 pm

Falis starting Ranorex during debug in VS 2012

Post by stefanb » Tue Mar 05, 2013 11:00 am

Hi

I have set up a Coded UI project in VS 2012 from where I call the Ranorex function as below
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Windows.Input;
using System.Windows.Forms;
using System.Drawing;
using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UITest.Extension;
using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard;
using Ranorex;


namespace CodedUIRanorex
{
    [TestClass]
    public class Test1
    {

        [TestInitialize]
        public void TestInit()
        {
            Host.Local.OpenBrowser("www.systemverification.com", "IE", "", false, false);
        }

        [TestCleanup]
        public void CleanUp()
        {
        }

        public Test1()
        {
        }

        [TestMethod]
        public void CodedUITestMethod1()
        {
        }
    }
}
Running the code works flawless and the test passes, however when I try to debug the code VS hangs when opening Ranorex.

In the output the last lines I can see is:

'vstest.executionengine.x86.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread '<No Name>' (0x1994) has exited with code 0 (0x0).
The thread '<No Name>' (0xd9c) has exited with code 0 (0x0).
The thread '<No Name>' (0x167c) has exited with code 0 (0x0).

I use a Ranorex .Net Runtime Version 4.0.30319.18034 trial.
I have Windows 7 Proffesional with ServicePack 1 and .Net 4.5

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Falis starting Ranorex during debug in VS 2012

Post by Support Team » Wed Mar 06, 2013 4:51 pm

Hello,

Unfortunately, I couldn't reproduce your issue.

It looks like an issue that is related with Visual Studio.
Could you please take a look at this post at MSDN that could be the cause for this issue?
Which Ranorex version do you use?

Regards,
Markus (T)
.
Image

stefanb
Posts: 18
Joined: Fri Feb 01, 2013 2:30 pm

Re: Falis starting Ranorex during debug in VS 2012

Post by stefanb » Wed Mar 06, 2013 6:50 pm

Hi! Thanks for your answer!

I have created a Coded UI Test from scratch as described in http://www.ranorex.com/blog/running-ran ... st-manager. Doing this in VS 2012 doesn’t create a .test settings file. The problem in the MSDN link seems to be related to this file or code coverage but I don´t use any of these that I’m aware of...

I have found a pretty strange workaround however. By adding a break point to the
Host.Local.OpenBrowser("www.systemverification.com", "IE", "", false, false);
line and hovering over host and then Ranorex.Host triggers VS Studio to "think" for a while. After this I´m able to continue the debugging and it works without problem. Ranorex opens and all is fine...

I use a Ranorex .Net Runtime Version 4.0.30319.18034 trial as mentioned in the post above.

BR Stefan

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Falis starting Ranorex during debug in VS 2012

Post by Support Team » Thu Mar 07, 2013 1:24 pm

Hello,

Thank you for your info.
Good to hear that you found a workaround :-)

By the way, I asked you for the Ranorex version (e.g. 4.0.2 or 3.3.5).
Our latest version is 4.0.2 and can be downloaded from our archive.

Regards,
Markus (T)
.
Image

stefanb
Posts: 18
Joined: Fri Feb 01, 2013 2:30 pm

Re: Falis starting Ranorex during debug in VS 2012

Post by stefanb » Thu Mar 07, 2013 2:57 pm

Hi!

The Ranorex Studio Version that I downloaded a few days ago is 4.0.2.21666.

Even though I found a workaround I think that the issue is still valid, this is not a nice way to work. I am surprised that noone else seems to have this problem..

BR Stefan

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Falis starting Ranorex during debug in VS 2012

Post by Support Team » Fri Mar 08, 2013 11:21 am

Hello,

Could you please post or send us your project to [email protected] in order to reproduce this issue?

Thank you in advance.

Regards,
Markus (T)
.
Image

stefanb
Posts: 18
Joined: Fri Feb 01, 2013 2:30 pm

Re: Falis starting Ranorex during debug in VS 2012

Post by stefanb » Fri Mar 08, 2013 2:09 pm

Hi Markus

I have sent you the Solution.

Thanks Stefan

piotrn
Posts: 16
Joined: Fri Mar 25, 2011 3:04 pm

Re: Falis starting Ranorex during debug in VS 2012

Post by piotrn » Wed Jul 31, 2013 1:01 pm

So what is the solution to this problem?
I've updated to Ranorex 4.0.5 and it's still not possible to debug in VS2012 when running NUnit tests with Ranorex code?

Regards
Piotr

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Falis starting Ranorex during debug in VS 2012

Post by Support Team » Thu Aug 01, 2013 4:27 pm

Hello,

The solution is quite simple.
Please add the following code at the start of the debug session:
MessageBox.Show(“Some text”);
Then, the coded UI test debugger should work.

The coded UI test debugger seems to have a problem if a modal dialog is shown (Form.ShowDialog) e.g. the Trial pop-up dialog - the normal debugger does NOT have that problem.
The following post on MSDN confirms such issues: http://social.msdn.microsoft.com/Forums ... 293f0d957/

Regards,
Markus (T)
.
Image