Pregunta

I have a problem with one of my tests using codeception when I try to click a link, the window scrolls, to where the browser thinks it's supposed to go, however, my site has a navigation bar attached to the bottom of the window so when the browser stops scrolling, the bottom nav is covering the link.

Because of that, the test fails. Would anyone know how to configure it to scroll a little farther? Using Codeception 1.8.5.

Thanks

¿Fue útil?

Solución 2

Had the same problem, and albeit not a solution, a workaround is to scroll the window manually to somewhere where the link is visible (adapt Y below):

 $I->executeJS('window.scrollTo(0,Y);');

Source: How can I scroll a web page using selenium webdriver in python? (Adapted for Codeception)

Otros consejos

Update: Now you can also use the scrollTo() method, with the same argument you're passing into click():

$I->scrollTo($button);
$I->click($button);

See http://codeception.com/docs/modules/WebDriver#scrollTo

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top