selenium.common.exceptions.ElementNotVisibleException: Message: element not interactable (Session info: chrome=74.0.3729.108) (Driver info: chromedriver=2.43.600210


解決此問題方法:與瀏覽器窗口有關,我把瀏覽器窗口設置為最大化,解決了此問題

下面上代碼

import pytest
from selenium import webdriver
from page.ddll_login import Login
@pytest.fixture(scope="session")
def int_start():
    """"""
    """初始化一個瀏覽器"""
    driver = webdriver.Chrome()
    login = Login(driver)  # 初始化登錄
    driver.maximize_window()
    yield login,driver
    # driver.quit()s
@pytest.fixture(scope="class")
def login_success(int_start):
    """登錄成功的方法"""
    login = Login(int_start[1])  # 注意。整個測試里只能出現一次(只能初始化一次瀏覽器) webdriver.Chrome()
    yield login.to_login("18684720553", "python")

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM