Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【问题】 self.max_window() 方法报错,虽然执行成功了,但是有个报错,浏览器并没有最大化 #216

Open
kingDaima opened this issue Mar 15, 2024 · 3 comments

Comments

@kingDaima
Copy link

版本信息:
Name: seldom
Version: 3.6.0
Summary: Seldom automation testing framework based on unittest.
Home-page: https://seldomqa.github.io
Author: bugmaster
Author-email: [email protected]
License: Apache-2.0

代码:
import seldom

class BaiduTest(seldom.TestCase):
"""
* start_class/end_class
* start/end
"""

def start_class(self):
    """start class"""
    print("test class start")
    self.max_window()

报错:
test class start
2024-03-15 10:42:10 | ERROR | case.py | start_class Exception: 'NoneType' object has no attribute 'maximize_window'
test_case1 (test_fixture_demo.BaiduTest.test_case1) ... test case start

@kingDaima kingDaima changed the title self.max_window() 方法报错,虽然执行成功了,但是有个报错,浏览器并没有最大化 【问题】 self.max_window() 方法报错,虽然执行成功了,但是有个报错,浏览器并没有最大化 Mar 15, 2024
@defnngj
Copy link
Collaborator

defnngj commented Mar 20, 2024

代码没问题,应该运行方式有关,seldom 的执行入口是 seldom.mian() 方法。很可能是在 pycharm 中右键某个方法执行。

@netassa
Copy link

netassa commented Apr 17, 2024

@defnngj 我也遇到了,是使用python run.py的方式执行的:

def start(self):
    self.login_page = LoginPage()
    print("hello")
    self.max_window()

报告提示如下:
image

@netassa
Copy link

netassa commented Apr 17, 2024

@defnngj 我也遇到了,是使用python run.py的方式执行的:

def start(self):
    self.login_page = LoginPage()
    print("hello")
    self.max_window()

报告提示如下: image

好像知道原因了,是因为调用self.max_window()的时候,浏览器还没起来。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants