How to Edit Data for Multiple Line/Rows

Ask general questions here.
upendra
Posts: 13
Joined: Tue Oct 06, 2015 11:27 am

How to Edit Data for Multiple Line/Rows

Post by upendra » Fri Oct 30, 2015 6:38 am

Hi,
In the attached screenshot ,i want to edit the field Order Qty for multiple lines but to edit that i need to record the steps i.e if i have to edit all three lines then i have to record for the all three steps.
Suppose there will be 15 or 20 lines so it is not good idea to record each 15 or 20 lines.
So my query is how i will update multiple lines just recording only once .
I have tried few option but not able to succeed.
Please find the screenshot for that page and snapshot of the field as an attachment.
I am using record and playback.
Thanks in Advance!
Attachments
Snapshot-30102015.rar
(4.5 MiB) Downloaded 53 times
screenshot-30102015.rar
(105.75 KiB) Downloaded 39 times

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

Re: How to Edit Data for Multiple Line/Rows

Post by odklizec » Fri Oct 30, 2015 8:45 am

Hi,

Could you please show us the steps for editing one row and xpaths you are using to access the individual Order Qty elements?

I'm afraid, there is no record-replay way to achieve what you want. You will have to use some code. This alone should not be so hard task. The main problem is that your GUI appears to be a real mess without unique IDs. And that's where the real challenge starts ;)

Unless I overlooked something, there is no reasonable way to tell to which column/row belongs the individual Order Qty elements or how to get number of table rows? In fact, there seems to be no real table holding the elements? So all you have is a bunch of VTextFields, which I guess you have stored in repository with xpaths containing element indexes. And that's really bad, because as you mentioned, the number of rows could change. So there is no way the indexes will work for you in a long term run.

In my opinion, your best hope is, that after switching some of the Java-related Ranorex global settings, your GUI will shows up in much nicer form, with real table, rows/columns, etc. But I would not put much hope into this. Maybe some more experienced guys here will have more suggestions?
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

upendra
Posts: 13
Joined: Tue Oct 06, 2015 11:27 am

Re: How to Edit Data for Multiple Line/Rows

Post by upendra » Fri Oct 30, 2015 11:24 am

Hi odklizec,
Thanks for your Reply!
Please find the recording module as an attachment.


Regards
Upendra
Attachments
Edit_Existing_PO.rar
(117.04 KiB) Downloaded 36 times

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

Re: How to Edit Data for Multiple Line/Rows

Post by odklizec » Fri Oct 30, 2015 11:35 am

Hi,

I'm afraid, sending recording is not enough. You will have to send also rxrep repository file. Your recording opens empty with warning about missing repository file ;)
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

upendra
Posts: 13
Joined: Tue Oct 06, 2015 11:27 am

Re: How to Edit Data for Multiple Line/Rows

Post by upendra » Fri Oct 30, 2015 11:43 am

Hi odklizec,
Sorry missed the repository attachment.

Regards
Upendra
Attachments
PO_Creation-RegressionRepository.rar
(10.63 KiB) Downloaded 35 times

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

Re: How to Edit Data for Multiple Line/Rows

Post by odklizec » Mon Nov 02, 2015 4:23 pm

Hi,

As I've expected, the GUI is pretty messy with no unique IDs or real table with rows/cells. Therefore, it would be pretty hard to create a reliable code for editing multiple table rows.

The only thing I can think of is finding the header element with text "Order Qty" and obtain its ChildIndex value (via GetValue action).
Then you should use loop (like Do..While) in which you should examine Text property of each following Text element with incremented ChildCount (starting from the element Order Qty).
In this loop you can also perform the editing of each Order Qty row.
If the Text property of next found element is empty, you should jump out of the loop. Empty Text property means that the actual row has no Order Qty and therefore, there is nothing to edit ;)

Unfortunately, ChildIndexes are similarly unreliable and as element indexes. So any code you will create may eventually fail after relative simple GUI change. Good luck!
Attachments
Table_Loop.png
Table_Loop.png (149.35 KiB) Viewed 507 times
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