QQ邮箱自动化登陆
python吧
全部回复
仅看楼主
level 1
angere之泪 楼主
QQ账号密码登陆或点击头像登陆,怎么实习自动化测试登陆,求教下
2020年03月02日 11点03分 1
level 8
最简单的就是网页模拟操作selenium,看你是网页还是手机端了
2020年03月02日 11点03分 3
网页的,下面是代码,但好像不行,不知道是不是IF判断错误了
2020年03月03日 01点03分
@angere之泪 设置断点看看那能不能成功加点print
2020年03月03日 02点03分
@逍遥笑笑生🌙 应该不是,face元素是不是一直在的,感觉选择元素错了
2020年03月03日 02点03分
@angere之泪 随你了,你看吧,这种都简单得很
2020年03月03日 03点03分
level 1
angere之泪 楼主
driver.switch_to.frame('login_frame') # input在iframe 的这个框架下面,需要先切到这个框架下才能找到元素
#if is_element_exist("switcher_plogin"):
#driver.find_element_by_xpath("//*[@id='switcher_plogin']").click()'''
#driver.find_element_by_id("switcher_plogin").click()'''
#driver.find_element_by_xpath(".//*[@id='switcher_plogin").click()
finder=driver.find_element_by_class_name('face')
if len(finder)>0:
driver.find_element_by_class_name('face').click()
else:
driver.find_element_by_xpath(".//*[@id='u']").clear()
driver.find_element_by_xpath(".//*[@id='u']").send_keys('823997XX')
driver.find_element_by_xpath(".//*[@id='p']").send_keys("331825XXX")
driver.find_element_by_xpath(".//*[@id='login_button']").click()
#driver.find_element_by_xpath(".//*[@id='SetInfo']/div/a[3]").click()
#driver.find_element_by_xpath("/html/body/div/div[2]/div/a").click()
driver.find_element_by_xpath("//*[@id='composebtn']").click()
2020年03月03日 01点03分 5
1