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
Cannot identify Scroll in Span tag
-
- Posts: 18
- Joined: Wed May 27, 2015 9:43 am
Cannot identify Scroll in Span tag
You do not have the required permissions to view the files attached to this post.
Re: Cannot identify Scroll in Span tag
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?...
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-']
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
-
- Posts: 18
- Joined: Wed May 27, 2015 9:43 am
Re: Cannot identify Scroll in Span tag
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.
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.
You do not have the required permissions to view the files attached to this post.
Re: Cannot identify Scroll in Span tag
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.
Neither of these are my favorite methods of attack, but they will get the job done.
-
- Posts: 18
- Joined: Wed May 27, 2015 9:43 am
Re: Cannot identify Scroll in Span tag
Thanks Vega
It is very helpful
It is very helpful
