Can't find window scrollbars -- any ideas? : Automation API

Can't find window scrollbars -- any ideas?

Class library usage, coding and language questions.

Can't find window scrollbars -- any ideas?

Postby daa » Tue Feb 09, 2010 1:33 pm

I can't find the window scrollbars on a browser for some reason. For instance, if I open FireFox and go to the main Ranorex page, reduce the browser window size until I get a scrollbar at the left, start Ranorex Spy, start tracking, and hover over the scrollbar, all I get is
/dom[@caption='Ranorex - GUI Automation & Automated Testing Tool']

I've tried searching for the scrollbars directly as well

Code: Select all
Ranorex.WebDocument lMain = @"/dom[@caption='Ranorex - GUI Automation & Automated Testing Tool']";

Report.Success("Looking for scrollbars");            
IList<Ranorex.ScrollBar> lBarList = lMain.FindDescendants<Ranorex.ScrollBar>();
foreach(Ranorex.ScrollBar lBar in lBarList)
{
   Report.Info("Found scroll bar: "+lBar.ToString());
   Report.Info(lBar.Element.GetPath(PathBuildMode.Reduce).ToString());
   Report.Info("-----------------------------------------------------------------------------------");
}

but this finds nothing. I've tried looking for the thumb and the scroll buttons as well, using Ranorex.Indicator and Ranorex.Button instead of Ranorex.Scrollbar in the code above, but still nothing.

This is Firefox on Vista, but I've tried IE as well, and the same thing on XP, and the behaviour is the same.

Am I missing something here?
David Allsopp, Mitrefinch Ltd.
User avatar
daa
 
Posts: 18
Joined: Tue May 19, 2009 3:01 pm
Location: York, UK

Re: Can't find window scrollbars -- any ideas?

Postby Support Team » Thu Feb 11, 2010 11:56 am

Hi David,

Ranorex does not support scrollbars in browser windows directly. For scrolling somewhere specific, please use EnsureVisible() on the element you want to scroll to.

If for some reason you need to scroll to the top or to the bottom use {Home} or {End} key sequences.
If you *really* need the scrollbars, you might be able to execute some inline javascript to perform the task using ExecuteScript() on the Webdocument.
(see here http://www.softcomplex.com/docs/get_window_size_and_scrollbar_position.html)

Regards,
Michael
Ranorex Team
User avatar
Support Team
Site Admin
 
Posts: 1896
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests