weixin_45418986
2021-07-27 16:18
采纳率: 100%
浏览 127
已结题

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

img

img
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

img

  • 收藏

1条回答 默认 最新

  • 吃肉的小馒头 2021-07-28 09:41
    已采纳

    maxmize 还是maximize 少了个i?

    1 打赏 评论

相关推荐 更多相似问题