Get Data from datasource(databinding)

Ranorex Studio, Spy, Recorder, and Driver.
akommalapati
Posts: 21
Joined: Wed Dec 07, 2011 2:54 pm
Location: India

Get Data from datasource(databinding)

Post by akommalapati » Wed Dec 07, 2011 3:54 pm

Created a UserCode module for a testcase, added the excel datasheet to datasource (databinding), now i want get those values UserCode Action.

Below is my code :

WebElement Password = webDocReg.FindSingle(".//form/div[2]/input[@id='password']", 30000);
Password.Focus();
Password.PressKeys("password");


now i want the value of password from databinding.
Please help its very urgent for me

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Get Data from datasource(databinding)

Post by Support Team » Wed Dec 07, 2011 4:00 pm

Hi,

follwoing chapter of our user guide will explain how to generate a module variable which can be bound to your data source:
Using Variables with Code Modules

Regards,
Tobias
Ranorex Support Team

akommalapati
Posts: 21
Joined: Wed Dec 07, 2011 2:54 pm
Location: India

Re: Get Data from datasource(databinding)

Post by akommalapati » Wed Dec 07, 2011 4:18 pm

The code in the topic is shown with repository, but i'm not adding any thing to repository.

Can't i get the values without using repository.

Please help me out

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Get Data from datasource(databinding)

Post by Support Team » Fri Dec 09, 2011 11:44 am

akommalapati wrote:The code in the topic is shown with repository, but i'm not adding any thing to repository.
The section in the Ranorex User Guide Tobias posted covers both user code modules with and without a repository. Although I recommend using a repository for the RanoreXPath to your password input tag.

Just create a new variable within the user code module (right-click) and then replace all occurrences of the "password" string with the generated property.

Regards,
Alex
Ranorex Team