简体   繁体   中英

Javascript code to scroll in steps using selenium webdriver

How should I scroll in steps instead directly getting to one position using driver.executeScript("scroll(0,1000)"); Tried the code below but it didn't worked..

for(var i=10;1<2000;i=+50){
    driver.executeScript("scroll(0,i)");
}

It say i is not defined. let me know where am I going wrong

driver.executeScript("scroll(0," + i + ")");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM