Chartelement height

Ranorex Studio, Spy, Recorder, and Driver.
MB_wiko
Posts: 93
Joined: Fri Sep 09, 2016 1:05 pm
Contact:

Chartelement height

Post by MB_wiko » Fri Jun 30, 2017 11:37 am

Hello together,

we still have a chart element (just a bar chart) with severals bars. So we will check the height of each bar, the height is depending from underlying numbers like height of costs or benefits. So we must just test the height with Ranorex. In Spy I saw the attribute height, but if i searched the element with attribut height Spy didn't find the element:
Unbenannt.JPG
Is it possible to read out the height or check the height?
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: Chartelement height

Post by odklizec » Fri Jun 30, 2017 1:22 pm

Hi,

You can access these values from code (as shown for example here), but I don't think you can use them in xpath.
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

MB_wiko
Posts: 93
Joined: Fri Sep 09, 2016 1:05 pm
Contact:

Re: Chartelement height

Post by MB_wiko » Tue Jul 04, 2017 11:39 am

Thanks for your anwser. I tried but I had no success:

I replaced the marked area in following code:
int objX, objY, objW, objH = 0;
objX = repo.DeadCentre.Rectangle.Element.ClientRectangle.X;

But Ranorex didn't konw the method Rectangle, than I tried with

objX = repo.DeadCentre.ClientRectangle.X;

Some problem.
Than I tried with:

objX = repo.DeadCentre.Layout.ClientRectangle.X;

and

objX = repo.DeadCentre.X;

some problem. Ranorex don't know the method , Layout, X or ClientRectangle.

Do you have some tipps for me? Some instructions?

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

Re: Chartelement height

Post by odklizec » Tue Jul 04, 2017 11:46 am

OK, please upload a Ranorex snapshot (not screenshot) of the problematic element. Ideally, if possible, upload also a small sample app featuring the element in question. Thanks.
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

MB_wiko
Posts: 93
Joined: Fri Sep 09, 2016 1:05 pm
Contact:

Re: Chartelement height

Post by MB_wiko » Tue Jul 04, 2017 11:49 am

I foun dthe solution:

int objX = repo.yyy.xxx.Element.ClientRectangle.X;

Problem solved.

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

Re: Chartelement height

Post by odklizec » Tue Jul 04, 2017 11:54 am

Good to hear that! ;)
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

MB_wiko
Posts: 93
Joined: Fri Sep 09, 2016 1:05 pm
Contact:

Re: Chartelement height

Post by MB_wiko » Tue Jul 04, 2017 12:25 pm

I didn't get a value:

Attribute 'Element.ClientRectangle.X' of element for item '{LiTag:42}' does match the specified value (actual='(null)', expected!='420').

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

Re: Chartelement height

Post by odklizec » Tue Jul 04, 2017 12:33 pm

Could you please post entire (relevant) code? And as mentioned, snapshot would be nice too. Without seeing the code and snapshot, it's hard to say what's wrong.
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

MB_wiko
Posts: 93
Joined: Fri Sep 09, 2016 1:05 pm
Contact:

Re: Chartelement height

Post by MB_wiko » Tue Jul 04, 2017 12:48 pm

I can not create a reportitem for the report:

Report.Log(ReportLevel.Info, "Validation", "Ja",repo.WebDocumentWikoWebTESTER2.LiTag42Info, new RecordItemIndex(13));
Validate.Attribute(repo.WebDocumentWikoWebTESTER2.LiTag42.Element.ClientRectangle,"X",11);

MB_wiko
Posts: 93
Joined: Fri Sep 09, 2016 1:05 pm
Contact:

Re: Chartelement height

Post by MB_wiko » Tue Jul 04, 2017 12:55 pm

all OK, I found the solution.