Пример #1
0
def enterLogin(isEmpl):
    if isEmpl:
        navTo(
            'https://weblogin.umich.edu/?cosign-hcmprod.dsc&https://hcmprod.dsc.umich.edu/services/employee/'
        )
    else:
        navTo(
            'https://weblogin.umich.edu/?cosign-csprod.dsc&https://csprod.dsc.umich.edu/services/student/'
        )

    if "Weblogin" in driver.title:
        try:
            usr = getpass('Enter username: '******'Enter password: '******'login', usr)
            enterTextId('password', password)
            pressEnterId('password')
        except:
            print("Oops, something went wrong...")
    wait = WebDriverWait(driver, 60)
    try:
        wait.until(EC.presence_of_element_located((By.ID, 'PT_HOME')))
    except:
        driver.quit()
Пример #2
0
from cookies import readCookies, writeCookies
from webdriver import driver
from helpers import handleLogin, quitSess
from pages import Home, Student, StudentCenter, EmployeeSelfService
from helpers import navTo

#cookies = pickle.load(open("cookies.pkl", "rb"))
readCookies()
# Home()
# print(driver.title)
# # Student()
# navTo('https://csprod.dsc.umich.edu/services/student')
# print(driver.title)
# # StudentCenter()
# StudentCenter()
# print(driver.title)
# #assert "No results found." not in driver.page_source
#quitSess()
driver.quit()
Пример #3
0
def quitSess():
    writeCookies()
    driver.close()
    driver.quit()
    exit()
Пример #4
0
def waitTitle(str):
    wait = WebDriverWait(driver, 60)
    try:
        wait.until(not EC.title_is(str))
    finally:
        driver.quit()
Пример #5
0
def waitId(id):
    wait = WebDriverWait(driver, 60)
    try:
        wait.until(EC.presence_of_element_located((By.ID, id)))
    finally:
        driver.quit()