pytest-dev / pytest-xdist

pytest plugin for distributed testing and loop-on-failures testing modes.
https://pytest-xdist.readthedocs.io
MIT License
1.48k stars 232 forks source link

Xdist sends invalid URL to selenium? #512

Open RuslanBM opened 4 years ago

RuslanBM commented 4 years ago

Hello. Please help me to figure out issue launch in parallel selenium based test via pytest and xdsit. I have two firefox instance at docker and launch 2 independent test this way: pytest -k "crypto" -n2

My Pipfile:

pytest==5.1.2
pytest-bdd==3.2.1
pytest-xdist==1.31.0
pytest-base-url==1.4.1
pytest-selenium==1.17.0

gcloud==0.18.3
firebase==3.0.1
python_jwt==3.2.4
sseclient-py==1.7
py-postgresql==1.2.1
requests-toolbelt==0.9.1
arrow==0.15.4
kombu==4.6.7

My pytest.ini

[pytest]
bdd_features_base_dir = tests
base_url = https://projectname.com
sensitive_url = https://projectname.com
addopts = --driver Remote
          --port 4444
          --capability browserName firefox
          --html tests/logs/report.html
          --cucumberjson=tests/uploads/cucumber.json
          --cucumberjson-expanded
          -v
filterwarnings =
    ignore::DeprecationWarning
markers =
    smoke: fast result
    crypto: add calculations

Here is track trace:

result = call_fixture_func(fixturefunc, request, kwargs) ../../.pyenv/versions/3.6.8/envs/projectname/lib/python3.6/site-packages/_pytest/fixtures.py:778: in call_fixture_func res = fixturefunc(**kwargs) tests/functional/test_02_deposit_by_dash.py:20: in user_signed_in page_main.open() ../../.pyenv/versions/3.6.8/envs/projectname/lib/python3.6/site-packages/pypom/page.py:130: in open self.driver_adapter.open(self.seed_url) ../../.pyenv/versions/3.6.8/envs/projectname/lib/python3.6/site-packages/pypom/selenium_driver.py:48: in open self.driver.get(url) ../../.pyenv/versions/3.6.8/envs/projectname/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py:333: in get self.execute(Command.GET, {'url': url}) ../../.pyenv/versions/3.6.8/envs/projectname/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py:321: in execute self.error_handler.check_response(response)


self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x10faa6f98> response = {'status': 400, 'value': '{"value":{"error":"invalid argument","message":"Malformed URL: / is not a valid URL.","stack...dArgumentError@chrome://marionette/content/error.js:304:5\nget@chrome://marionette/content/listener.js:1132:19\n"}}'} E selenium.common.exceptions.InvalidArgumentException: Message: Malformed URL: / is not a valid URL.

See more at screenshoot. It works without -n2: pytest -k "crypto"

Screenshot 2020-03-09 at 16 14 51 Screenshot 2020-03-09 at 16 15 18
RuslanBM commented 4 years ago

Looks like problem at pytest-base-url plugin https://github.com/pytest-dev/pytest-base-url/issues/10