diff options
| -rw-r--r-- | common/ui_common/login_logout/loginout.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/common/ui_common/login_logout/loginout.py b/common/ui_common/login_logout/loginout.py index b973623a..d9c9b3d0 100644 --- a/common/ui_common/login_logout/loginout.py +++ b/common/ui_common/login_logout/loginout.py @@ -26,15 +26,15 @@ class LogInOut: self.driver.find_element(By.XPATH, "//*[@id='details-button']").click() self.driver.find_element(By.XPATH, "//*[@id='proceed-link']").click() #输入账户和密码 - self.driver.find_element(By.XPATH, loginPage_userName_posXpath).send_keys(self.loginout_parse.get("ui_account_1", "username")) - self.driver.find_element(By.XPATH, loginPage_passwd_posXpath).send_keys(self.loginout_parse.get("ui_account_1", "passwd")) - self.driver.find_element(By.ID, loginPage_signIn_posId).click() + self.driver.find_element(By.XPATH, loginpage_username_posxpath).send_keys(self.loginout_parse.get("ui_account_1", "username")) + self.driver.find_element(By.XPATH, loginpage_passwd_posxpath).send_keys(self.loginout_parse.get("ui_account_1", "passwd")) + self.driver.find_element(By.XPATH, login_page_sign_in_posxpath).click() # 消除右上角弹框 self.dismiss_right_top_tips() # 切换至默认ui_vsys self._check_ui_vsys() # 默认更改为英语 - self._default_language() + # self._default_language() def login_other(self, url="", username="", passwd=""): """可以登录给定地址的tsg系统""" @@ -47,9 +47,9 @@ class LogInOut: self.driver.find_element(By.XPATH, "//*[@id='details-button']").click() self.driver.find_element(By.XPATH, "//*[@id='proceed-link']").click() #输入账户和密码 - self.driver.find_element(By.XPATH, loginPage_userName_posXpath).send_keys(username) - self.driver.find_element(By.XPATH, loginPage_passwd_posXpath).send_keys(passwd) - self.driver.find_element(By.ID, loginPage_signIn_posId).click() + self.driver.find_element(By.XPATH, loginpage_username_posxpath).send_keys(username) + self.driver.find_element(By.XPATH, loginpage_passwd_posxpath).send_keys(passwd) + self.driver.find_element(By.XPATH, login_page_sign_in_posxpath).click() # 消除右上角弹框 self.dismiss_right_top_tips() # 切换至默认ui_vsys @@ -59,8 +59,8 @@ class LogInOut: def _default_language(self): # 获取当前默认语言,并设置为英语 - current_language = self.driver.find_element(By.XPATH, mainPage_input_language_posXpath).get_attribute("class").strip() - if "enSelect" != current_language.lower(): + current_language = self.driver.find_element(By.XPATH, mainpage_input_language_posxpath).get_attribute("value").strip() + if "english" != current_language.lower(): self.driver.find_element(By.XPATH, mainPage_language_change_posXpath).click() self.driver.find_element(By.XPATH, mainPage_language_english_posXpath).click() @@ -117,9 +117,9 @@ class LogInOut: """ self.driver.get(self.tsglogin_url) #输入账户和密码 - self.driver.find_element(By.XPATH, loginPage_userName_posXpath).send_keys(user_name) - self.driver.find_element(By.XPATH, loginPage_passwd_posXpath).send_keys(passowrd) - self.driver.find_element(By.ID, loginPage_signIn_posId).click() + self.driver.find_element(By.XPATH, loginpage_username_posxpath).send_keys(user_name) + self.driver.find_element(By.XPATH, loginpage_passwd_posxpath).send_keys(passowrd) + self.driver.find_element(By.XPATH, login_page_sign_in_posxpath).click() def logout(self): user_btn = self.driver.find_element(By.XPATH, "//*[@id='user_avator']//i") # 点击账户按钮 |
