Page 1 of 1

Chartelement height

Posted: Fri Jun 30, 2017 11:37 am
by MB_wiko
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?

Re: Chartelement height

Posted: Fri Jun 30, 2017 1:22 pm
by odklizec
Hi,

You can access these values from code (as shown for example here), but I don't think you can use them in xpath.

Re: Chartelement height

Posted: Tue Jul 04, 2017 11:39 am
by MB_wiko
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?

Re: Chartelement height

Posted: Tue Jul 04, 2017 11:46 am
by odklizec
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.

Re: Chartelement height

Posted: Tue Jul 04, 2017 11:49 am
by MB_wiko
I foun dthe solution:

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

Problem solved.

Re: Chartelement height

Posted: Tue Jul 04, 2017 11:54 am
by odklizec
Good to hear that! ;)

Re: Chartelement height

Posted: Tue Jul 04, 2017 12:25 pm
by MB_wiko
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').

Re: Chartelement height

Posted: Tue Jul 04, 2017 12:33 pm
by odklizec
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.

Re: Chartelement height

Posted: Tue Jul 04, 2017 12:48 pm
by MB_wiko
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);

Re: Chartelement height

Posted: Tue Jul 04, 2017 12:55 pm
by MB_wiko
all OK, I found the solution.