Watching variables within the code

Ask general questions here.
smitaninad
Posts: 11
Joined: Fri Feb 20, 2015 10:07 am

Watching variables within the code

Post by smitaninad » Tue Mar 17, 2015 2:32 pm

Hi , I ahve a code where i am stepping during Debug and I want watch some variables.
I am not able to do so when I add the variable name into the Watch WIndow by explicitly typing it.
E.g below code
EnvironmentVariable = Utility.XMLUtility.Fn_Read_XmlFile( COMOS.Utility.FileUtil.Fn_GetParentOfCurrentDirectoryPath() + @"\Configuration\Environment.xml" );
Fn_GetFormattedCurrentDateTime = COMOS.Utility.FileUtil.Fn_GetFormattedDateTime();

//Run Testsuite
error = TestSuiteRunner.Run(typeof(Program), Environment.CommandLine);

Unable to retrieve value when added to Watch window Environment.CommandLine

This variable is of type Dictionary.

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

Re: Watching variables within the code

Post by Support Team » Wed Mar 18, 2015 4:37 pm

Hi smitaninad,

I created a dictionary to reproduce the issue, but in my case I was able to watch the variable of type dictionary without issues.
May I therefore ask you how you added the variable to the Watch list and which name you added?
What kind of information do you want to get, do you see the information in the Local variables view?

Regards,
Markus
.
Image

Laks
Posts: 1
Joined: Fri Jun 26, 2015 7:09 pm

Re: Watching variables within the code

Post by Laks » Fri Jun 26, 2015 7:58 pm

I tried creating a dictionary too. sometimes intellisense works for the obkect but most of the times it does it.so i cannot see the items inside the dictionary. The local variable window does not show the variable too.what could be the reason? otherwise the code works for for another testcase scenario.

Dictionary<string, string> DataDict= new Dictionary<string, string>();
DataDict.Add(a,b);

Can someone please help with this?

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

Re: Watching variables within the code

Post by Support Team » Tue Jun 30, 2015 12:36 pm

Hi Laks,

This is strange, in my case I can see it in the local variable window and the intellisense also works as expected.

May I therefore ask you which Ranorex version you are using and if you are using any different project settings?
Do you work with a single Ranorex solution/project, or do you have different projects in your solution?

Thanks,
Markus
.
Image

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: Watching variables within the code

Post by c676228 » Tue Jul 21, 2015 1:23 am

Actually I have a debugging question too. I experienced several times that local variable window just throw exceptions when I tried to expand some variables. That's not so critical since I don't use it everyday.

However, my typical issue is with watch window. Maybe I don't know how to use it. I tried to use the same way as VS IDE.
for example, if I add a simple variable name to the watch window, the value can be presented without any issues.
if I have two strings, each can be presented in the watch window. however if put variable1+variable2 in the watch window, it will give an error.
If someClass.constanst.delay is valid expression, I can move my mouse to see the actual value. However, if I put this statement in the watch window, error then occurs.

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

Re: Watching variables within the code

Post by Support Team » Wed Jul 22, 2015 4:53 pm

Hi c676228,

I assume the variable "someClass.constanst.delay" is a static one, right?
If so, this is unfortunately a known limitation of Ranorex Studio and doesn't work.
We are working on upgrading Ranorex Studio to a newer SharpDevelop version and watching static variables should work with the new version, but I am afraid I cannot give you a date when the new Ranorex Studio version will be released.

Regarding the "variable1+variable2" expression, I am afraid this is also not possible, but I will forward this as a feature request.

Regards,
Markus
.
Image

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Watching variables within the code

Post by odklizec » Wed Jul 22, 2015 5:14 pm

Hi Markus,

No matter you cannot tell us the release date of Ranorex with more recent SharpDevelop, it's indeed a great news you are already working on it! ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: Watching variables within the code

Post by c676228 » Wed Jul 22, 2015 5:42 pm

Thanks for recognizing the limitations and adding the feature.

I have mentioned in several threads about the Ranorex debugging tool.
Basically the watch window only can be used for some simple variables, even expression like arr or arr["column1"] won't work. Not mentioning expression, statement in the watching window.

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

Re: Watching variables within the code

Post by Support Team » Fri Jul 24, 2015 11:58 am

Hi c676228,

Thank you for your feedback.

Regards,
Markus
.
Image