Data Bind variables(Excel connector) inside Code module

Ask general questions here.
joyarjit
Posts: 20
Joined: Fri Oct 13, 2017 6:09 am

Data Bind variables(Excel connector) inside Code module

Post by joyarjit » Mon Oct 16, 2017 8:05 am

Hi,

I have excel connector with 2 columns(username and password) and multiple rows. Rather recording I want to write code module to type-in values in my text boxes.
Could you please tell me how can we use data bind variable inside the code module, so that with each iteration variable will take different value as mentioned in excel sheet.

Thanks.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Data Bind variables(Excel connector) inside Code module

Post by odklizec » Mon Oct 16, 2017 8:18 am

Hi,

You simply have to add code module to TestCase or SmartFolder with created data connector of your choice. Then simply bind the variables created in CodeModule with those from data connector. If code module variable names are the same as data connector column names, you can simply use AutoBind to bind them.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Data Bind variables(Excel connector) inside Code module

Post by krstcs » Mon Oct 16, 2017 4:07 pm

In addition to what Pavel said, you should create the module variables in the code module by right-clicking anywhere in the code editor window and selecting "Insert New Module Variable". This will create a variable that Ranorex can see for binding purposes.
Shortcuts usually aren't...

joyarjit
Posts: 20
Joined: Fri Oct 13, 2017 6:09 am

Re: Data Bind variables(Excel connector) inside Code module

Post by joyarjit » Tue Oct 17, 2017 1:17 pm

Thanks @krstcs and @ odklizec for the help.