when running a test case, it gives this error whereas if I only use Selenium it works properly and test case gets executed
from selenium import webdriver
from seleniumbase import BaseCase
class OpenWebPageTest(BaseCase):
def test_open_webpage(self):
# Using Selenium WebDriver to open the webpage
driver = webdriver.Chrome()
driver.get('https://test01.rubiscape.io/#/auth/login-user')
self.assert_true("Example Domain" in driver.title)
# Using SeleniumBase to capture a screenshot
self.check_window(name="Initial_Window")
if __name__ == "__main__":
OpenWebPageTest().test_open_webpage()
The conflicting option string,
--variables, means that you have at least two differentpytestplugins installed that are initializing the--variablesoption.pytestoptions can only be initialized once. This means you have to uninstall one of plugins.By calling
pytest -h, you can see which plugins the--variablesoption is being initialized from.You also avoid this issue by installing dependencies into separate Python virtual environments. In your case, the
pytestplugins that initialize--variables(one is SeleniumBase) should be separated.Virtual Environment tutorial: https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment