def qq_login(qq_driver, user_name, user_pass):
    element = find_element_by_id(qq_driver, 'qqLoginTab')
    element.click()
    qq_driver.switch_to.frame('login_frame')
    element = find_element_by_id(qq_driver, 'u')
    element.click()
    element.send_keys(user_name)
    element = find_element_by_id(qq_driver, 'p')
    element.click()
    element.send_keys(user_pass)
    element = find_element_by_id(qq_driver, 'login_button')
    element.click()
    wait_for_frame_and_switch_to_frame(qq_driver, 'tcaptcha_iframe')
    img_element = find_element_by_id(qq_driver, 'slideBg')
    wait_for_element_appeared(qq_driver, img_element)
    big = img_element.get_attribute('src')
    request_download_file_by_url(
        big,
        GlobalParam.get_test_image_path() + 'test_qq_mail_big.png')
    img_element = find_element_by_id(qq_driver, 'slideBlock')
    wait_for_element_appeared(qq_driver, img_element)
    small = img_element.get_attribute('src')
    request_download_file_by_url(
        small,
        GlobalParam.get_test_image_path() + 'test_qq_mail_small.png')
def qq_captcha_pass():
    big_image = cv.imread(GlobalParam.get_test_image_path() +
                          'test_qq_mail_big.png')
    small_image = cv.imread(GlobalParam.get_test_image_path() +
                            'test_qq_mail_small.png')
    cv.imshow('1', small_image)
    cv.waitKey(0)