WebDriver should automatically scroll to the location of the element you are using. You shouldn't have to do any execute_script for normal functionality. Is the "total number of items" a text value of an element at the bottom of the page, or does items.size give you what you need? Or do you need something else?
Titus On Thu, Nov 20, 2014 at 2:27 PM, mizan rahman <[email protected]> wrote: > Hi All, > > I am trying to go to bottom of the page and get the total number of items > but m unable to go to bottom , it stops in the middle, can any help , > please, > > here is the code i used: > > require 'watir-webdriver' > > browser = Watir::Browser.new :firefox > browser.window.maximize > browser.goto 'https://www.chloeandisabel.com/shop' > > items = browser.elements(:class => "img-responsive") > > sleep 3 > > items.each do |item| > > browser.execute_script('arguments[0].scrollIntoView();', item) > > sleep 3 > > end > > > > > Thanks, > Mizan > > -- > -- > 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] > > --- > You received this message because you are subscribed to the Google Groups > "Watir General" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- 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] --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
