-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
53 lines (34 loc) · 1.36 KB
/
main.py
File metadata and controls
53 lines (34 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.action_chains import ActionChains
import time
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.chrome.options import Options
def create_webdriver_instance():
chrome_options = Options()
#chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("start-maximized")
chrome_options.add_argument("disable-infobars")
chrome_options.add_argument("--disable-extensions")
driver = webdriver.Chrome(options=chrome_options)
return driver
driver = create_webdriver_instance()
driver.get('C:\\Open Source\\Selenium Login Form\\frontend\\login\\index.html')
time.sleep(1)
emailInput = driver.find_element(By.ID, "email")
emailInput.clear()
emailInput.send_keys('test@gmail.com')
time.sleep(1)
passwordInput = driver.find_element(By.ID, "password")
passwordInput.clear()
passwordInput.send_keys('yapyapyap!')
time.sleep(1)
loginButton = driver.find_element(By.ID, 'loginButton')
loginButton.click()
time.sleep(1)
driver.quit()