0

Here's my command :

 pytest -v -s -n=4 test_Cases/test_login.py --browser chrome

Here's the output:

plugins: xdist-3.1.0, html-3.2.0, metadata-2.0.4
[gw0] darwin Python 3.8.0 cwd: /Users/georgeashraf/My-    Github/Hybrid_Framework_Selenium_Python
[gw1] darwin Python 3.8.0 cwd: /Users/georgeashraf/My-Github/Hybrid_Framework_Selenium_Python
[gw2] darwin Python 3.8.0 cwd: /Users/georgeashraf/My-Github/Hybrid_Framework_Selenium_Python
[gw3] darwin Python 3.8.0 cwd: /Users/georgeashraf/My-Github/Hybrid_Framework_Selenium_Python
[gw0] Python 3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27)  -- [Clang 6.0 (clang-600.0.57)]
[gw1] Python 3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27)  -- [Clang 6.0 (clang-600.0.57)]
[gw2] Python 3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27)  -- [Clang 6.0 (clang-600.0.57)]
[gw3] Python 3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27)  -- [Clang 6.0 (clang-600.0.57)]
gw0 [2] / gw1 [2] / gw2 [2] / gw3 [2]
scheduling tests via LoadScheduling

test_Cases/test_login.py::Test_001_Login::test_homepagetitle 
test_Cases/test_login.py::Test_001_Login::test_login 
[gw0] PASSED test_Cases/test_login.py::Test_001_Login::test_homepagetitle 
[gw1] PASSED test_Cases/test_login.py::Test_001_Login::test_login 

I can see only see [gw0] & [gw1] that are passed in the output and I can't run it for [gw2]&[gw3]

Is there something I am missing?

I'm trying to run parallel tests on 4 browsers but only get 2 max

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
  • how many tests were collected? seems like only two were collected! – simpleApp Jan 29 '23 at 01:14
  • Yes only 2 were collected , how can I make it up to 4? sorry if it's a basic question I'm just starting my journey with python and pytest – GeorgeAshraf Jan 29 '23 at 01:39
  • all the best for your journey :) . so if only two are collected, it will be only two instances! you need to show us the code, so we can suggest a way. i feel that you need to add more test cases or [parameterized](https://docs.pytest.org/en/6.2.x/parametrize.html) – simpleApp Jan 29 '23 at 02:07

1 Answers1

0

It seems that your file test_login.py has only 2 tests in it and so only 2 tests are collected by pytest. If you want to run all the tests in the test_Cases folder, you could use the command

pytest -v -s -n=4 test_Cases --browser chrome

This would run all tests in the test_Cases folder in chrome browser only with 4 parallel workers.

Manish
  • 484
  • 3
  • 12