LRR/test/SeleniumNeil/TEST_CREATED_TA.py

27 lines
767 B
Python

import time
from selenium import webdriver
from selenium.webdriver.common.by import By
driver_open = webdriver.Chrome()
# Open the website
driver_open.get("http://localhost/lrr/")
try:
username_input = driver_open.find_element('name', "user")
password_input = driver_open.find_element('name', "password")
login_button = driver_open.find_element('id', "login_btn")
# login as the new TA
username_input.send_keys("lanhuitest@test.com") # login with credentials of the created TA
password_input.send_keys("lanhui12345678")
# Click the login button
login_button.click()
my_course = driver_open.find_element(By.CLASS_NAME, "display-6")
print(" WELCOME TA YOU ARE IN")
time.sleep(20)
finally:
driver_open.quit()