How to change the property of an object on Runtime

Experiences, small talk, and other automation gossip.
Adhisesha Reddy
Posts: 6
Joined: Sat May 19, 2012 11:56 am

How to change the property of an object on Runtime

Post by Adhisesha Reddy » Thu Oct 11, 2012 3:12 pm

Hi

I have created properties of two objects as variables in repository
Repository.JPG
Repository.JPG (130.45 KiB) Viewed 1787 times
I have used those objects in the below "Sample" funtion(which is not inside the recording module)
Functional library.JPG
Functional library.JPG (156.37 KiB) Viewed 1787 times
Calling the function in the Recoring module from the .cs file
Calling Function.JPG
Calling Function.JPG (131.58 KiB) Viewed 1787 times
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

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

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

Post by Support Team » Fri Oct 12, 2012 10:08 am

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
.
Image

Adhisesha Reddy
Posts: 6
Joined: Sat May 19, 2012 11:56 am

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

Post by Adhisesha Reddy » Fri Oct 12, 2012 10:51 am

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

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

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

Post by Support Team » Fri Oct 12, 2012 1:39 pm

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
.
Image