Beispiel #1
0
def login_test(ele_dict, user_list):
    d = openBrower()
    # log = Loginfo()
    log = Xlloginfo()
    log.log_init('sheet1', 'uname', 'pwd', 'result', 'msg')
    openUrl(d, ele_dict['url'])
    ele_tuple = findElement(d, ele_dict)
    for arg in user_list:
        sendVals(ele_tuple, arg)
        result = checkResult(d, ele_dict['errorid'], arg, log)
        if result:
            # logout
            logout(d, ele_dict)
            # longin
            ele_tuple = findElement(d, ele_dict)
    log.log_close()
    d.quit()
def login_test(ele_dict, user_list):
    d = openBrower()
    # log = Loginfo()
    log = Xlloginfo()
    log.log_init('sheet1', 'uname', 'pwd', 'result', 'message')
    openUrl(d, ele_dict)
    ele_tuple = findElement(d, ele_dict)
    # print(user_list[0])
    for user_info in user_list:
        sendVal(ele_tuple, user_info)
        result = checkResult(d, ele_dict['errorid'], user_info, log)
        # sign_out
        # findOutele(d, ele_dict).click()
        if result:
            # logout
            logout(d, ele_dict)
            #login
            ele_tuple = findElement(d, ele_dict)
        else:
            ele_tuple = findElement(d, ele_dict)
    log.log_close()
Beispiel #3
0
def login_test(ele_dict, user_list):
    d = openBrower()
    log = Xlloginfo()
    log.log_init('sheet1', 'uname', 'upwd', 'ucode', 'result')
    d.maximize_window()
    openUrl(d, ele_dict['url'])
    #以元组形式,从字典中单独取值,定位元素
    ele_tuple = findElement(d, ele_dict)
    
    #调用发送值的函数,把登录信息,发送给对应定位元素,并检查
    for arg in user_list:
        sendVals(ele_tuple, arg)  
        result = checkResult(d, ele_dict['passid'], arg, log) 
        if result:
            #注销logout
            logout(d, ele_dict)
            #重新login
            ele_tuple = findElement(d, ele_dict)
            
    #关闭日志         
    log.log_close()
    
    #关闭浏览器
    d.quit()