I am new to using protractor and want to visually see my web page scroll down to an element and it is not working. I understand scroll into allows me to visually see the scroll happen window.scroll to my understanding dosent all that. Any help would be appreciated
HTML CODE
a class="button button--secondary promo--app-button" href="https://itunes.apple.com/us/app/homes.com-real-estate-search/id306423353?mt=8&uo=4" target="_blank" data-tl-object="app_referral_hdc_portalhomefeatured_ios"> Apple Store
Protractor code:
it('scroll down page for (dropdown header search)', function () {
var EC = protractor.ExpectedConditions;
var scrolldown = $$('.button button--secondary promo--app-button').get(1);
scrolldown.scrollIntoView(true);
browser.sleep(10000);
})
Try using browser.executeScript:
var scrolldown = $$('.button button--secondary promo--app-button').get(1);
browser.controlFlow().execute(function() {
browser.executeScript('arguments[0].scrollIntoView(true)', scrolldown.getWebElement());
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With