Skip to content

Instantly share code, notes, and snippets.

@barancev
Created August 3, 2020 13:10
Show Gist options
  • Save barancev/0588aaea0eefdbbfcb9eb238cb715b5c to your computer and use it in GitHub Desktop.
Save barancev/0588aaea0eefdbbfcb9eb238cb715b5c to your computer and use it in GitHub Desktop.
import pytest
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from time import sleep
@pytest.fixture
def driver(request):
options = webdriver.EdgeOptions()
options.use_chromium = True
wd = webdriver.Edge(options=options)
request.addfinalizer(wd.quit)
return wd
def test_example(driver):
# pass
driver.get("https://www.google.com/")
driver.maximize_window()
sleep(4)
driver.find_element_by_name("q").clear()
sleep(4)
driver.find_element_by_name("q").send_keys("webdriver")
sleep(4)
driver.find_element_by_name("btnK").click()
WebDriverWait(driver, 10).until(EC.title_is("webdriver - Google Search"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment