Page 1 of 1

Watching variables within the code

Posted: Tue Mar 17, 2015 2:32 pm
by smitaninad
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.

Re: Watching variables within the code

Posted: Wed Mar 18, 2015 4:37 pm
by Support Team
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

Re: Watching variables within the code

Posted: Fri Jun 26, 2015 7:58 pm
by Laks
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?

Re: Watching variables within the code

Posted: Tue Jun 30, 2015 12:36 pm
by Support Team
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

Re: Watching variables within the code

Posted: Tue Jul 21, 2015 1:23 am
by c676228
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.

Re: Watching variables within the code

Posted: Wed Jul 22, 2015 4:53 pm
by Support Team
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

Re: Watching variables within the code

Posted: Wed Jul 22, 2015 5:14 pm
by odklizec
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! ;)

Re: Watching variables within the code

Posted: Wed Jul 22, 2015 5:42 pm
by c676228
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.

Re: Watching variables within the code

Posted: Fri Jul 24, 2015 11:58 am
by Support Team
Hi c676228,

Thank you for your feedback.

Regards,
Markus