You might encounter an error with Python where it might be missing certificates when connecting to Sauce Labs.
The error might look like this:
[ WARN ] Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLCertVerificationError(1,
'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed:
unable to get local issuer certificate (_ssl.c:997)'))': /wd/hub/session TC10
Verify Add to Action Plan - Button Selection Func | FAIL | Setup failed:
MaxRetryError: HTTPSConnectionPool(host='ondemand.us-west-1.saucelabs.com', port=443):
Max retries exceeded with url: /wd/hub/session (Caused by SSLError
(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed: unable to get local issuer certificate (_ssl.c:997)'))
This normally appears when your machine/setup is missing certain certificates required to make the connection to Sauce Labs.
On a Mac this is significantly easier as you are able to go into the Python application folder and select 'Install certificates.command' script.
Alternatively, you can try these other commands:
python3 -c "import ssl;print(ssl.OPENSSL_VERSION)"
or
python -c "import ssl;print(ssl.OPENSSL_VERSION)"
For Windows and Mac, you want to ensure you have certifi installed in the app packages for Python so you have the required certificates.
Other useful resources:
- How to make python use ca-certificates from Mac OS trust store