Page 1 of 1

Cannot identify Scroll in Span tag

Posted: Mon Oct 10, 2016 9:46 am
by hanguyen2009
Hi Supporters,

I have data grid like attached file, I need scroll down to view all rows data, however,The Ranorex can't identify the Scroll.
Please help.
Thanks,
Ha.

My Ranorex version: 5.4.6

Re: Cannot identify Scroll in Span tag

Posted: Mon Oct 10, 2016 10:09 am
by odklizec
Hi,

Apparently, Ranorex is not able to detect this scroll, nor there is an info about total number of rows. So I guess you will somehow have to obtain the number of rows from grid Row ID, which seems indicates each row number? So I would suggest to create am iList with all "holdingsAccountGrid-row" elements. This way you can find out the total number of rows in your grid and then you can use for example EnsureVisible method (in loop) to bring each grid row to visible area of screen and do whatever you want with each row?

The snapshot you posted contains just one row, so I'm not quite sure about the correct xpath to obtain all rows. I guess this one should list all grid rows?...

Code: Select all

/dom[@domain='rrsuat1']//span[@id~'holdingsAccountGrid-row-']

Re: Cannot identify Scroll in Span tag

Posted: Mon Oct 10, 2016 11:08 am
by hanguyen2009
Thanks for your answer,
I try follow your advise, but the EnsureVisible method does not bring row to visible area of screen.
My code below:
//Assume total rows =40
for(int j=1; j<=40;j++){
//repoHolding.idrow store id of row data
repoHolding.idrow ="holdingsAccountGrid-row-" + j;
repoHolding.SCREENHoldingsCoLtd8312015Exp.HoldingsAccountGridRow.EnsureVisible();
//Get Cell data
IList<SpanTag> listCellsData = repoHolding.SCREENHoldingsCoLtd8312015Exp.HoldingsAccountGridRow.FindChildren<SpanTag>();
RRSHomeFunctions.HomeFilterData FilterDta= new RRSHomeFunctions.HomeFilterData();
int i=2;
FilterDta.ID=rowIndex;
FilterDta.AsOfDate=listCellsData[i++].InnerText ;
FilterDta.TestName=listCellsData[i++].InnerText ;
FilterDta.FilingType=listCellsData[i++].InnerText ;
FilterDta.Filer=listCellsData[i++].InnerText ;
FilterDta.SubentityFiler=listCellsData[i++].InnerText ;
}

I explain more detail my expected:
For example,In the my data grid has 40 rows data,and I need to read all data in the grid.
However, in one step of scroll, there are 13 rows visible in screen, Ranorex can identify 13 rows visible, so I can get data.
I need scroll to view next 13 rows data, and read these. i can not click scroll because Ranorex is not able to detect this scroll. The EnsureVisible method also could not help row visible.

Thanks,
Ha.

Re: Cannot identify Scroll in Span tag

Posted: Wed Oct 12, 2016 4:16 pm
by Vega
You can try sending a page down key event to the container holding the rows so that it scrolls down or you can use a relative click to click the scroll bar down. So if you are doing relative click, you find an element to click on and change the coordinates so that it actually ends up clicking the scroll down button instead. Remember you can use negative values!

Neither of these are my favorite methods of attack, but they will get the job done.

Re: Cannot identify Scroll in Span tag

Posted: Tue Oct 18, 2016 5:07 am
by hanguyen2009
Thanks Vega
It is very helpful :)