File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,17 @@ def setUpClass(cls):
2323 chrome_options .add_argument ('--headless' )
2424 chrome_options .add_argument ('--window-size=1366,768' )
2525 chrome_options .add_argument ('--ignore-certificate-errors' )
26- chrome_options .add_argument ('--remote-debugging-port=9222' )
26+ # When running Selenium tests with the "--parallel" flag,
27+ # each TestCase class requires its own browser instance.
28+ # If the same "remote-debugging-port" is used for all
29+ # TestCase classes, it leads to failed test cases.
30+ # Therefore, it is necessary to utilize different remote
31+ # debugging ports for each TestCase. To accomplish this,
32+ # we can leverage the randomized live test server port to
33+ # generate a unique port for each browser instance.
34+ chrome_options .add_argument (
35+ f'--remote-debugging-port={ cls .server_thread .port + 100 } '
36+ )
2737 capabilities = DesiredCapabilities .CHROME
2838 capabilities ['goog:loggingPrefs' ] = {'browser' : 'ALL' }
2939 chrome_options .set_capability ('cloud:options' , capabilities )
You can’t perform that action at this time.
0 commit comments