Problem in identification of object in web app

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
npanag
Posts: 33
Joined: Thu Jun 02, 2016 5:42 pm

Problem in identification of object in web app

Post by npanag » Mon Nov 07, 2016 3:34 pm

I'm working in testing a heavy web app. As you can see in the pictures uploaded, I want to catch the Div with 15,000,000 that is related to the Div 'Previous Commitment'.

The problem is that these Divs and also the TDs where they belong and the tr that is the mother of the whole branch don't have any field that i can use for the identification.

How do I solve cases like that?

Thank you
You do not have the required permissions to view the files attached to this post.

npanag
Posts: 33
Joined: Thu Jun 02, 2016 5:42 pm

Re: Problem in identification of object in web app

Post by npanag » Mon Nov 07, 2016 3:43 pm

And this is the Div itself
You do not have the required permissions to view the files attached to this post.

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

Re: Problem in identification of object in web app

Post by odklizec » Mon Nov 07, 2016 3:47 pm

Hi,

Please post a Ranorex snapshot of the problematic element (learn how to create one here). Screenshots are not useful in this particular case.
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

npanag
Posts: 33
Joined: Thu Jun 02, 2016 5:42 pm

Re: Problem in identification of object in web app

Post by npanag » Mon Nov 07, 2016 3:58 pm

Tell me something. Can I create a snapshot for only the problematic Div, or it will create a file containing the whole web application, with company data included?

The last is a big problem for me, because we are talking about sensitive corporate financial data that i must not include in the snapshot.

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

Re: Problem in identification of object in web app

Post by odklizec » Mon Nov 07, 2016 4:07 pm

Hi,

We already discussed this here:
http://www.ranorex.com/forum/object-wit ... tml#p40411
You can reduce the amount of data stored in snapshot by unchecking this option. But for your current problem, you must save at least the parent table, holding all cells visible in posted screenshot (from your first post).
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

npanag
Posts: 33
Joined: Thu Jun 02, 2016 5:42 pm

Re: Problem in identification of object in web app

Post by npanag » Mon Nov 07, 2016 4:39 pm

I didn't check it in full detail, but i think it has bypassed the sensitive info, as per your instructions.
Last edited by npanag on Thu Nov 24, 2016 10:15 pm, edited 1 time in total.

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

Re: Problem in identification of object in web app

Post by odklizec » Mon Nov 07, 2016 4:44 pm

Hi,

Thanks for the snapshot. I think this xpath should do return the cell you are looking for:

Code: Select all

/dom[@domain='oicem36:8080']//div[#'id_leftmargin_container']/div/table/tbody//div[@innertext='Previous Commitment']/parent::td/following-sibling::td/div
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

npanag
Posts: 33
Joined: Thu Jun 02, 2016 5:42 pm

Re: Problem in identification of object in web app

Post by npanag » Mon Nov 07, 2016 4:51 pm

Bravo, I'm really impressed. It worked.

Where can i find info for these keywords, like parent and follow sibling and the ::?

Thanks again.

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

Re: Problem in identification of object in web app

Post by odklizec » Mon Nov 07, 2016 5:28 pm

You are welcome ;) You can learn about relationship operators and other xpaths tricks here:
http://www.ranorex.com/support/user-gui ... ditor.html
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

npanag
Posts: 33
Joined: Thu Jun 02, 2016 5:42 pm

Re: Problem in identification of object in web app

Post by npanag » Tue Nov 08, 2016 10:54 am

OK, so I have a relationship between the item description and the first number. I also discovered the other two numbers (for example for Previous Cash Called - see picture) and I used the ajxfield property:

Previous Cash Called
--------------------------
/dom[@domain='oicem36:8080']//td[#'framescontainer']/div/div/div/table/tbody/tr/td/table/tbody/tr/td/div[@id='controls_container']/div[@id='id_controls_area']/div[@ajxname='RT_SUBSCRFUNDOPS_1']/div[@id='id_leftmargin_container']/div/table/tbody/tr/td/div[@innertext='Previous Cash Called']

Fund CCY amount
----------------------
/dom[@domain='oicem36:8080']//td[#'framescontainer']/div/div/div/table/tbody/tr/td/table/tbody/tr/td/div[@id='controls_container']/div[@id='id_controls_area']/div[@ajxname='RT_SUBSCRFUNDOPS_1']/div[@id='id_leftmargin_container']/div/table/tbody/tr/td/div[@innertext='Previous Cash Called']/parent::td/following-sibling::td/div

But the other 2 amounts are not correlated with the above (being on another clone)

/dom[@domain='oicem36:8080']//td[#'framescontainer']/div/div/div/table/tbody/tr/td/table/tbody/tr/td/div[@id='controls_container']/div

[@id='id_controls_area']/div[@ajxname='RT_SUBSCRFUNDOPS_1']/div[@id='id_client_container']/table/tbody/tr/td/div[@ajxfield='A_CASHCALLED3']

o,f=EUR
---------
/dom[@domain='oicem36:8080']//td[#'framescontainer']/div/div/div/table/tbody/tr/td/table/tbody/tr/td/div[@id='controls_container']/div

i=USD
-------
[@id='id_controls_area']/div[@ajxname='RT_SUBSCRFUNDOPS_1']/div[@id='id_client_container']/table/tbody/tr/td/div[@ajxfield='A_CASHCALLED23']

Question: Could the last 2 amounts be somehow related to the item description (Previous Cash Called)? I think no, but...
You do not have the required permissions to view the files attached to this post.
Last edited by npanag on Thu Nov 24, 2016 10:21 pm, edited 1 time in total.

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

Re: Problem in identification of object in web app

Post by odklizec » Tue Nov 08, 2016 1:38 pm

Hi,

I don't think there is a way to refer to these two values directly by xpath. The only way I see is via a small workaround.

At first, you will have to create a new repo item, referring to "Previous Cash Called" cell, but not the cell itself, but its parent TR tag, with the xpath like this:

Code: Select all

/dom[@domain='oicem36:8080']//div[#'id_leftmargin_container']/div/table//div[@innertext='Previous Cash Called']/parent::td/parent::tr
Now you have to create a recording/coded GetValue action, which will obtain ChildIndex value of given TR tag and store it in a module variable, e.g. $varRowNumber.

Finally, you can use this variable in the xpath, which will return the values you are looking for, like this:

Code: Select all

/dom[@domain='oicem36:8080']//table[@class='class_figures_client']//tr[@childindex='3']//div[@ajxfield='A_CASHCALLED3']
and...

Code: Select all

/dom[@domain='oicem36:8080']//table[@class='class_figures_client']//tr[@childindex='3']//div[@ajxfield='A_CASHCALLED23']
Youo see, because we obtained row number from cell "Previous Cash Called", we can "easily" refer to it in the other table, holding the two remaining values ;) Hope this helps?
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

Vaughan.Douglas
Posts: 254
Joined: Tue Mar 24, 2015 5:05 pm
Location: Des Moines, Iowa, USA

Re: Problem in identification of object in web app

Post by Vaughan.Douglas » Tue Nov 08, 2016 1:47 pm

I don't think you're going to get a direct correlation between the elements you've identified already, but you're not out of luck yet. The new element you're looking for has an "ajxfield" field that looks promising.

Code: Select all

/dom[@domain='oicem36:8080']//div[@ajxfield~'A_CASHCALLED']

Code: Select all

/dom[@domain='oicem36:8080']//div[@ajxfield~'A_CASHDISTRIBUTED']

Code: Select all

/dom[@domain='oicem36:8080']//div[@ajxfield~'A_AMOUNT']

Code: Select all

/dom[@domain='oicem36:8080']//div[@ajxfield~'A_ADJUSTEDVALUATION']
These are generic paths that will return both element per row.
Doug Vaughan

npanag
Posts: 33
Joined: Thu Jun 02, 2016 5:42 pm

Re: Problem in identification of object in web app

Post by npanag » Tue Nov 08, 2016 2:37 pm

Nice ideas.

I didn't realize that the tr number of related objects in both clones is the same so we can use the @childindex property.

OK, thank you very much. I predict that I'll come back with a new question very soon!!