>> Watir::Element#scroll_to unless unless Watir::Element#in_viewable_area? >> > > The main difficulty I have with this is that I've worked on a number > of pages where part of the design requirements were that everything > had to pretty much fit onto a specific default page size such as > 1024x768, and if something was 'not in view' then I wanted the script > to fail. In that case having the script 'break' if something was > outside that area is not a behavior I'd want to change. >
It's still a good idea to be able to scroll to the required element, although auto scrolling may be desired or unwanted depending on usage. In either case, you can always test your apps for such requirements by: 1. Resize browser to spec's dimensions. 2. Call Browser::Element.in_viewable_area? But other test which require clicking on the element's link would still pass if the element was automatically scrolled to. Why break multiple test because the element isn't in a viewable area? Have the one test that check the speck as you mentioned and allow all of your additional test which navigate the links and test other functionality do their job, to find low hanging fruit faster. just my 0.0001 cents -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
