-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPart3
40 lines (27 loc) · 1.01 KB
/
Part3
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
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
driver = webdriver.Chrome()
driver.get("http://13.209.85.69/")
input_element = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, "username"))
)
input_username = driver.find_element (By.ID, "username")
input_username.send_keys("userTest1")
time.sleep(1)
input_pswd = driver.find_element(By.ID, "password")
input_pswd.send_keys("password1234")
time.sleep(1)
input_email = driver.find_element(By.ID, "email")
input_email.send_keys("sample@gmail.com")
time.sleep(1)
checkbox = driver.find_element(By.ID, "newsletter")
if not checkbox.is_selected():
checkbox.click()
button = driver.find_element(By.XPATH, "//input[@type='submit' and @value='Register']")
button.click()
time.sleep(3)
driver.quit()