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'

  1. username_loc = (By.ID,'user_name')
  2. password_loc = (By.ID,'password')
  3. submit_loc = (By.ID,'login')
  4. def type_username(self,username):
  5.     self.find_element(*self.username_loc).clear()
  6.     self.find_element(*self.username_loc).send_keys(username)
  7. def type_password(self,password):
  8.     self.find_element(*self.password_loc).clear()
  9.     self.find_element(*self.password_loc).send_keys(password)
  10. def type_submit(self):
  11.     self.find_element(*self.submit_loc).click()
  12. def login_action(self,username,password):
  13.     self.open()
  14.     self.type_username(username)
  15.     self.type_password(password)
  16.     self.type_submit()

  17. loginPass_loc = (By.ID,'out')
  18. loginFail_loc = (By.LINK_TEXT,'注册页面')
  19. def type_loginPass_hit(self):
  20.     return self.find_element(*self.loginPass_loc).text
  21. def type_loginFail_hit(self):
  22.     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