def test_contact(self): driver.find_element_by_xpath( "//*[@data-qa='header-navigation-item-contact']").click() time.sleep(2) page = driver.find_element_by_tag_name("html") page.send_keys(Keys.END) time.sleep(1) driver.execute_script("window.scrollTo(0,400)") time.sleep(1) driver.execute_script("window.scrollTo(0,50)") time.sleep(1)
def test_scroll_blog(self): driver.execute_script("window.scrollTo(0,500)") time.sleep(1) driver.execute_script("window.scrollTo(0,900)") time.sleep(1) driver.execute_script("window.scrollTo(0,1400)") time.sleep(1) driver.execute_script("window.scrollTo(0,1900)") time.sleep(1) driver.execute_script("window.scrollTo(0,2200)") time.sleep(1) page = driver.find_element_by_tag_name("html") page.send_keys(Keys.END) time.sleep(2) driver.execute_script("window.scrollTo(0,50)") time.sleep(1)
def infinite_scrolling_PageUp(driver, page_no): elem = driver.find_element_by_tag_name('body') while page_no: elem.send_keys(Keys.PAGE_UP) time.sleep(1) page_no -= 1