Databindung as Array?

Ask general questions here.
User avatar
endercraft
Posts: 2
Joined: Wed Oct 16, 2019 8:12 pm

Databindung as Array?

Post by endercraft » Fri Oct 25, 2019 10:12 am

Hello,

I'm actually new to the ranorex software and not pretty good in english, so I'm sorry!

I want to make a Data-Sourced Array-Variable, where I can use the Array-Variable arrName[0] = Excel Input A2 or arrName[1] = Excel Input A3. My Goal is it to say, that the arrName has in the column B / C / D / ... the entry 1 or nothing.

If (the arrName[x] has a 1 in the column X)
make this
else
make this



Is something like that possible, and if, how?


Screenshot of an Example-Database (this coult also change his row-/column-coun)
Image

Have a nice day!

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

Re: Databindung as Array?

Post by odklizec » Mon Oct 28, 2019 9:00 am

Hi,

I'm afraid, I don't quite understand, what exactly you want to achieve? Anyway, there is currently no built-in support for arrays in data connector columns. Data connectors work exactly as they are described in User Guide. One column=one value, which can be assigned to one or multiple variables. And each row = one iteration. That's currently all.

If you want to have one column, holding multiple values (aka array), then yes, you can do that. But for the connected variable, it will still look like one value (e.g. "val1;val2;val3") and then, you have to parse the "array" in code or recording module with connected variable, using user code you write.
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

User avatar
endercraft
Posts: 2
Joined: Wed Oct 16, 2019 8:12 pm

Re: Databindung as Array?

Post by endercraft » Mon Oct 28, 2019 2:30 pm

Hey,

I actually want to use the data source in my code, but I don't know how.

If ranorex already seperates the data it's perfect!

But how can I say
var Example1 = value(row1 , column1)
?

I'm sorry, but I am using ranorex just 2 weeks now and I'm not pretty good in english :D

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

Re: Databindung as Array?

Post by odklizec » Tue Oct 29, 2019 8:55 am

Hi,

You can read data from Excel file, by using data connector code, described here:
https://www.ranorex.com/forum/viewtopic ... 699#p11699

And this post can help you with splitting a coma delimited string into array:
https://www.ranorex.com/forum/viewtopic ... 632#p24687
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