login_ele = driver.find_element_by_css_selector("#app > div > div.header > div > div.r_userinfo.f_r > div.login > span:nth-child(2)")
ActionChains(driver).click(login_ele).perform()#触发点击事件,显示登录框
driver.find_element_by_css_selector("#app > div > div.header > div.main > div.login > div > div.mobienum > input[type=text]").clear()
driver.find_element_by_css_selector("#app > div > div.header > div.main > div.login > div > div.mobienum > input[type=text]").send_keys("13180977920")
driver.find_element_by_css_selector("#app > div > div.header > div.main > div.login > div > div.psw > input[type=password]").clear()
driver.find_element_by_css_selector("#app > div > div.header > div.main > div.login > div > div.psw > input[type=password]").send_keys("dacidabei")
login_btn_ele = driver.find_element_by_css_selector("#app > div > div.header > div.main > div.login > div > div.login_btn > button")
login_btn_ele.click()#点击登录
#移动鼠标到弹窗
user_info_ele = driver.find_element_by_css_selector("#app > div > div.header > div > div.r_userinfo.f_r > div.avatar.f_r > img")
ActionChains(driver).move_to_element(user_info_ele).perform()
#获取用户名元素
user_name_ele = driver.find_element_by_css_selector("#app > div > div.header > div > div.userbox.f_r > div > div.user > p")print("=========测试结果=============")print(user_name_ele.text)
name = user_name_ele.text
if name == u'沧海一阳':print("login ok!")else:print("login fail!")