Last active
August 15, 2020 00:00
-
-
Save kipkitur/fca678992552a0c595dd443f8b045544 to your computer and use it in GitHub Desktop.
This file contains 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
# import modules | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
import pytest | |
# we will use Google Chrome in this test. Specify the location of your chromedriver.exe | |
webdriver_location = "\\Users\\user\\Downloads\\chromedriver_win32\\chromedriver.exe" | |
# the webpage we want to access for our test | |
webpage_link = "https://www.example.com/" | |
# Use fixtures to define the code to run before and after tests | |
# Replace line 17 with your desired webdriver and webdriver location | |
@pytest.fixture | |
def browser_setup(): | |
browser = webdriver.Chrome(webdriver_location) | |
browser.maximize_window() | |
browser.implicitly_wait(10) | |
yield browser | |
browser.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
changed line number for webdriver location in pytest fixture