Dynamic Tables and Images

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Jrack
Posts: 7
Joined: Mon Jul 27, 2015 4:55 pm

Dynamic Tables and Images

Post by Jrack » Mon Jul 27, 2015 4:59 pm

Hello all,

I am trying to deal with a Dynamic table in Ranorex. It is an input table that can contain as many "cell rows" as it needs to for input but by default will show one.

When I open up some instances there will only be a few rows populated, however other times there could be upwards of 20+.

I need to know how to best capture this item for the repository so that I can verify if fields are populated or not. As I currently have it I am only getting verification on the rows that I have seen in the past but when I come across an instance where there is more my test will fail.

Is there a way I can do this so I call the parent item vs individual rows or something of that nature?

Thanks much!

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

Re: Dynamic Tables and Images

Post by odklizec » Tue Jul 28, 2015 8:14 am

Hi,

I'm not quite sure what exactly you want to do? Validate the table content?

Could you please upload Ranorex snapshot of the table in question (you can learn how to create one >here<)?
A sample project showing your table in action would be nice too, but Ranorex snapshot is the essential minimum we need to see. Without snapshot, we can provide you only with some general suggestions.

For example, to validate content of the table, I would suggest you to check this sample...
http://www.ranorex.com/support/user-gui ... html#c7781
If you are working with HTML tables, check this modified code from the above sample...
http://www.ranorex.com/forum/how-to-pas ... tml#p31299
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

Jrack
Posts: 7
Joined: Mon Jul 27, 2015 4:55 pm

Re: Dynamic Tables and Images

Post by Jrack » Tue Jul 28, 2015 10:30 pm

Due to the nature of work I am in I cannot post up the UI.

Basically it is a row data table with about 10 columns, however from case to case it could contain anywhere from one row up thousands (in theory).

I need to be able to validate how many rows there are and then the contents of said field.

If I "capture" the table via spy it will only display how many rows are visible in that particular instance, so if I happen across a case with more rows any validations will then fail.

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

Re: Dynamic Tables and Images

Post by odklizec » Wed Jul 29, 2015 7:55 am

Hi,

The sample code from the link (from my previous post) provides all necessary code you need to get the number of table rows and read/validate each table cell. If you don't want/cannot use the snapshot approach, then simply replace all snapshot-related code with your own validation data.

However, as you mentioned in your posts, the number of table rows and table content itself could be different with each run? So I'm not sure how exactly you want to validate such data? If you want to validate something, you always need some reference data (does not matter if stored in data connector or in form of Ranorex snapshot). But if the live data keeps changing, I have no clue how to validate them.

I think you need to redesign your test case, to obtain the same/predictable results after each run? Eventually, you will have to find an alternate way how to validate the results. The test case, which produces different data after each run, is more or less useless for the purpose of validation ;)
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

Jrack
Posts: 7
Joined: Mon Jul 27, 2015 4:55 pm

Re: Dynamic Tables and Images

Post by Jrack » Wed Jul 29, 2015 4:18 pm

I will plug the code in from the sample and see how that works.

It isnt a problem with the test case it is just because, I work with a Live testing team... so we are testing with data that can vary from client to client (it is complicated). So one client that is pulled may only have 3 table fields that need validation, a separate client may have 20. It is the same table field that is called but I never know what it will look like until the individual client case is opened.