Get Data from datasource(databinding) : Automation Tools

Get Data from datasource(databinding)

Ranorex Spy, Recorder, and Studio.

Get Data from datasource(databinding)

Postby akommalapati » Wed Dec 07, 2011 4: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
akommalapati
 
Posts: 21
Joined: Wed Dec 07, 2011 3:54 pm
Location: India

Re: Get Data from datasource(databinding)

Postby Support Team » Wed Dec 07, 2011 5: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
User avatar
Support Team
Site Admin
 
Posts: 4843
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Get Data from datasource(databinding)

Postby akommalapati » Wed Dec 07, 2011 5: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
akommalapati
 
Posts: 21
Joined: Wed Dec 07, 2011 3:54 pm
Location: India

Re: Get Data from datasource(databinding)

Postby Support Team » Fri Dec 09, 2011 12:44 pm

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
User avatar
Support Team
Site Admin
 
Posts: 4843
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation Tools

Who is online

Users browsing this forum: No registered users and 0 guests