测试积点老人 发表于 2021-7-28 13:13:43

运行Python自动化测试脚本过程中出现报错!

运行Python自动化测试脚本过程中出现“AttributeError: 'WebDriver' object has no attribute 'maxmize_windows'”的报错

from basepage import *
from selenium.webdriver.common.by import Byclass 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

qqq911 发表于 2021-7-29 10:25:16

检查下环境

bellas 发表于 2021-7-29 12:00:30

重新运行下
页: [1]
查看完整版本: 运行Python自动化测试脚本过程中出现报错!