Cannot identify Scroll in Span tag

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
hanguyen2009
Posts: 18
Joined: Wed May 27, 2015 9:43 am

Cannot identify Scroll in Span tag

Post by hanguyen2009 » Mon Oct 10, 2016 9:46 am

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
Attachments
SpanScroll.jpg
SpanScroll.jpg (121.22 KiB) Viewed 706 times
Scroll.rxsnp
(72.77 KiB) Downloaded 36 times
HtmlTags.jpg
HtmlTags.jpg (355.31 KiB) Viewed 706 times

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

Re: Cannot identify Scroll in Span tag

Post by odklizec » Mon Oct 10, 2016 10:09 am

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-']
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

hanguyen2009
Posts: 18
Joined: Wed May 27, 2015 9:43 am

Re: Cannot identify Scroll in Span tag

Post by hanguyen2009 » Mon Oct 10, 2016 11:08 am

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.
Attachments
EndPage.jpg
EndPage.jpg (77.79 KiB) Viewed 697 times
viewpage.jpg
viewpage.jpg (92.73 KiB) Viewed 697 times

User avatar
Vega
Posts: 109
Joined: Mon Jul 11, 2016 2:15 pm

Re: Cannot identify Scroll in Span tag

Post by Vega » Wed Oct 12, 2016 4:16 pm

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.

hanguyen2009
Posts: 18
Joined: Wed May 27, 2015 9:43 am

Re: Cannot identify Scroll in Span tag

Post by hanguyen2009 » Tue Oct 18, 2016 5:07 am

Thanks Vega
It is very helpful :)