Пример #1
0
    # #
    # for i in ele_ids:
    #     eles.append(find_eles(login_page, i))
    #
    # nloops = range(len(eles))
    # for i in nloops:
    #     t0 = threading.Thread(target=find_eles, args=(login_page, eles))
    #     print(t0)
    #     t1 = threading.Thread(target=click_ele, args=(eles[i],))
    #     t2 = threading.Thread(target=click_next, args=(login_page,))
    #     threads.append(t1)
    # print(threads)
    #
    # for i in nloops:
    #     t0.start()
    #     threads[i].start()
    #     t2.start()
    #     t2.join()

    # for i in nloops:
    #     threads[i].join()
    #     t2.join()


if __name__ == '__main__':
    login_page = LoginPage()
    login_page.open(noReset=True)
    sleep(15)
    main(login_page)
    # for i in range(100):
    #     main(login_page)
Пример #2
0
from multiprocessing.dummy import Pool as ThreadPool

item_class = (By.CLASS_NAME, "android.widget.TextView")
evaluation_id = (By.ID, 'com.langlib.cee:id/evaluation')
action_id = (By.ID, 'com.langlib.cee:id/evaluation_begin_tv')
# com.langlib.cee:id/evaluation_begin_tv
a = "com.langlib.cee:id/fragment_word_trans_detail_answer_a"
radio_id = (By.ID, "com.langlib.cee:id/fragment_word_trans_detail_answer_a")
radio_b_id = (By.ID, "com.langlib.cee:id/fragment_word_trans_detail_answer_b")
radio_classes = (By.CLASS_NAME, "android.widget.RadioButton")
edit_id = (By.ID, "com.langlib.cee:id/write_measure_edit")
next_id = (By.ID, "com.langlib.cee:id/senavaly_quest_next_quest")
title_id = (By.ID, "com.langlib.cee:id/title_iframe_title_tv")
web_class = (By.CLASS_NAME, "android.widget.ScrollView")
step_1_id = (By.ID, "com.langlib.cee:id/measure_step_one")
login_page = LoginPage()
login_page.open(noReset=True)
sleep(15)
# print("test", login_page)
# c = login_page.get_driver()
# print("C",c)
# sleep(15)
# print(login_page.page_source_test())
# sleep(15)
# step = login_page.find_element(*step_1_id)
# print(login_page.getText(step))
# login_page.find_element(*action_id).click()
# sleep(5)

# login_page.find_element(*edit_id).send_keys("hshhs")
# login_page.find_element(*next_id).click()
Пример #3
0
from testcase.page.reg_login_page.login_page.loginPage import LoginPage
from selenium.webdriver.common.by import By
from time import sleep

account_text = (By.LINK_TEXT, u'账号密码登录')
account_id = (By.ID, "com.langlib.cee:id/account_login_account")
account_del_id = (By.ID, "com.langlib.cee:id/account_login_account_delete_btn")
pwd_id = (By.ID, "com.langlib.cee:id/account_login_password")
eye_id = (By.ID, "com.langlib.cee:id/account_login_password_checkbox")
tips_msg = r"用户名或密码错误"
tips_msg_id = (By.ID, "com.langlib.cee:id/account_login_prompt")
submit_id1 = (By.ID, "com.langlib.cee:id/account_login_btn")

login_page = LoginPage()
login_page.open()
sleep(20)
login_page.find_element(*account_id).send_keys(123)
login_page.find_element(*pwd_id).send_keys(123)
login_page.find_element(*submit_id1).click()

ele = login_page.find_element(*tips_msg_id)
print(ele.text)
def start_app(noReset=None):
    login_page = LoginPage()
    login_page.open(noReset)
    sleep(20)
    logger.info("Start_app success")
    return login_page