'Selenium: Firefox browser not taking whole length password which provided in file
from datetime import datetime
import pytest
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.service import Service
from webdriver_manager.firefox import GeckoDriverManager
driver = None
def pytest_addoption(parser):
parser.addoption(
"--browser_name", action="store", default="chrome"
)
@pytest.fixture(scope="class")
def setup(request):
global driver
browser_name = request.config.getoption("browser_name")
if browser_name == "chrome":
s = Service(ChromeDriverManager().install())
driver = webdriver.Chrome(service=s)
elif browser_name == "firefox":
s = Service(GeckoDriverManager().install())
driver = webdriver.Firefox(service=s)
request.cls.driver = driver
yield
driver.close()
I have set two browser options to run tests. If i run tests with chrome option working fine all and getting expected result.
If I run tests with Firefox browser then in password field taking only 1 character. Because of this all tests getting failed. FYI: Username taking correctly.
Please help to solve issue what could be the reason?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
