/** * Scroll page to bring element in viewable port */ static function scrollIntoView(\RemoteWebElement $element) { $fixedHeaderHeight = 200; $y = $element->getLocation()->getY(); $js = "window.scrollTo(0,({$y}-{$fixedHeaderHeight}))"; WebDriver::instance()->executeScript($js, array()); }