51Testing软件测试论坛
标题: 运行Python自动化测试脚本过程中出现报错! [打印本页]
作者: 测试积点老人 时间: 2021-7-28 13:13
标题: 运行Python自动化测试脚本过程中出现报错!
运行Python自动化测试脚本过程中出现“AttributeError: 'WebDriver' object has no attribute 'maxmize_windows'”的报错[attach]133433[/attach]
[attach]133434[/attach]
from basepage import *
from selenium.webdriver.common.by import By
class LoginPage(Page):
'''登录页面'''
url = '/teacher/login.html'
- username_loc = (By.ID,'user_name')
- password_loc = (By.ID,'password')
- submit_loc = (By.ID,'login')
- def type_username(self,username):
- self.find_element(*self.username_loc).clear()
- self.find_element(*self.username_loc).send_keys(username)
- def type_password(self,password):
- self.find_element(*self.password_loc).clear()
- self.find_element(*self.password_loc).send_keys(password)
- def type_submit(self):
- self.find_element(*self.submit_loc).click()
- def login_action(self,username,password):
- self.open()
- self.type_username(username)
- self.type_password(password)
- self.type_submit()
-
- loginPass_loc = (By.ID,'out')
- loginFail_loc = (By.LINK_TEXT,'注册页面')
- def type_loginPass_hit(self):
- return self.find_element(*self.loginPass_loc).text
- def type_loginFail_hit(self):
- return self.find_element(*self.loginFail_loc).text
复制代码[attach]133435[/attach]
作者: qqq911 时间: 2021-7-29 10:25
检查下环境
作者: bellas 时间: 2021-7-29 12:00
重新运行下
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) |
Powered by Discuz! X3.2 |