Objects cannot be found

Class library usage, coding and language questions.
jonesj
Posts: 7
Joined: Wed Sep 25, 2013 4:02 pm

Objects cannot be found

Post by jonesj » Fri Apr 25, 2014 9:28 pm

I am setting up automation on this web page. There are more than 50 elements on the page so some of the data is not visible on the web page. I use Ranorex spy to see the elements and there are many elements that are not visible and set to visible.
I feel like I shouldnt have to use EnsureVisible because it scrolls through the page which takes a long time.

So here is my code.
DivGrid = document.FindSingle("/dom//div[#'gbox_grid1']"); //root of grid
TBodyTag tbody = DivGrid.FindSingle("/dom//table[#'grid1']/tbody");
subTotals = tbody.Find<TrTag>(".//tr[@class='ui-widget-content jqgrow ui-row-ltr']");

for(int i = 0; i< subTotals.Count; i++)
{
//subTotals.EnsureVisible(); <- so when this is not commented out I get the elements but of I commented it out I get nothing.
tdSubTotal = subTotals.Find<TdTag>(".//td[@valid ='true']"); <- if I remove the visiblity = true then I get every element within the tag which I dont need.

//Report.Info(i +" : "+ tdSubTotal[tdSubTotal.Count - placeCount].InnerText.ToString());
subTot = subTot + convertToNum(tdSubTotal[tdSubTotal.Count - placeCount].InnerText.ToString());
}

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Objects cannot be found

Post by Support Team » Fri May 02, 2014 10:09 am

Hello jonesj,

Can you please specify the issue in more detail?
I am setting up automation on this web page.
Do you mean the Ranorex website?
Can you please post a Snapshot file of your application if it is not our website. Additionally it would be helpful to get access to your application in order to reproduce the issue.
I feel like I shouldnt have to use EnsureVisible because it scrolls through the page which takes a long time.
Does that mean EnsureVisible is working, but it is working slow?
I tried to reproduce the issue with a sample page, but in my case everything works as expected.
Which browser are you using?

Please try to use the Ensure Visible feature in Ranorex Spy.
EnsureVisible.jpg
EnsureVisible.jpg (90.18 KiB) Viewed 794 times
Can you please also check if the setting "Use Ensure Visible by default" is enabled within the General Settings dialog?
Please take a look at the section General Ranorex Settings on our website in order to get more information where this setting can be found.

Regards,
Bernhard
.
Image