ExcelConnector iteration with multiple values in single cell

Best practices, code snippets for common functionality, examples, and guidelines.
joyarjit
Posts: 20
Joined: Fri Oct 13, 2017 6:09 am

ExcelConnector iteration with multiple values in single cell

Post by joyarjit » Mon Dec 04, 2017 9:38 am

I have an excel sheet as my data source. It has 1 row and 3 columns.

column 1 and 2 contains username and password to login the application.

Column 3 has a value which has to be inserted in a text box.

Now, after logging in, I need to enter the value from column 3 of excel sheet into a text box of my application; then click Ok and again enter a new value in the same text box of application.

This has to be done around 5 times and then logout of application.

But the problem is I can only have one Rx variable binded to a specific column of excel. So i can not reuse same code 5 times in loop with different values.
One think i can do is to create 4 more columns in same 1st row and write same set of code 4 more times with 4 new variables binded to new cells in excel.

Could you please help me with a solution to this. Is there a way to write 5 values in same excel cell(may be separated by some delimiter) and iterate through it?

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

Re: ExcelConnector iteration with multiple values in single cell

Post by odklizec » Mon Dec 04, 2017 9:51 am

Hi,

It's not possible to use delimited values via dataconnector. But you can easily use 3rd column with 5 rows. You just have to use a nested SmartFolder with another data connector (using the same file with different data range)

Code: Select all

[TestSuite]
[TC1] - data connector for login - range "1"
|_Login.rxrec <- binded username and password
|_[SmartFolder] - data connector for text input - range "1-5"
    |_InpuText.rxrec <- binded 3rd column with 5 rows
As you can see, all you have to do is to add a nested SmartFolder and define row ranges for TC and SF.
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

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

Re: ExcelConnector iteration with multiple values in single cell

Post by joyarjit » Mon Dec 04, 2017 10:42 am

Thanks a lot.
Using a smart folder it worked.

Can we iterate column wise rather row-wise for excel connector.

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

Re: ExcelConnector iteration with multiple values in single cell

Post by odklizec » Mon Dec 04, 2017 10:48 am

joyarjit wrote:Thanks a lot.
Using a smart folder it worked.
Good to hear that.
joyarjit wrote:Can we iterate column wise rather row-wise for excel connector.
Nope, data connector iteration is done only via rows.
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