Page 1 of 1

How to change the property of an object on Runtime

Posted: Thu Oct 11, 2012 3:12 pm
by Adhisesha Reddy
Hi

I have created properties of two objects as variables in repository
Repository.JPG
I have used those objects in the below "Sample" funtion(which is not inside the recording module)
Functional library.JPG
Calling the function in the Recoring module from the .cs file
Calling Function.JPG
I had given the values for those variable through an excel sheet via binding, Script is taking those value from that excel sheet, but its not putting those variable values to the variables

Note: The script is putting values correctly if the sample function is created in recording module instead of calling from other .cs file

Regards
Adi

Re: How to change the property of an object on Runtime

Posted: Fri Oct 12, 2012 10:08 am
by Support Team
Hi,

How do you have bound the repo variables to the data connector via the UserCode variables or via another Recording?
Normally the repository variables are "connected" to the variables of a specific Recording/CodeModule (if you use the data driven approach for the repo variables) and if a new instance of the Recording/CodeModule is created (manually in code) the variables which were set via the data connector are re set to the default value (check the constructor of the Recordings which uses them).
Which Ranorex version are you using?

Regards,
Markus
Ranorex Support Team

Re: How to change the property of an object on Runtime

Posted: Fri Oct 12, 2012 10:51 am
by Adhisesha Reddy
Hi Markus,

I have bound the repo variables to the data connector via another Recording.
I am using 3.3.2 version od Ranorex

Thanks
Adi

Re: How to change the property of an object on Runtime

Posted: Fri Oct 12, 2012 1:39 pm
by Support Team
Hi,

I guess the problem is because the values of the repo variables are reset, but in order to analyze the issue in detail it would help us if you could send us your Ranorex solution, you can send it to our support mail address: [email protected].

Regards,
Markus
Ranorex Support Team