Last active
August 12, 2022 14:38
-
-
Save SarahElson/8639a91a83e890d1079974331ba54ceb to your computer and use it in GitHub Desktop.
How To Download File Using Selenium Python?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium.webdriver.common.keys import Keys | |
from utils.locators import * | |
import time | |
# Page objects are written in this module. | |
class Selenium_Playground_Page(): | |
def __init__(self, driver): | |
self.locator = SeleniumPlaygroundPageLocators | |
self.driver = driver | |
def download(self, text): | |
self.driver.find_element(*self.locator.file_download).click() | |
self.driver.find_element(*self.locator.data_field).send_keys(text) | |
self.driver.find_element(*self.locator.generate_file).click() | |
self.driver.find_element(*self.locator.download_button).click() | |
time.sleep(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment