Open
Description
What happened?
Not getting any suggestion regarding the webdriver in test class. ( Both in pycharm and vscode ) The code is working fine but its very difficult to type all the code manually without giving the suggestions.
How can we reproduce the issue?
Created conftest.py
code :
import pytest
from selenium import webdriver
@pytest.fixture(scope="class", autouse=True)
def driverInit(request):
driver = webdriver.Chrome()
driver.maximize_window()
driver.implicitly_wait(10)
driver.get("https://opensource-demo.orangehrmlive.com/web/index.php/auth/login")
request.cls.driver = driver
yield
driver.close
Test class file
Code :
import pytest
from selenium.webdriver.common.by import By
@pytest.mark.usefixtures("driverInit")
class TestOne:
def test_loginScenario(self):
self.driver.find_element(By.XPATH, "//input[@name='username']").send_keys("Admin")
self.driver.find_element(By.XPATH, "//input[@name='password']").send_keys("admin")
self.driver.
here after the self.driver. no suggestion?
Details :
pycharm community edition Version: 2024.1.4
python version : Python 3.12.4
pytest version : pytest 8.3.2
Relevant log output
No suggestions for webdriver is showing in test class level
Operating System
windows
Selenium version
4.23.0
What are the browser(s) and version(s) where you see this issue?
Chrome and firefox
What are the browser driver(s) and version(s) where you see this issue?
Chrome Version 127.0.6533.89 (Official Build) (64-bit)
Are you using Selenium Grid?
No response