Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update Poetry to 1.5.1 (last version supporting Python 3.7) #392

Merged
merged 1 commit into from
Sep 26, 2023

chore: update Poetry to 1.5.1 (last version supporting Python 3.7)

dc44141
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

chore: update Poetry to 1.5.1 (last version supporting Python 3.7) #392

chore: update Poetry to 1.5.1 (last version supporting Python 3.7)
dc44141
Select commit
Loading
Failed to load commit list.
GitHub Actions / test-report-Object__chrome_test_splunk_ta_example_addon_account failed Sep 26, 2023 in 0s

test-report-Object__chrome_test_splunk_ta_example_addon_account ❌

Tests failed

❌ test-results/test.xml

60 tests were completed in 4164s with 0 passed, 59 failed and 1 skipped.

Test suite Passed Failed Skipped Time
pytest 59❌ 1⚪ 4164s

❌ pytest

tests.ui.test_splunk_ta_example_addon_account.chrome_TestAccount
  ❌ test_account_default_rows_in_table
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_default_rows_in_table>>
  ❌ test_account_sort_functionality
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_sort_functionality>>
  ❌ test_account_count
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_count>>
  ❌ test_accounts_filter_functionality_negative
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_accounts_filter_functionality_negative>>
  ❌ test_accounts_filter_functionality_positive
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_accounts_filter_functionality_positive>>
  ❌ test_account_pagination
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_pagination>>
  ❌ test_account_title_and_description
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_title_and_description>>
  ❌ test_account_add_valid_title
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_add_valid_title>>
  ❌ test_account_edit_valid_title
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_edit_valid_title>>
  ❌ test_account_clone_valid_title
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_clone_valid_title>>
  ❌ test_account_delete_valid_title
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_delete_valid_title>>
  ❌ test_account_add_close_entity
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_add_close_entity>>
  ❌ test_account_add_cancel_entity
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_add_cancel_entity>>
  ❌ test_account_delete_close_entity
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_delete_close_entity>>
  ❌ test_account_delete_cancel_entity
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_delete_cancel_entity>>
  ❌ test_account_edit_close_entity
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_edit_close_entity>>
  ❌ test_account_edit_cancel_entity
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_edit_cancel_entity>>
  ❌ test_account_clone_close_entity
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_clone_close_entity>>
  ❌ test_account_clone_cancel_entity
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_clone_cancel_entity>>
  ❌ test_account_delete_valid_prompt_message
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_delete_valid_prompt_message>>
  ❌ test_account_required_field_username
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_required_field_username>>
  ❌ test_account_required_field_password
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_required_field_password>>
  ❌ test_account_encrypted_field_password
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_encrypted_field_password>>
  ❌ test_account_required_field_name
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_required_field_name>>
  ❌ test_account_basic_fields_label_entity
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_basic_fields_label_entity>>
  ❌ test_account_oauth_fields_label_entity
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_oauth_fields_label_entity>>
  ❌ test_account_fields_placeholder_value
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_fields_placeholder_value>>
  ❌ test_account_help_text_entity
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_help_text_entity>>
  ⚪ test_account_required_field_example_environment
  ❌ test_account_required_field_example_multiple_select
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_required_field_example_multiple_select>>
  ❌ test_account_required_field_client_id
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_required_field_client_id>>
  ❌ test_account_required_field_client_secret
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_required_field_client_secret>>
  ❌ test_account_encrypted_field_client_secret
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_encrypted_field_client_secret>>
  ❌ test_account_valid_account_name
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_valid_account_name>>
  ❌ test_account_valid_length_name
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_valid_length_name>>
  ❌ test_account_default_value_example_environment
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_default_value_example_environment>>
  ❌ test_account_list_example_environment
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_list_example_environment>>
  ❌ test_account_default_value_auth_type
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_default_value_auth_type>>
  ❌ test_account_list_auth_type
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_list_auth_type>>
  ❌ test_account_checked_example_checkbox
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_checked_example_checkbox>>
  ❌ test_account_select_value_example_environment
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_select_value_example_environment>>
  ❌ test_account_list_example_multiple_select
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_list_example_multiple_select>>
  ❌ test_account_select_value_example_multiple_select
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_select_value_example_multiple_select>>
  ❌ test_account_search_value_example_multiple_select
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_search_value_example_multiple_select>>
  ❌ test_account_default_value_example_radio
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_default_value_example_radio>>
  ❌ test_add_account_duplicate_name
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_add_account_duplicate_name>>
  ❌ test_account_delete_row_frontend_validation
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_delete_row_frontend_validation>>
  ❌ test_account_edit_uneditable_field_name
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_edit_uneditable_field_name>>
  ❌ test_account_credentials_encrypted_value
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_credentials_encrypted_value>>
  ❌ test_account_add_frontend_validation
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_add_frontend_validation>>
  ❌ test_account_edit_frontend_validation
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_edit_frontend_validation>>
  ❌ test_clone_account_duplicate_name
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_clone_account_duplicate_name>>
  ❌ test_account_clone_frontend_validation
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_clone_frontend_validation>>
  ❌ test_account_clone_default_values
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_clone_default_values>>
  ❌ test_account_add_backend_validation
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_add_backend_validation>>
  ❌ test_account_edit_backend_validation
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_edit_backend_validation>>
  ❌ test_account_clone_backend_validation
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_clone_backend_validation>>
  ❌ test_account_delete_row_backend_validation
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_delete_row_backend_validation>>
  ❌ test_account_helplink
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_helplink>>
  ❌ test_account_delete_account_in_use
	request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_delete_account_in_use>>

Annotations

Check failure on line 0 in test-results/test.xml

See this annotation in the file changed.

@github-actions github-actions / test-report-Object__chrome_test_splunk_ta_example_addon_account

pytest ► tests.ui.test_splunk_ta_example_addon_account.chrome_TestAccount ► test_account_default_rows_in_table

Failed test found in:
  test-results/test.xml
Error:
  request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_default_rows_in_table>>
Raw output
request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_default_rows_in_table>>

    @pytest.fixture(scope="function", autouse=True)
    def ucc_smartx_selenium_wrapper(request):
        """
        Calls ucc_smartx_selenium_helper fixture
        """
        if "ucc_smartx_selenium_helper" in request.fixturenames:
>           request.node.selenium_helper = request.getfixturevalue(
                "ucc_smartx_selenium_helper"
            )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:254: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_default_rows_in_table>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
                selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )
                break
            except Exception as e:
                last_exc = e
                LOGGER.warn(
                    "Failed to configure the browser or login to Splunk instance for - Try={} \nTRACEBACK::{}".format(
                        try_number, traceback.format_exc()
                    )
                )
        else:
            LOGGER.error(
                "Could not connect to Browser or login to Splunk instance. Please check the logs for detailed error of each retry"
            )
>           raise (last_exc)

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:198: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_default_rows_in_table>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
>               selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab142f8e0>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_default_rows_in_table'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )
    
            # selenium local stack
            elif browser == "chrome_grid":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://chrome-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_grid":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://firefox-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
            # kubernetes selenium
            elif browser == "chrome_k8s":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_k8s":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
    
            elif browser == "edge":
                if debug:
                    self.browser = Edge(
                        executable_path="msedgedriver",
                        desired_capabilities=self.get_local_edge_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    command_executor = EdgeRemoteConnection(
                        "https://ondemand.saucelabs.com:443/wd/hub"
                    )
                    options = EdgeOptions()
                    options.use_chromium = True
                    self.browser = webdriver.Remote(
                        command_executor=command_executor,
                        options=options,
                        desired_capabilities=self.get_sauce_edge_opts(browser_version),
                    )
    
            elif browser == "IE":
                if debug:
                    self.browser = webdriver.Ie(capabilities=self.get_local_ie_opts())
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_ie_opts(browser_version),
                    )
            elif browser == "safari":
                if debug:
                    self.browser = webdriver.Safari()
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_safari_opts(
                            browser_version
                        ),
                    )
            else:
                raise Exception(
                    "No valid browser found.! expected=[firefox, chrome, safari], got={}".format(
                        browser
                    )
                )
        except Exception as e:
>           raise e

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:203: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab142f8e0>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_default_rows_in_table'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
>                   self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
command_executor = 'https://ondemand.saucelabs.com:443/wd/hub'
desired_capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None, proxy = None, keep_alive = False, file_detector = None
options = None

    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
                 desired_capabilities=None, browser_profile=None, proxy=None,
                 keep_alive=False, file_detector=None, options=None):
        """
        Create a new driver that will issue commands using the wire protocol.
    
        :Args:
         - command_executor - Either a string representing URL of the remote server or a custom
             remote_connection.RemoteConnection object. Defaults to 'http://127.0.0.1:4444/wd/hub'.
         - desired_capabilities - A dictionary of capabilities to request when
             starting the browser session. Required parameter.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object.
             Only used if Firefox is requested. Optional.
         - proxy - A selenium.webdriver.common.proxy.Proxy object. The browser session will
             be started with given proxy settings, if possible. Optional.
         - keep_alive - Whether to configure remote_connection.RemoteConnection to use
             HTTP keep-alive. Defaults to False.
         - file_detector - Pass custom file detector object during instantiation. If None,
             then default LocalFileDetector() will be used.
         - options - instance of a driver options.Options class
        """
        capabilities = {}
        if options is not None:
            capabilities = options.to_capabilities()
        if desired_capabilities is not None:
            if not isinstance(desired_capabilities, dict):
                raise WebDriverException("Desired Capabilities must be a dictionary")
            else:
                capabilities.update(desired_capabilities)
        if proxy is not None:
            warnings.warn("Please use FirefoxOptions to set proxy",
                          DeprecationWarning, stacklevel=2)
            proxy.add_to_capabilities(capabilities)
        self.command_executor = command_executor
        if type(self.command_executor) is bytes or isinstance(self.command_executor, str):
            self.command_executor = RemoteConnection(command_executor, keep_alive=keep_alive)
        self._is_remote = True
        self.session_id = None
        self.capabilities = {}
        self.error_handler = ErrorHandler()
        self.start_client()
        if browser_profile is not None:
            warnings.warn("Please use FirefoxOptions to set browser profile",
                          DeprecationWarning, stacklevel=2)
>       self.start_session(capabilities, browser_profile)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None

    def start_session(self, capabilities, browser_profile=None):
        """
        Creates a new session with the desired capabilities.
    
        :Args:
         - browser_name - The name of the browser to request.
         - version - Which browser version to request.
         - platform - Which platform to request the browser on.
         - javascript_enabled - Whether the new session should support JavaScript.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object. Only used if Firefox is requested.
        """
        if not isinstance(capabilities, dict):
            raise InvalidArgumentException("Capabilities must be a dictionary")
        if browser_profile:
            if "moz:firefoxOptions" in capabilities:
                capabilities["moz:firefoxOptions"]["profile"] = browser_profile.encoded
            else:
                capabilities.update({'firefox_profile': browser_profile.encoded})
        w3c_caps = _make_w3c_caps(capabilities)
        parameters = {"capabilities": w3c_caps,
                      "desiredCapabilities": capabilities}
>       response = self.execute(Command.NEW_SESSION, parameters)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
driver_command = 'newSession'
params = {'capabilities': {'alwaysMatch': {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ...ns': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}}

    def execute(self, driver_command, params=None):
        """
        Sends a command to be executed by a command.CommandExecutor.
    
        :Args:
         - driver_command: The name of the command to execute as a string.
         - params: A dictionary of named parameters to send with the command.
    
        :Returns:
          The command's JSON response loaded into a dictionary object.
        """
        if self.session_id is not None:
            if not params:
                params = {'sessionId': self.session_id}
            elif 'sessionId' not in params:
                params['sessionId'] = self.session_id
    
        params = self._wrap_value(params)
        response = self.command_executor.execute(driver_command, params)
        if response:
>           self.error_handler.check_response(response)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:321: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f6ab142dcf0>
response = {'status': 500, 'value': '{"status": 13, "sessionId": "1aa502d0f5ab49c0a3815280c762aaf5", "value": {"message": "Sauce ...r more information on what happened, please visit https://app.saucelabs.com/tests/1aa502d0f5ab49c0a3815280c762aaf5"}}'}

    def check_response(self, response):
        """
        Checks that a JSON response from the WebDriver does not have an error.
    
        :Args:
         - response - The JSON response from the WebDriver server as a dictionary
           object.
    
        :Raises: If the response contains an error message.
        """
        status = response.get('status', None)
        if status is None or status == ErrorCode.SUCCESS:
            return
        value = None
        message = response.get("message", "")
        screen = response.get("screen", "")
        stacktrace = None
        if isinstance(status, int):
            value_json = response.get('value', None)
            if value_json and isinstance(value_json, basestring):
                import json
                try:
                    value = json.loads(value_json)
                    if len(value.keys()) == 1:
                        value = value['value']
                    status = value.get('error', None)
                    if status is None:
                        status = value["status"]
                        message = value["value"]
                        if not isinstance(message, basestring):
                            value = message
                            message = message.get('message')
                    else:
                        message = value.get('message', None)
                except ValueError:
                    pass
    
        exception_class = ErrorInResponseException
        if status in ErrorCode.NO_SUCH_ELEMENT:
            exception_class = NoSuchElementException
        elif status in ErrorCode.NO_SUCH_FRAME:
            exception_class = NoSuchFrameException
        elif status in ErrorCode.NO_SUCH_WINDOW:
            exception_class = NoSuchWindowException
        elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
            exception_class = StaleElementReferenceException
        elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
            exception_class = ElementNotVisibleException
        elif status in ErrorCode.INVALID_ELEMENT_STATE:
            exception_class = InvalidElementStateException
        elif status in ErrorCode.INVALID_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
            exception_class = InvalidSelectorException
        elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
            exception_class = ElementNotSelectableException
        elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
            exception_class = ElementNotInteractableException
        elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
            exception_class = InvalidCookieDomainException
        elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
            exception_class = UnableToSetCookieException
        elif status in ErrorCode.TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.SCRIPT_TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.UNKNOWN_ERROR:
            exception_class = WebDriverException
        elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
            exception_class = UnexpectedAlertPresentException
        elif status in ErrorCode.NO_ALERT_OPEN:
            exception_class = NoAlertPresentException
        elif status in ErrorCode.IME_NOT_AVAILABLE:
            exception_class = ImeNotAvailableException
        elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
            exception_class = ImeActivationFailedException
        elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
            exception_class = MoveTargetOutOfBoundsException
        elif status in ErrorCode.JAVASCRIPT_ERROR:
            exception_class = JavascriptException
        elif status in ErrorCode.SESSION_NOT_CREATED:
            exception_class = SessionNotCreatedException
        elif status in ErrorCode.INVALID_ARGUMENT:
            exception_class = InvalidArgumentException
        elif status in ErrorCode.NO_SUCH_COOKIE:
            exception_class = NoSuchCookieException
        elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
            exception_class = ScreenshotException
        elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
            exception_class = ElementClickInterceptedException
        elif status in ErrorCode.INSECURE_CERTIFICATE:
            exception_class = InsecureCertificateException
        elif status in ErrorCode.INVALID_COORDINATES:
            exception_class = InvalidCoordinatesException
        elif status in ErrorCode.INVALID_SESSION_ID:
            exception_class = InvalidSessionIdException
        elif status in ErrorCode.UNKNOWN_METHOD:
            exception_class = UnknownMethodException
        else:
            exception_class = WebDriverException
        if value == '' or value is None:
            value = response['value']
        if isinstance(value, basestring):
            if exception_class == ErrorInResponseException:
                raise exception_class(response, value)
            raise exception_class(value)
        if message == "" and 'message' in value:
            message = value['message']
    
        screen = None
        if 'screen' in value:
            screen = value['screen']
    
        stacktrace = None
        if 'stackTrace' in value and value['stackTrace']:
            stacktrace = []
            try:
                for frame in value['stackTrace']:
                    line = self._value_or_default(frame, 'lineNumber', '')
                    file = self._value_or_default(frame, 'fileName', '<anonymous>')
                    if line:
                        file = "%s:%s" % (file, line)
                    meth = self._value_or_default(frame, 'methodName', '<anonymous>')
                    if 'className' in frame:
                        meth = "%s.%s" % (frame['className'], meth)
                    msg = "    at %s (%s)"
                    msg = msg % (meth, file)
                    stacktrace.append(msg)
            except TypeError:
                pass
        if exception_class == ErrorInResponseException:
            raise exception_class(response, message)
        elif exception_class == UnexpectedAlertPresentException:
            alert_text = None
            if 'data' in value:
                alert_text = value['data'].get('text')
            elif 'alert' in value:
                alert_text = value['alert'].get('text')
            raise exception_class(message, screen, stacktrace, alert_text)
>       raise exception_class(message, screen, stacktrace)
E       selenium.common.exceptions.WebDriverException: Message: Sauce could not start your job. For more information on what happened, please visit https://app.saucelabs.com/tests/1aa502d0f5ab49c0a3815280c762aaf5

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py:242: WebDriverException

Check failure on line 0 in test-results/test.xml

See this annotation in the file changed.

@github-actions github-actions / test-report-Object__chrome_test_splunk_ta_example_addon_account

pytest ► tests.ui.test_splunk_ta_example_addon_account.chrome_TestAccount ► test_account_sort_functionality

Failed test found in:
  test-results/test.xml
Error:
  request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_sort_functionality>>
Raw output
request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_sort_functionality>>

    @pytest.fixture(scope="function", autouse=True)
    def ucc_smartx_selenium_wrapper(request):
        """
        Calls ucc_smartx_selenium_helper fixture
        """
        if "ucc_smartx_selenium_helper" in request.fixturenames:
>           request.node.selenium_helper = request.getfixturevalue(
                "ucc_smartx_selenium_helper"
            )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:254: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_sort_functionality>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
                selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )
                break
            except Exception as e:
                last_exc = e
                LOGGER.warn(
                    "Failed to configure the browser or login to Splunk instance for - Try={} \nTRACEBACK::{}".format(
                        try_number, traceback.format_exc()
                    )
                )
        else:
            LOGGER.error(
                "Could not connect to Browser or login to Splunk instance. Please check the logs for detailed error of each retry"
            )
>           raise (last_exc)

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:198: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_sort_functionality>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
>               selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab13a3610>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_sort_functionality'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )
    
            # selenium local stack
            elif browser == "chrome_grid":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://chrome-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_grid":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://firefox-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
            # kubernetes selenium
            elif browser == "chrome_k8s":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_k8s":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
    
            elif browser == "edge":
                if debug:
                    self.browser = Edge(
                        executable_path="msedgedriver",
                        desired_capabilities=self.get_local_edge_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    command_executor = EdgeRemoteConnection(
                        "https://ondemand.saucelabs.com:443/wd/hub"
                    )
                    options = EdgeOptions()
                    options.use_chromium = True
                    self.browser = webdriver.Remote(
                        command_executor=command_executor,
                        options=options,
                        desired_capabilities=self.get_sauce_edge_opts(browser_version),
                    )
    
            elif browser == "IE":
                if debug:
                    self.browser = webdriver.Ie(capabilities=self.get_local_ie_opts())
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_ie_opts(browser_version),
                    )
            elif browser == "safari":
                if debug:
                    self.browser = webdriver.Safari()
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_safari_opts(
                            browser_version
                        ),
                    )
            else:
                raise Exception(
                    "No valid browser found.! expected=[firefox, chrome, safari], got={}".format(
                        browser
                    )
                )
        except Exception as e:
>           raise e

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:203: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab13a3610>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_sort_functionality'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
>                   self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
command_executor = 'https://ondemand.saucelabs.com:443/wd/hub'
desired_capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None, proxy = None, keep_alive = False, file_detector = None
options = None

    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
                 desired_capabilities=None, browser_profile=None, proxy=None,
                 keep_alive=False, file_detector=None, options=None):
        """
        Create a new driver that will issue commands using the wire protocol.
    
        :Args:
         - command_executor - Either a string representing URL of the remote server or a custom
             remote_connection.RemoteConnection object. Defaults to 'http://127.0.0.1:4444/wd/hub'.
         - desired_capabilities - A dictionary of capabilities to request when
             starting the browser session. Required parameter.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object.
             Only used if Firefox is requested. Optional.
         - proxy - A selenium.webdriver.common.proxy.Proxy object. The browser session will
             be started with given proxy settings, if possible. Optional.
         - keep_alive - Whether to configure remote_connection.RemoteConnection to use
             HTTP keep-alive. Defaults to False.
         - file_detector - Pass custom file detector object during instantiation. If None,
             then default LocalFileDetector() will be used.
         - options - instance of a driver options.Options class
        """
        capabilities = {}
        if options is not None:
            capabilities = options.to_capabilities()
        if desired_capabilities is not None:
            if not isinstance(desired_capabilities, dict):
                raise WebDriverException("Desired Capabilities must be a dictionary")
            else:
                capabilities.update(desired_capabilities)
        if proxy is not None:
            warnings.warn("Please use FirefoxOptions to set proxy",
                          DeprecationWarning, stacklevel=2)
            proxy.add_to_capabilities(capabilities)
        self.command_executor = command_executor
        if type(self.command_executor) is bytes or isinstance(self.command_executor, str):
            self.command_executor = RemoteConnection(command_executor, keep_alive=keep_alive)
        self._is_remote = True
        self.session_id = None
        self.capabilities = {}
        self.error_handler = ErrorHandler()
        self.start_client()
        if browser_profile is not None:
            warnings.warn("Please use FirefoxOptions to set browser profile",
                          DeprecationWarning, stacklevel=2)
>       self.start_session(capabilities, browser_profile)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None

    def start_session(self, capabilities, browser_profile=None):
        """
        Creates a new session with the desired capabilities.
    
        :Args:
         - browser_name - The name of the browser to request.
         - version - Which browser version to request.
         - platform - Which platform to request the browser on.
         - javascript_enabled - Whether the new session should support JavaScript.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object. Only used if Firefox is requested.
        """
        if not isinstance(capabilities, dict):
            raise InvalidArgumentException("Capabilities must be a dictionary")
        if browser_profile:
            if "moz:firefoxOptions" in capabilities:
                capabilities["moz:firefoxOptions"]["profile"] = browser_profile.encoded
            else:
                capabilities.update({'firefox_profile': browser_profile.encoded})
        w3c_caps = _make_w3c_caps(capabilities)
        parameters = {"capabilities": w3c_caps,
                      "desiredCapabilities": capabilities}
>       response = self.execute(Command.NEW_SESSION, parameters)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
driver_command = 'newSession'
params = {'capabilities': {'alwaysMatch': {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ...ns': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}}

    def execute(self, driver_command, params=None):
        """
        Sends a command to be executed by a command.CommandExecutor.
    
        :Args:
         - driver_command: The name of the command to execute as a string.
         - params: A dictionary of named parameters to send with the command.
    
        :Returns:
          The command's JSON response loaded into a dictionary object.
        """
        if self.session_id is not None:
            if not params:
                params = {'sessionId': self.session_id}
            elif 'sessionId' not in params:
                params['sessionId'] = self.session_id
    
        params = self._wrap_value(params)
        response = self.command_executor.execute(driver_command, params)
        if response:
>           self.error_handler.check_response(response)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:321: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f6ab13a17e0>
response = {'status': 500, 'value': '{"status": 13, "sessionId": "4287d753722c465e91b2779d5cf47e50", "value": {"message": "Sauce ...r more information on what happened, please visit https://app.saucelabs.com/tests/4287d753722c465e91b2779d5cf47e50"}}'}

    def check_response(self, response):
        """
        Checks that a JSON response from the WebDriver does not have an error.
    
        :Args:
         - response - The JSON response from the WebDriver server as a dictionary
           object.
    
        :Raises: If the response contains an error message.
        """
        status = response.get('status', None)
        if status is None or status == ErrorCode.SUCCESS:
            return
        value = None
        message = response.get("message", "")
        screen = response.get("screen", "")
        stacktrace = None
        if isinstance(status, int):
            value_json = response.get('value', None)
            if value_json and isinstance(value_json, basestring):
                import json
                try:
                    value = json.loads(value_json)
                    if len(value.keys()) == 1:
                        value = value['value']
                    status = value.get('error', None)
                    if status is None:
                        status = value["status"]
                        message = value["value"]
                        if not isinstance(message, basestring):
                            value = message
                            message = message.get('message')
                    else:
                        message = value.get('message', None)
                except ValueError:
                    pass
    
        exception_class = ErrorInResponseException
        if status in ErrorCode.NO_SUCH_ELEMENT:
            exception_class = NoSuchElementException
        elif status in ErrorCode.NO_SUCH_FRAME:
            exception_class = NoSuchFrameException
        elif status in ErrorCode.NO_SUCH_WINDOW:
            exception_class = NoSuchWindowException
        elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
            exception_class = StaleElementReferenceException
        elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
            exception_class = ElementNotVisibleException
        elif status in ErrorCode.INVALID_ELEMENT_STATE:
            exception_class = InvalidElementStateException
        elif status in ErrorCode.INVALID_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
            exception_class = InvalidSelectorException
        elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
            exception_class = ElementNotSelectableException
        elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
            exception_class = ElementNotInteractableException
        elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
            exception_class = InvalidCookieDomainException
        elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
            exception_class = UnableToSetCookieException
        elif status in ErrorCode.TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.SCRIPT_TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.UNKNOWN_ERROR:
            exception_class = WebDriverException
        elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
            exception_class = UnexpectedAlertPresentException
        elif status in ErrorCode.NO_ALERT_OPEN:
            exception_class = NoAlertPresentException
        elif status in ErrorCode.IME_NOT_AVAILABLE:
            exception_class = ImeNotAvailableException
        elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
            exception_class = ImeActivationFailedException
        elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
            exception_class = MoveTargetOutOfBoundsException
        elif status in ErrorCode.JAVASCRIPT_ERROR:
            exception_class = JavascriptException
        elif status in ErrorCode.SESSION_NOT_CREATED:
            exception_class = SessionNotCreatedException
        elif status in ErrorCode.INVALID_ARGUMENT:
            exception_class = InvalidArgumentException
        elif status in ErrorCode.NO_SUCH_COOKIE:
            exception_class = NoSuchCookieException
        elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
            exception_class = ScreenshotException
        elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
            exception_class = ElementClickInterceptedException
        elif status in ErrorCode.INSECURE_CERTIFICATE:
            exception_class = InsecureCertificateException
        elif status in ErrorCode.INVALID_COORDINATES:
            exception_class = InvalidCoordinatesException
        elif status in ErrorCode.INVALID_SESSION_ID:
            exception_class = InvalidSessionIdException
        elif status in ErrorCode.UNKNOWN_METHOD:
            exception_class = UnknownMethodException
        else:
            exception_class = WebDriverException
        if value == '' or value is None:
            value = response['value']
        if isinstance(value, basestring):
            if exception_class == ErrorInResponseException:
                raise exception_class(response, value)
            raise exception_class(value)
        if message == "" and 'message' in value:
            message = value['message']
    
        screen = None
        if 'screen' in value:
            screen = value['screen']
    
        stacktrace = None
        if 'stackTrace' in value and value['stackTrace']:
            stacktrace = []
            try:
                for frame in value['stackTrace']:
                    line = self._value_or_default(frame, 'lineNumber', '')
                    file = self._value_or_default(frame, 'fileName', '<anonymous>')
                    if line:
                        file = "%s:%s" % (file, line)
                    meth = self._value_or_default(frame, 'methodName', '<anonymous>')
                    if 'className' in frame:
                        meth = "%s.%s" % (frame['className'], meth)
                    msg = "    at %s (%s)"
                    msg = msg % (meth, file)
                    stacktrace.append(msg)
            except TypeError:
                pass
        if exception_class == ErrorInResponseException:
            raise exception_class(response, message)
        elif exception_class == UnexpectedAlertPresentException:
            alert_text = None
            if 'data' in value:
                alert_text = value['data'].get('text')
            elif 'alert' in value:
                alert_text = value['alert'].get('text')
            raise exception_class(message, screen, stacktrace, alert_text)
>       raise exception_class(message, screen, stacktrace)
E       selenium.common.exceptions.WebDriverException: Message: Sauce could not start your job. For more information on what happened, please visit https://app.saucelabs.com/tests/4287d753722c465e91b2779d5cf47e50

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py:242: WebDriverException

Check failure on line 0 in test-results/test.xml

See this annotation in the file changed.

@github-actions github-actions / test-report-Object__chrome_test_splunk_ta_example_addon_account

pytest ► tests.ui.test_splunk_ta_example_addon_account.chrome_TestAccount ► test_account_count

Failed test found in:
  test-results/test.xml
Error:
  request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_count>>
Raw output
request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_count>>

    @pytest.fixture(scope="function", autouse=True)
    def ucc_smartx_selenium_wrapper(request):
        """
        Calls ucc_smartx_selenium_helper fixture
        """
        if "ucc_smartx_selenium_helper" in request.fixturenames:
>           request.node.selenium_helper = request.getfixturevalue(
                "ucc_smartx_selenium_helper"
            )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:254: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_count>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
                selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )
                break
            except Exception as e:
                last_exc = e
                LOGGER.warn(
                    "Failed to configure the browser or login to Splunk instance for - Try={} \nTRACEBACK::{}".format(
                        try_number, traceback.format_exc()
                    )
                )
        else:
            LOGGER.error(
                "Could not connect to Browser or login to Splunk instance. Please check the logs for detailed error of each retry"
            )
>           raise (last_exc)

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:198: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_count>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
>               selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab15baf80>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_count'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )
    
            # selenium local stack
            elif browser == "chrome_grid":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://chrome-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_grid":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://firefox-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
            # kubernetes selenium
            elif browser == "chrome_k8s":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_k8s":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
    
            elif browser == "edge":
                if debug:
                    self.browser = Edge(
                        executable_path="msedgedriver",
                        desired_capabilities=self.get_local_edge_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    command_executor = EdgeRemoteConnection(
                        "https://ondemand.saucelabs.com:443/wd/hub"
                    )
                    options = EdgeOptions()
                    options.use_chromium = True
                    self.browser = webdriver.Remote(
                        command_executor=command_executor,
                        options=options,
                        desired_capabilities=self.get_sauce_edge_opts(browser_version),
                    )
    
            elif browser == "IE":
                if debug:
                    self.browser = webdriver.Ie(capabilities=self.get_local_ie_opts())
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_ie_opts(browser_version),
                    )
            elif browser == "safari":
                if debug:
                    self.browser = webdriver.Safari()
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_safari_opts(
                            browser_version
                        ),
                    )
            else:
                raise Exception(
                    "No valid browser found.! expected=[firefox, chrome, safari], got={}".format(
                        browser
                    )
                )
        except Exception as e:
>           raise e

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:203: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab15baf80>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_count'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
>                   self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
command_executor = 'https://ondemand.saucelabs.com:443/wd/hub'
desired_capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None, proxy = None, keep_alive = False, file_detector = None
options = None

    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
                 desired_capabilities=None, browser_profile=None, proxy=None,
                 keep_alive=False, file_detector=None, options=None):
        """
        Create a new driver that will issue commands using the wire protocol.
    
        :Args:
         - command_executor - Either a string representing URL of the remote server or a custom
             remote_connection.RemoteConnection object. Defaults to 'http://127.0.0.1:4444/wd/hub'.
         - desired_capabilities - A dictionary of capabilities to request when
             starting the browser session. Required parameter.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object.
             Only used if Firefox is requested. Optional.
         - proxy - A selenium.webdriver.common.proxy.Proxy object. The browser session will
             be started with given proxy settings, if possible. Optional.
         - keep_alive - Whether to configure remote_connection.RemoteConnection to use
             HTTP keep-alive. Defaults to False.
         - file_detector - Pass custom file detector object during instantiation. If None,
             then default LocalFileDetector() will be used.
         - options - instance of a driver options.Options class
        """
        capabilities = {}
        if options is not None:
            capabilities = options.to_capabilities()
        if desired_capabilities is not None:
            if not isinstance(desired_capabilities, dict):
                raise WebDriverException("Desired Capabilities must be a dictionary")
            else:
                capabilities.update(desired_capabilities)
        if proxy is not None:
            warnings.warn("Please use FirefoxOptions to set proxy",
                          DeprecationWarning, stacklevel=2)
            proxy.add_to_capabilities(capabilities)
        self.command_executor = command_executor
        if type(self.command_executor) is bytes or isinstance(self.command_executor, str):
            self.command_executor = RemoteConnection(command_executor, keep_alive=keep_alive)
        self._is_remote = True
        self.session_id = None
        self.capabilities = {}
        self.error_handler = ErrorHandler()
        self.start_client()
        if browser_profile is not None:
            warnings.warn("Please use FirefoxOptions to set browser profile",
                          DeprecationWarning, stacklevel=2)
>       self.start_session(capabilities, browser_profile)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None

    def start_session(self, capabilities, browser_profile=None):
        """
        Creates a new session with the desired capabilities.
    
        :Args:
         - browser_name - The name of the browser to request.
         - version - Which browser version to request.
         - platform - Which platform to request the browser on.
         - javascript_enabled - Whether the new session should support JavaScript.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object. Only used if Firefox is requested.
        """
        if not isinstance(capabilities, dict):
            raise InvalidArgumentException("Capabilities must be a dictionary")
        if browser_profile:
            if "moz:firefoxOptions" in capabilities:
                capabilities["moz:firefoxOptions"]["profile"] = browser_profile.encoded
            else:
                capabilities.update({'firefox_profile': browser_profile.encoded})
        w3c_caps = _make_w3c_caps(capabilities)
        parameters = {"capabilities": w3c_caps,
                      "desiredCapabilities": capabilities}
>       response = self.execute(Command.NEW_SESSION, parameters)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
driver_command = 'newSession'
params = {'capabilities': {'alwaysMatch': {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ...ns': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}}

    def execute(self, driver_command, params=None):
        """
        Sends a command to be executed by a command.CommandExecutor.
    
        :Args:
         - driver_command: The name of the command to execute as a string.
         - params: A dictionary of named parameters to send with the command.
    
        :Returns:
          The command's JSON response loaded into a dictionary object.
        """
        if self.session_id is not None:
            if not params:
                params = {'sessionId': self.session_id}
            elif 'sessionId' not in params:
                params['sessionId'] = self.session_id
    
        params = self._wrap_value(params)
        response = self.command_executor.execute(driver_command, params)
        if response:
>           self.error_handler.check_response(response)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:321: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f6ab15b8a60>
response = {'status': 500, 'value': '{"status": 13, "sessionId": "39336190b3e14f35b6016f8ff78dd3e5", "value": {"message": "Sauce ...r more information on what happened, please visit https://app.saucelabs.com/tests/39336190b3e14f35b6016f8ff78dd3e5"}}'}

    def check_response(self, response):
        """
        Checks that a JSON response from the WebDriver does not have an error.
    
        :Args:
         - response - The JSON response from the WebDriver server as a dictionary
           object.
    
        :Raises: If the response contains an error message.
        """
        status = response.get('status', None)
        if status is None or status == ErrorCode.SUCCESS:
            return
        value = None
        message = response.get("message", "")
        screen = response.get("screen", "")
        stacktrace = None
        if isinstance(status, int):
            value_json = response.get('value', None)
            if value_json and isinstance(value_json, basestring):
                import json
                try:
                    value = json.loads(value_json)
                    if len(value.keys()) == 1:
                        value = value['value']
                    status = value.get('error', None)
                    if status is None:
                        status = value["status"]
                        message = value["value"]
                        if not isinstance(message, basestring):
                            value = message
                            message = message.get('message')
                    else:
                        message = value.get('message', None)
                except ValueError:
                    pass
    
        exception_class = ErrorInResponseException
        if status in ErrorCode.NO_SUCH_ELEMENT:
            exception_class = NoSuchElementException
        elif status in ErrorCode.NO_SUCH_FRAME:
            exception_class = NoSuchFrameException
        elif status in ErrorCode.NO_SUCH_WINDOW:
            exception_class = NoSuchWindowException
        elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
            exception_class = StaleElementReferenceException
        elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
            exception_class = ElementNotVisibleException
        elif status in ErrorCode.INVALID_ELEMENT_STATE:
            exception_class = InvalidElementStateException
        elif status in ErrorCode.INVALID_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
            exception_class = InvalidSelectorException
        elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
            exception_class = ElementNotSelectableException
        elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
            exception_class = ElementNotInteractableException
        elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
            exception_class = InvalidCookieDomainException
        elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
            exception_class = UnableToSetCookieException
        elif status in ErrorCode.TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.SCRIPT_TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.UNKNOWN_ERROR:
            exception_class = WebDriverException
        elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
            exception_class = UnexpectedAlertPresentException
        elif status in ErrorCode.NO_ALERT_OPEN:
            exception_class = NoAlertPresentException
        elif status in ErrorCode.IME_NOT_AVAILABLE:
            exception_class = ImeNotAvailableException
        elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
            exception_class = ImeActivationFailedException
        elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
            exception_class = MoveTargetOutOfBoundsException
        elif status in ErrorCode.JAVASCRIPT_ERROR:
            exception_class = JavascriptException
        elif status in ErrorCode.SESSION_NOT_CREATED:
            exception_class = SessionNotCreatedException
        elif status in ErrorCode.INVALID_ARGUMENT:
            exception_class = InvalidArgumentException
        elif status in ErrorCode.NO_SUCH_COOKIE:
            exception_class = NoSuchCookieException
        elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
            exception_class = ScreenshotException
        elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
            exception_class = ElementClickInterceptedException
        elif status in ErrorCode.INSECURE_CERTIFICATE:
            exception_class = InsecureCertificateException
        elif status in ErrorCode.INVALID_COORDINATES:
            exception_class = InvalidCoordinatesException
        elif status in ErrorCode.INVALID_SESSION_ID:
            exception_class = InvalidSessionIdException
        elif status in ErrorCode.UNKNOWN_METHOD:
            exception_class = UnknownMethodException
        else:
            exception_class = WebDriverException
        if value == '' or value is None:
            value = response['value']
        if isinstance(value, basestring):
            if exception_class == ErrorInResponseException:
                raise exception_class(response, value)
            raise exception_class(value)
        if message == "" and 'message' in value:
            message = value['message']
    
        screen = None
        if 'screen' in value:
            screen = value['screen']
    
        stacktrace = None
        if 'stackTrace' in value and value['stackTrace']:
            stacktrace = []
            try:
                for frame in value['stackTrace']:
                    line = self._value_or_default(frame, 'lineNumber', '')
                    file = self._value_or_default(frame, 'fileName', '<anonymous>')
                    if line:
                        file = "%s:%s" % (file, line)
                    meth = self._value_or_default(frame, 'methodName', '<anonymous>')
                    if 'className' in frame:
                        meth = "%s.%s" % (frame['className'], meth)
                    msg = "    at %s (%s)"
                    msg = msg % (meth, file)
                    stacktrace.append(msg)
            except TypeError:
                pass
        if exception_class == ErrorInResponseException:
            raise exception_class(response, message)
        elif exception_class == UnexpectedAlertPresentException:
            alert_text = None
            if 'data' in value:
                alert_text = value['data'].get('text')
            elif 'alert' in value:
                alert_text = value['alert'].get('text')
            raise exception_class(message, screen, stacktrace, alert_text)
>       raise exception_class(message, screen, stacktrace)
E       selenium.common.exceptions.WebDriverException: Message: Sauce could not start your job. For more information on what happened, please visit https://app.saucelabs.com/tests/39336190b3e14f35b6016f8ff78dd3e5

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py:242: WebDriverException

Check failure on line 0 in test-results/test.xml

See this annotation in the file changed.

@github-actions github-actions / test-report-Object__chrome_test_splunk_ta_example_addon_account

pytest ► tests.ui.test_splunk_ta_example_addon_account.chrome_TestAccount ► test_accounts_filter_functionality_negative

Failed test found in:
  test-results/test.xml
Error:
  request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_accounts_filter_functionality_negative>>
Raw output
request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_accounts_filter_functionality_negative>>

    @pytest.fixture(scope="function", autouse=True)
    def ucc_smartx_selenium_wrapper(request):
        """
        Calls ucc_smartx_selenium_helper fixture
        """
        if "ucc_smartx_selenium_helper" in request.fixturenames:
>           request.node.selenium_helper = request.getfixturevalue(
                "ucc_smartx_selenium_helper"
            )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:254: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_accounts_filter_functionality_negative>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
                selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )
                break
            except Exception as e:
                last_exc = e
                LOGGER.warn(
                    "Failed to configure the browser or login to Splunk instance for - Try={} \nTRACEBACK::{}".format(
                        try_number, traceback.format_exc()
                    )
                )
        else:
            LOGGER.error(
                "Could not connect to Browser or login to Splunk instance. Please check the logs for detailed error of each retry"
            )
>           raise (last_exc)

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:198: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_accounts_filter_functionality_negative>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
>               selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab1508d90>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_accounts_filter_functionality_negative'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )
    
            # selenium local stack
            elif browser == "chrome_grid":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://chrome-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_grid":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://firefox-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
            # kubernetes selenium
            elif browser == "chrome_k8s":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_k8s":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
    
            elif browser == "edge":
                if debug:
                    self.browser = Edge(
                        executable_path="msedgedriver",
                        desired_capabilities=self.get_local_edge_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    command_executor = EdgeRemoteConnection(
                        "https://ondemand.saucelabs.com:443/wd/hub"
                    )
                    options = EdgeOptions()
                    options.use_chromium = True
                    self.browser = webdriver.Remote(
                        command_executor=command_executor,
                        options=options,
                        desired_capabilities=self.get_sauce_edge_opts(browser_version),
                    )
    
            elif browser == "IE":
                if debug:
                    self.browser = webdriver.Ie(capabilities=self.get_local_ie_opts())
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_ie_opts(browser_version),
                    )
            elif browser == "safari":
                if debug:
                    self.browser = webdriver.Safari()
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_safari_opts(
                            browser_version
                        ),
                    )
            else:
                raise Exception(
                    "No valid browser found.! expected=[firefox, chrome, safari], got={}".format(
                        browser
                    )
                )
        except Exception as e:
>           raise e

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:203: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab1508d90>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_accounts_filter_functionality_negative'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
>                   self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
command_executor = 'https://ondemand.saucelabs.com:443/wd/hub'
desired_capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None, proxy = None, keep_alive = False, file_detector = None
options = None

    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
                 desired_capabilities=None, browser_profile=None, proxy=None,
                 keep_alive=False, file_detector=None, options=None):
        """
        Create a new driver that will issue commands using the wire protocol.
    
        :Args:
         - command_executor - Either a string representing URL of the remote server or a custom
             remote_connection.RemoteConnection object. Defaults to 'http://127.0.0.1:4444/wd/hub'.
         - desired_capabilities - A dictionary of capabilities to request when
             starting the browser session. Required parameter.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object.
             Only used if Firefox is requested. Optional.
         - proxy - A selenium.webdriver.common.proxy.Proxy object. The browser session will
             be started with given proxy settings, if possible. Optional.
         - keep_alive - Whether to configure remote_connection.RemoteConnection to use
             HTTP keep-alive. Defaults to False.
         - file_detector - Pass custom file detector object during instantiation. If None,
             then default LocalFileDetector() will be used.
         - options - instance of a driver options.Options class
        """
        capabilities = {}
        if options is not None:
            capabilities = options.to_capabilities()
        if desired_capabilities is not None:
            if not isinstance(desired_capabilities, dict):
                raise WebDriverException("Desired Capabilities must be a dictionary")
            else:
                capabilities.update(desired_capabilities)
        if proxy is not None:
            warnings.warn("Please use FirefoxOptions to set proxy",
                          DeprecationWarning, stacklevel=2)
            proxy.add_to_capabilities(capabilities)
        self.command_executor = command_executor
        if type(self.command_executor) is bytes or isinstance(self.command_executor, str):
            self.command_executor = RemoteConnection(command_executor, keep_alive=keep_alive)
        self._is_remote = True
        self.session_id = None
        self.capabilities = {}
        self.error_handler = ErrorHandler()
        self.start_client()
        if browser_profile is not None:
            warnings.warn("Please use FirefoxOptions to set browser profile",
                          DeprecationWarning, stacklevel=2)
>       self.start_session(capabilities, browser_profile)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None

    def start_session(self, capabilities, browser_profile=None):
        """
        Creates a new session with the desired capabilities.
    
        :Args:
         - browser_name - The name of the browser to request.
         - version - Which browser version to request.
         - platform - Which platform to request the browser on.
         - javascript_enabled - Whether the new session should support JavaScript.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object. Only used if Firefox is requested.
        """
        if not isinstance(capabilities, dict):
            raise InvalidArgumentException("Capabilities must be a dictionary")
        if browser_profile:
            if "moz:firefoxOptions" in capabilities:
                capabilities["moz:firefoxOptions"]["profile"] = browser_profile.encoded
            else:
                capabilities.update({'firefox_profile': browser_profile.encoded})
        w3c_caps = _make_w3c_caps(capabilities)
        parameters = {"capabilities": w3c_caps,
                      "desiredCapabilities": capabilities}
>       response = self.execute(Command.NEW_SESSION, parameters)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
driver_command = 'newSession'
params = {'capabilities': {'alwaysMatch': {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ...ns': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}}

    def execute(self, driver_command, params=None):
        """
        Sends a command to be executed by a command.CommandExecutor.
    
        :Args:
         - driver_command: The name of the command to execute as a string.
         - params: A dictionary of named parameters to send with the command.
    
        :Returns:
          The command's JSON response loaded into a dictionary object.
        """
        if self.session_id is not None:
            if not params:
                params = {'sessionId': self.session_id}
            elif 'sessionId' not in params:
                params['sessionId'] = self.session_id
    
        params = self._wrap_value(params)
        response = self.command_executor.execute(driver_command, params)
        if response:
>           self.error_handler.check_response(response)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:321: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f6ab15090c0>
response = {'status': 500, 'value': '{"status": 13, "sessionId": "6beff2b8a263440b89132d93a5d33ccb", "value": {"message": "Sauce ...r more information on what happened, please visit https://app.saucelabs.com/tests/6beff2b8a263440b89132d93a5d33ccb"}}'}

    def check_response(self, response):
        """
        Checks that a JSON response from the WebDriver does not have an error.
    
        :Args:
         - response - The JSON response from the WebDriver server as a dictionary
           object.
    
        :Raises: If the response contains an error message.
        """
        status = response.get('status', None)
        if status is None or status == ErrorCode.SUCCESS:
            return
        value = None
        message = response.get("message", "")
        screen = response.get("screen", "")
        stacktrace = None
        if isinstance(status, int):
            value_json = response.get('value', None)
            if value_json and isinstance(value_json, basestring):
                import json
                try:
                    value = json.loads(value_json)
                    if len(value.keys()) == 1:
                        value = value['value']
                    status = value.get('error', None)
                    if status is None:
                        status = value["status"]
                        message = value["value"]
                        if not isinstance(message, basestring):
                            value = message
                            message = message.get('message')
                    else:
                        message = value.get('message', None)
                except ValueError:
                    pass
    
        exception_class = ErrorInResponseException
        if status in ErrorCode.NO_SUCH_ELEMENT:
            exception_class = NoSuchElementException
        elif status in ErrorCode.NO_SUCH_FRAME:
            exception_class = NoSuchFrameException
        elif status in ErrorCode.NO_SUCH_WINDOW:
            exception_class = NoSuchWindowException
        elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
            exception_class = StaleElementReferenceException
        elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
            exception_class = ElementNotVisibleException
        elif status in ErrorCode.INVALID_ELEMENT_STATE:
            exception_class = InvalidElementStateException
        elif status in ErrorCode.INVALID_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
            exception_class = InvalidSelectorException
        elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
            exception_class = ElementNotSelectableException
        elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
            exception_class = ElementNotInteractableException
        elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
            exception_class = InvalidCookieDomainException
        elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
            exception_class = UnableToSetCookieException
        elif status in ErrorCode.TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.SCRIPT_TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.UNKNOWN_ERROR:
            exception_class = WebDriverException
        elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
            exception_class = UnexpectedAlertPresentException
        elif status in ErrorCode.NO_ALERT_OPEN:
            exception_class = NoAlertPresentException
        elif status in ErrorCode.IME_NOT_AVAILABLE:
            exception_class = ImeNotAvailableException
        elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
            exception_class = ImeActivationFailedException
        elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
            exception_class = MoveTargetOutOfBoundsException
        elif status in ErrorCode.JAVASCRIPT_ERROR:
            exception_class = JavascriptException
        elif status in ErrorCode.SESSION_NOT_CREATED:
            exception_class = SessionNotCreatedException
        elif status in ErrorCode.INVALID_ARGUMENT:
            exception_class = InvalidArgumentException
        elif status in ErrorCode.NO_SUCH_COOKIE:
            exception_class = NoSuchCookieException
        elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
            exception_class = ScreenshotException
        elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
            exception_class = ElementClickInterceptedException
        elif status in ErrorCode.INSECURE_CERTIFICATE:
            exception_class = InsecureCertificateException
        elif status in ErrorCode.INVALID_COORDINATES:
            exception_class = InvalidCoordinatesException
        elif status in ErrorCode.INVALID_SESSION_ID:
            exception_class = InvalidSessionIdException
        elif status in ErrorCode.UNKNOWN_METHOD:
            exception_class = UnknownMethodException
        else:
            exception_class = WebDriverException
        if value == '' or value is None:
            value = response['value']
        if isinstance(value, basestring):
            if exception_class == ErrorInResponseException:
                raise exception_class(response, value)
            raise exception_class(value)
        if message == "" and 'message' in value:
            message = value['message']
    
        screen = None
        if 'screen' in value:
            screen = value['screen']
    
        stacktrace = None
        if 'stackTrace' in value and value['stackTrace']:
            stacktrace = []
            try:
                for frame in value['stackTrace']:
                    line = self._value_or_default(frame, 'lineNumber', '')
                    file = self._value_or_default(frame, 'fileName', '<anonymous>')
                    if line:
                        file = "%s:%s" % (file, line)
                    meth = self._value_or_default(frame, 'methodName', '<anonymous>')
                    if 'className' in frame:
                        meth = "%s.%s" % (frame['className'], meth)
                    msg = "    at %s (%s)"
                    msg = msg % (meth, file)
                    stacktrace.append(msg)
            except TypeError:
                pass
        if exception_class == ErrorInResponseException:
            raise exception_class(response, message)
        elif exception_class == UnexpectedAlertPresentException:
            alert_text = None
            if 'data' in value:
                alert_text = value['data'].get('text')
            elif 'alert' in value:
                alert_text = value['alert'].get('text')
            raise exception_class(message, screen, stacktrace, alert_text)
>       raise exception_class(message, screen, stacktrace)
E       selenium.common.exceptions.WebDriverException: Message: Sauce could not start your job. For more information on what happened, please visit https://app.saucelabs.com/tests/6beff2b8a263440b89132d93a5d33ccb

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py:242: WebDriverException

Check failure on line 0 in test-results/test.xml

See this annotation in the file changed.

@github-actions github-actions / test-report-Object__chrome_test_splunk_ta_example_addon_account

pytest ► tests.ui.test_splunk_ta_example_addon_account.chrome_TestAccount ► test_accounts_filter_functionality_positive

Failed test found in:
  test-results/test.xml
Error:
  request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_accounts_filter_functionality_positive>>
Raw output
request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_accounts_filter_functionality_positive>>

    @pytest.fixture(scope="function", autouse=True)
    def ucc_smartx_selenium_wrapper(request):
        """
        Calls ucc_smartx_selenium_helper fixture
        """
        if "ucc_smartx_selenium_helper" in request.fixturenames:
>           request.node.selenium_helper = request.getfixturevalue(
                "ucc_smartx_selenium_helper"
            )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:254: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_accounts_filter_functionality_positive>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
                selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )
                break
            except Exception as e:
                last_exc = e
                LOGGER.warn(
                    "Failed to configure the browser or login to Splunk instance for - Try={} \nTRACEBACK::{}".format(
                        try_number, traceback.format_exc()
                    )
                )
        else:
            LOGGER.error(
                "Could not connect to Browser or login to Splunk instance. Please check the logs for detailed error of each retry"
            )
>           raise (last_exc)

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:198: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_accounts_filter_functionality_positive>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
>               selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab1426bc0>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_accounts_filter_functionality_positive'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )
    
            # selenium local stack
            elif browser == "chrome_grid":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://chrome-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_grid":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://firefox-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
            # kubernetes selenium
            elif browser == "chrome_k8s":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_k8s":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
    
            elif browser == "edge":
                if debug:
                    self.browser = Edge(
                        executable_path="msedgedriver",
                        desired_capabilities=self.get_local_edge_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    command_executor = EdgeRemoteConnection(
                        "https://ondemand.saucelabs.com:443/wd/hub"
                    )
                    options = EdgeOptions()
                    options.use_chromium = True
                    self.browser = webdriver.Remote(
                        command_executor=command_executor,
                        options=options,
                        desired_capabilities=self.get_sauce_edge_opts(browser_version),
                    )
    
            elif browser == "IE":
                if debug:
                    self.browser = webdriver.Ie(capabilities=self.get_local_ie_opts())
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_ie_opts(browser_version),
                    )
            elif browser == "safari":
                if debug:
                    self.browser = webdriver.Safari()
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_safari_opts(
                            browser_version
                        ),
                    )
            else:
                raise Exception(
                    "No valid browser found.! expected=[firefox, chrome, safari], got={}".format(
                        browser
                    )
                )
        except Exception as e:
>           raise e

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:203: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab1426bc0>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_accounts_filter_functionality_positive'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
>                   self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
command_executor = 'https://ondemand.saucelabs.com:443/wd/hub'
desired_capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None, proxy = None, keep_alive = False, file_detector = None
options = None

    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
                 desired_capabilities=None, browser_profile=None, proxy=None,
                 keep_alive=False, file_detector=None, options=None):
        """
        Create a new driver that will issue commands using the wire protocol.
    
        :Args:
         - command_executor - Either a string representing URL of the remote server or a custom
             remote_connection.RemoteConnection object. Defaults to 'http://127.0.0.1:4444/wd/hub'.
         - desired_capabilities - A dictionary of capabilities to request when
             starting the browser session. Required parameter.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object.
             Only used if Firefox is requested. Optional.
         - proxy - A selenium.webdriver.common.proxy.Proxy object. The browser session will
             be started with given proxy settings, if possible. Optional.
         - keep_alive - Whether to configure remote_connection.RemoteConnection to use
             HTTP keep-alive. Defaults to False.
         - file_detector - Pass custom file detector object during instantiation. If None,
             then default LocalFileDetector() will be used.
         - options - instance of a driver options.Options class
        """
        capabilities = {}
        if options is not None:
            capabilities = options.to_capabilities()
        if desired_capabilities is not None:
            if not isinstance(desired_capabilities, dict):
                raise WebDriverException("Desired Capabilities must be a dictionary")
            else:
                capabilities.update(desired_capabilities)
        if proxy is not None:
            warnings.warn("Please use FirefoxOptions to set proxy",
                          DeprecationWarning, stacklevel=2)
            proxy.add_to_capabilities(capabilities)
        self.command_executor = command_executor
        if type(self.command_executor) is bytes or isinstance(self.command_executor, str):
            self.command_executor = RemoteConnection(command_executor, keep_alive=keep_alive)
        self._is_remote = True
        self.session_id = None
        self.capabilities = {}
        self.error_handler = ErrorHandler()
        self.start_client()
        if browser_profile is not None:
            warnings.warn("Please use FirefoxOptions to set browser profile",
                          DeprecationWarning, stacklevel=2)
>       self.start_session(capabilities, browser_profile)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None

    def start_session(self, capabilities, browser_profile=None):
        """
        Creates a new session with the desired capabilities.
    
        :Args:
         - browser_name - The name of the browser to request.
         - version - Which browser version to request.
         - platform - Which platform to request the browser on.
         - javascript_enabled - Whether the new session should support JavaScript.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object. Only used if Firefox is requested.
        """
        if not isinstance(capabilities, dict):
            raise InvalidArgumentException("Capabilities must be a dictionary")
        if browser_profile:
            if "moz:firefoxOptions" in capabilities:
                capabilities["moz:firefoxOptions"]["profile"] = browser_profile.encoded
            else:
                capabilities.update({'firefox_profile': browser_profile.encoded})
        w3c_caps = _make_w3c_caps(capabilities)
        parameters = {"capabilities": w3c_caps,
                      "desiredCapabilities": capabilities}
>       response = self.execute(Command.NEW_SESSION, parameters)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
driver_command = 'newSession'
params = {'capabilities': {'alwaysMatch': {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ...ns': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}}

    def execute(self, driver_command, params=None):
        """
        Sends a command to be executed by a command.CommandExecutor.
    
        :Args:
         - driver_command: The name of the command to execute as a string.
         - params: A dictionary of named parameters to send with the command.
    
        :Returns:
          The command's JSON response loaded into a dictionary object.
        """
        if self.session_id is not None:
            if not params:
                params = {'sessionId': self.session_id}
            elif 'sessionId' not in params:
                params['sessionId'] = self.session_id
    
        params = self._wrap_value(params)
        response = self.command_executor.execute(driver_command, params)
        if response:
>           self.error_handler.check_response(response)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:321: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f6ab14246d0>
response = {'status': 500, 'value': '{"status": 13, "sessionId": "d2926cc244184d149537caa8c2dc7f25", "value": {"message": "Sauce ...r more information on what happened, please visit https://app.saucelabs.com/tests/d2926cc244184d149537caa8c2dc7f25"}}'}

    def check_response(self, response):
        """
        Checks that a JSON response from the WebDriver does not have an error.
    
        :Args:
         - response - The JSON response from the WebDriver server as a dictionary
           object.
    
        :Raises: If the response contains an error message.
        """
        status = response.get('status', None)
        if status is None or status == ErrorCode.SUCCESS:
            return
        value = None
        message = response.get("message", "")
        screen = response.get("screen", "")
        stacktrace = None
        if isinstance(status, int):
            value_json = response.get('value', None)
            if value_json and isinstance(value_json, basestring):
                import json
                try:
                    value = json.loads(value_json)
                    if len(value.keys()) == 1:
                        value = value['value']
                    status = value.get('error', None)
                    if status is None:
                        status = value["status"]
                        message = value["value"]
                        if not isinstance(message, basestring):
                            value = message
                            message = message.get('message')
                    else:
                        message = value.get('message', None)
                except ValueError:
                    pass
    
        exception_class = ErrorInResponseException
        if status in ErrorCode.NO_SUCH_ELEMENT:
            exception_class = NoSuchElementException
        elif status in ErrorCode.NO_SUCH_FRAME:
            exception_class = NoSuchFrameException
        elif status in ErrorCode.NO_SUCH_WINDOW:
            exception_class = NoSuchWindowException
        elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
            exception_class = StaleElementReferenceException
        elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
            exception_class = ElementNotVisibleException
        elif status in ErrorCode.INVALID_ELEMENT_STATE:
            exception_class = InvalidElementStateException
        elif status in ErrorCode.INVALID_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
            exception_class = InvalidSelectorException
        elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
            exception_class = ElementNotSelectableException
        elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
            exception_class = ElementNotInteractableException
        elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
            exception_class = InvalidCookieDomainException
        elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
            exception_class = UnableToSetCookieException
        elif status in ErrorCode.TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.SCRIPT_TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.UNKNOWN_ERROR:
            exception_class = WebDriverException
        elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
            exception_class = UnexpectedAlertPresentException
        elif status in ErrorCode.NO_ALERT_OPEN:
            exception_class = NoAlertPresentException
        elif status in ErrorCode.IME_NOT_AVAILABLE:
            exception_class = ImeNotAvailableException
        elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
            exception_class = ImeActivationFailedException
        elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
            exception_class = MoveTargetOutOfBoundsException
        elif status in ErrorCode.JAVASCRIPT_ERROR:
            exception_class = JavascriptException
        elif status in ErrorCode.SESSION_NOT_CREATED:
            exception_class = SessionNotCreatedException
        elif status in ErrorCode.INVALID_ARGUMENT:
            exception_class = InvalidArgumentException
        elif status in ErrorCode.NO_SUCH_COOKIE:
            exception_class = NoSuchCookieException
        elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
            exception_class = ScreenshotException
        elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
            exception_class = ElementClickInterceptedException
        elif status in ErrorCode.INSECURE_CERTIFICATE:
            exception_class = InsecureCertificateException
        elif status in ErrorCode.INVALID_COORDINATES:
            exception_class = InvalidCoordinatesException
        elif status in ErrorCode.INVALID_SESSION_ID:
            exception_class = InvalidSessionIdException
        elif status in ErrorCode.UNKNOWN_METHOD:
            exception_class = UnknownMethodException
        else:
            exception_class = WebDriverException
        if value == '' or value is None:
            value = response['value']
        if isinstance(value, basestring):
            if exception_class == ErrorInResponseException:
                raise exception_class(response, value)
            raise exception_class(value)
        if message == "" and 'message' in value:
            message = value['message']
    
        screen = None
        if 'screen' in value:
            screen = value['screen']
    
        stacktrace = None
        if 'stackTrace' in value and value['stackTrace']:
            stacktrace = []
            try:
                for frame in value['stackTrace']:
                    line = self._value_or_default(frame, 'lineNumber', '')
                    file = self._value_or_default(frame, 'fileName', '<anonymous>')
                    if line:
                        file = "%s:%s" % (file, line)
                    meth = self._value_or_default(frame, 'methodName', '<anonymous>')
                    if 'className' in frame:
                        meth = "%s.%s" % (frame['className'], meth)
                    msg = "    at %s (%s)"
                    msg = msg % (meth, file)
                    stacktrace.append(msg)
            except TypeError:
                pass
        if exception_class == ErrorInResponseException:
            raise exception_class(response, message)
        elif exception_class == UnexpectedAlertPresentException:
            alert_text = None
            if 'data' in value:
                alert_text = value['data'].get('text')
            elif 'alert' in value:
                alert_text = value['alert'].get('text')
            raise exception_class(message, screen, stacktrace, alert_text)
>       raise exception_class(message, screen, stacktrace)
E       selenium.common.exceptions.WebDriverException: Message: Sauce could not start your job. For more information on what happened, please visit https://app.saucelabs.com/tests/d2926cc244184d149537caa8c2dc7f25

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py:242: WebDriverException

Check failure on line 0 in test-results/test.xml

See this annotation in the file changed.

@github-actions github-actions / test-report-Object__chrome_test_splunk_ta_example_addon_account

pytest ► tests.ui.test_splunk_ta_example_addon_account.chrome_TestAccount ► test_account_pagination

Failed test found in:
  test-results/test.xml
Error:
  request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_pagination>>
Raw output
request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_pagination>>

    @pytest.fixture(scope="function", autouse=True)
    def ucc_smartx_selenium_wrapper(request):
        """
        Calls ucc_smartx_selenium_helper fixture
        """
        if "ucc_smartx_selenium_helper" in request.fixturenames:
>           request.node.selenium_helper = request.getfixturevalue(
                "ucc_smartx_selenium_helper"
            )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:254: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_pagination>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
                selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )
                break
            except Exception as e:
                last_exc = e
                LOGGER.warn(
                    "Failed to configure the browser or login to Splunk instance for - Try={} \nTRACEBACK::{}".format(
                        try_number, traceback.format_exc()
                    )
                )
        else:
            LOGGER.error(
                "Could not connect to Browser or login to Splunk instance. Please check the logs for detailed error of each retry"
            )
>           raise (last_exc)

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:198: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_pagination>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
>               selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab1427730>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_pagination'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )
    
            # selenium local stack
            elif browser == "chrome_grid":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://chrome-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_grid":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://firefox-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
            # kubernetes selenium
            elif browser == "chrome_k8s":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_k8s":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
    
            elif browser == "edge":
                if debug:
                    self.browser = Edge(
                        executable_path="msedgedriver",
                        desired_capabilities=self.get_local_edge_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    command_executor = EdgeRemoteConnection(
                        "https://ondemand.saucelabs.com:443/wd/hub"
                    )
                    options = EdgeOptions()
                    options.use_chromium = True
                    self.browser = webdriver.Remote(
                        command_executor=command_executor,
                        options=options,
                        desired_capabilities=self.get_sauce_edge_opts(browser_version),
                    )
    
            elif browser == "IE":
                if debug:
                    self.browser = webdriver.Ie(capabilities=self.get_local_ie_opts())
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_ie_opts(browser_version),
                    )
            elif browser == "safari":
                if debug:
                    self.browser = webdriver.Safari()
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_safari_opts(
                            browser_version
                        ),
                    )
            else:
                raise Exception(
                    "No valid browser found.! expected=[firefox, chrome, safari], got={}".format(
                        browser
                    )
                )
        except Exception as e:
>           raise e

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:203: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab1427730>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_pagination'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
>                   self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
command_executor = 'https://ondemand.saucelabs.com:443/wd/hub'
desired_capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None, proxy = None, keep_alive = False, file_detector = None
options = None

    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
                 desired_capabilities=None, browser_profile=None, proxy=None,
                 keep_alive=False, file_detector=None, options=None):
        """
        Create a new driver that will issue commands using the wire protocol.
    
        :Args:
         - command_executor - Either a string representing URL of the remote server or a custom
             remote_connection.RemoteConnection object. Defaults to 'http://127.0.0.1:4444/wd/hub'.
         - desired_capabilities - A dictionary of capabilities to request when
             starting the browser session. Required parameter.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object.
             Only used if Firefox is requested. Optional.
         - proxy - A selenium.webdriver.common.proxy.Proxy object. The browser session will
             be started with given proxy settings, if possible. Optional.
         - keep_alive - Whether to configure remote_connection.RemoteConnection to use
             HTTP keep-alive. Defaults to False.
         - file_detector - Pass custom file detector object during instantiation. If None,
             then default LocalFileDetector() will be used.
         - options - instance of a driver options.Options class
        """
        capabilities = {}
        if options is not None:
            capabilities = options.to_capabilities()
        if desired_capabilities is not None:
            if not isinstance(desired_capabilities, dict):
                raise WebDriverException("Desired Capabilities must be a dictionary")
            else:
                capabilities.update(desired_capabilities)
        if proxy is not None:
            warnings.warn("Please use FirefoxOptions to set proxy",
                          DeprecationWarning, stacklevel=2)
            proxy.add_to_capabilities(capabilities)
        self.command_executor = command_executor
        if type(self.command_executor) is bytes or isinstance(self.command_executor, str):
            self.command_executor = RemoteConnection(command_executor, keep_alive=keep_alive)
        self._is_remote = True
        self.session_id = None
        self.capabilities = {}
        self.error_handler = ErrorHandler()
        self.start_client()
        if browser_profile is not None:
            warnings.warn("Please use FirefoxOptions to set browser profile",
                          DeprecationWarning, stacklevel=2)
>       self.start_session(capabilities, browser_profile)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None

    def start_session(self, capabilities, browser_profile=None):
        """
        Creates a new session with the desired capabilities.
    
        :Args:
         - browser_name - The name of the browser to request.
         - version - Which browser version to request.
         - platform - Which platform to request the browser on.
         - javascript_enabled - Whether the new session should support JavaScript.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object. Only used if Firefox is requested.
        """
        if not isinstance(capabilities, dict):
            raise InvalidArgumentException("Capabilities must be a dictionary")
        if browser_profile:
            if "moz:firefoxOptions" in capabilities:
                capabilities["moz:firefoxOptions"]["profile"] = browser_profile.encoded
            else:
                capabilities.update({'firefox_profile': browser_profile.encoded})
        w3c_caps = _make_w3c_caps(capabilities)
        parameters = {"capabilities": w3c_caps,
                      "desiredCapabilities": capabilities}
>       response = self.execute(Command.NEW_SESSION, parameters)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
driver_command = 'newSession'
params = {'capabilities': {'alwaysMatch': {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ...ns': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}}

    def execute(self, driver_command, params=None):
        """
        Sends a command to be executed by a command.CommandExecutor.
    
        :Args:
         - driver_command: The name of the command to execute as a string.
         - params: A dictionary of named parameters to send with the command.
    
        :Returns:
          The command's JSON response loaded into a dictionary object.
        """
        if self.session_id is not None:
            if not params:
                params = {'sessionId': self.session_id}
            elif 'sessionId' not in params:
                params['sessionId'] = self.session_id
    
        params = self._wrap_value(params)
        response = self.command_executor.execute(driver_command, params)
        if response:
>           self.error_handler.check_response(response)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:321: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f6ab1427b50>
response = {'status': 500, 'value': '{"status": 13, "sessionId": "e049ddc22926453ab333dd6388b8c4e3", "value": {"message": "Sauce ...r more information on what happened, please visit https://app.saucelabs.com/tests/e049ddc22926453ab333dd6388b8c4e3"}}'}

    def check_response(self, response):
        """
        Checks that a JSON response from the WebDriver does not have an error.
    
        :Args:
         - response - The JSON response from the WebDriver server as a dictionary
           object.
    
        :Raises: If the response contains an error message.
        """
        status = response.get('status', None)
        if status is None or status == ErrorCode.SUCCESS:
            return
        value = None
        message = response.get("message", "")
        screen = response.get("screen", "")
        stacktrace = None
        if isinstance(status, int):
            value_json = response.get('value', None)
            if value_json and isinstance(value_json, basestring):
                import json
                try:
                    value = json.loads(value_json)
                    if len(value.keys()) == 1:
                        value = value['value']
                    status = value.get('error', None)
                    if status is None:
                        status = value["status"]
                        message = value["value"]
                        if not isinstance(message, basestring):
                            value = message
                            message = message.get('message')
                    else:
                        message = value.get('message', None)
                except ValueError:
                    pass
    
        exception_class = ErrorInResponseException
        if status in ErrorCode.NO_SUCH_ELEMENT:
            exception_class = NoSuchElementException
        elif status in ErrorCode.NO_SUCH_FRAME:
            exception_class = NoSuchFrameException
        elif status in ErrorCode.NO_SUCH_WINDOW:
            exception_class = NoSuchWindowException
        elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
            exception_class = StaleElementReferenceException
        elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
            exception_class = ElementNotVisibleException
        elif status in ErrorCode.INVALID_ELEMENT_STATE:
            exception_class = InvalidElementStateException
        elif status in ErrorCode.INVALID_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
            exception_class = InvalidSelectorException
        elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
            exception_class = ElementNotSelectableException
        elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
            exception_class = ElementNotInteractableException
        elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
            exception_class = InvalidCookieDomainException
        elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
            exception_class = UnableToSetCookieException
        elif status in ErrorCode.TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.SCRIPT_TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.UNKNOWN_ERROR:
            exception_class = WebDriverException
        elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
            exception_class = UnexpectedAlertPresentException
        elif status in ErrorCode.NO_ALERT_OPEN:
            exception_class = NoAlertPresentException
        elif status in ErrorCode.IME_NOT_AVAILABLE:
            exception_class = ImeNotAvailableException
        elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
            exception_class = ImeActivationFailedException
        elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
            exception_class = MoveTargetOutOfBoundsException
        elif status in ErrorCode.JAVASCRIPT_ERROR:
            exception_class = JavascriptException
        elif status in ErrorCode.SESSION_NOT_CREATED:
            exception_class = SessionNotCreatedException
        elif status in ErrorCode.INVALID_ARGUMENT:
            exception_class = InvalidArgumentException
        elif status in ErrorCode.NO_SUCH_COOKIE:
            exception_class = NoSuchCookieException
        elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
            exception_class = ScreenshotException
        elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
            exception_class = ElementClickInterceptedException
        elif status in ErrorCode.INSECURE_CERTIFICATE:
            exception_class = InsecureCertificateException
        elif status in ErrorCode.INVALID_COORDINATES:
            exception_class = InvalidCoordinatesException
        elif status in ErrorCode.INVALID_SESSION_ID:
            exception_class = InvalidSessionIdException
        elif status in ErrorCode.UNKNOWN_METHOD:
            exception_class = UnknownMethodException
        else:
            exception_class = WebDriverException
        if value == '' or value is None:
            value = response['value']
        if isinstance(value, basestring):
            if exception_class == ErrorInResponseException:
                raise exception_class(response, value)
            raise exception_class(value)
        if message == "" and 'message' in value:
            message = value['message']
    
        screen = None
        if 'screen' in value:
            screen = value['screen']
    
        stacktrace = None
        if 'stackTrace' in value and value['stackTrace']:
            stacktrace = []
            try:
                for frame in value['stackTrace']:
                    line = self._value_or_default(frame, 'lineNumber', '')
                    file = self._value_or_default(frame, 'fileName', '<anonymous>')
                    if line:
                        file = "%s:%s" % (file, line)
                    meth = self._value_or_default(frame, 'methodName', '<anonymous>')
                    if 'className' in frame:
                        meth = "%s.%s" % (frame['className'], meth)
                    msg = "    at %s (%s)"
                    msg = msg % (meth, file)
                    stacktrace.append(msg)
            except TypeError:
                pass
        if exception_class == ErrorInResponseException:
            raise exception_class(response, message)
        elif exception_class == UnexpectedAlertPresentException:
            alert_text = None
            if 'data' in value:
                alert_text = value['data'].get('text')
            elif 'alert' in value:
                alert_text = value['alert'].get('text')
            raise exception_class(message, screen, stacktrace, alert_text)
>       raise exception_class(message, screen, stacktrace)
E       selenium.common.exceptions.WebDriverException: Message: Sauce could not start your job. For more information on what happened, please visit https://app.saucelabs.com/tests/e049ddc22926453ab333dd6388b8c4e3

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py:242: WebDriverException

Check failure on line 0 in test-results/test.xml

See this annotation in the file changed.

@github-actions github-actions / test-report-Object__chrome_test_splunk_ta_example_addon_account

pytest ► tests.ui.test_splunk_ta_example_addon_account.chrome_TestAccount ► test_account_title_and_description

Failed test found in:
  test-results/test.xml
Error:
  request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_title_and_description>>
Raw output
request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_title_and_description>>

    @pytest.fixture(scope="function", autouse=True)
    def ucc_smartx_selenium_wrapper(request):
        """
        Calls ucc_smartx_selenium_helper fixture
        """
        if "ucc_smartx_selenium_helper" in request.fixturenames:
>           request.node.selenium_helper = request.getfixturevalue(
                "ucc_smartx_selenium_helper"
            )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:254: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_title_and_description>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
                selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )
                break
            except Exception as e:
                last_exc = e
                LOGGER.warn(
                    "Failed to configure the browser or login to Splunk instance for - Try={} \nTRACEBACK::{}".format(
                        try_number, traceback.format_exc()
                    )
                )
        else:
            LOGGER.error(
                "Could not connect to Browser or login to Splunk instance. Please check the logs for detailed error of each retry"
            )
>           raise (last_exc)

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:198: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_title_and_description>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
>               selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab152d8a0>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_title_and_description'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )
    
            # selenium local stack
            elif browser == "chrome_grid":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://chrome-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_grid":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://firefox-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
            # kubernetes selenium
            elif browser == "chrome_k8s":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_k8s":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
    
            elif browser == "edge":
                if debug:
                    self.browser = Edge(
                        executable_path="msedgedriver",
                        desired_capabilities=self.get_local_edge_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    command_executor = EdgeRemoteConnection(
                        "https://ondemand.saucelabs.com:443/wd/hub"
                    )
                    options = EdgeOptions()
                    options.use_chromium = True
                    self.browser = webdriver.Remote(
                        command_executor=command_executor,
                        options=options,
                        desired_capabilities=self.get_sauce_edge_opts(browser_version),
                    )
    
            elif browser == "IE":
                if debug:
                    self.browser = webdriver.Ie(capabilities=self.get_local_ie_opts())
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_ie_opts(browser_version),
                    )
            elif browser == "safari":
                if debug:
                    self.browser = webdriver.Safari()
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_safari_opts(
                            browser_version
                        ),
                    )
            else:
                raise Exception(
                    "No valid browser found.! expected=[firefox, chrome, safari], got={}".format(
                        browser
                    )
                )
        except Exception as e:
>           raise e

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:203: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab152d8a0>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_title_and_description'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
>                   self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
command_executor = 'https://ondemand.saucelabs.com:443/wd/hub'
desired_capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None, proxy = None, keep_alive = False, file_detector = None
options = None

    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
                 desired_capabilities=None, browser_profile=None, proxy=None,
                 keep_alive=False, file_detector=None, options=None):
        """
        Create a new driver that will issue commands using the wire protocol.
    
        :Args:
         - command_executor - Either a string representing URL of the remote server or a custom
             remote_connection.RemoteConnection object. Defaults to 'http://127.0.0.1:4444/wd/hub'.
         - desired_capabilities - A dictionary of capabilities to request when
             starting the browser session. Required parameter.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object.
             Only used if Firefox is requested. Optional.
         - proxy - A selenium.webdriver.common.proxy.Proxy object. The browser session will
             be started with given proxy settings, if possible. Optional.
         - keep_alive - Whether to configure remote_connection.RemoteConnection to use
             HTTP keep-alive. Defaults to False.
         - file_detector - Pass custom file detector object during instantiation. If None,
             then default LocalFileDetector() will be used.
         - options - instance of a driver options.Options class
        """
        capabilities = {}
        if options is not None:
            capabilities = options.to_capabilities()
        if desired_capabilities is not None:
            if not isinstance(desired_capabilities, dict):
                raise WebDriverException("Desired Capabilities must be a dictionary")
            else:
                capabilities.update(desired_capabilities)
        if proxy is not None:
            warnings.warn("Please use FirefoxOptions to set proxy",
                          DeprecationWarning, stacklevel=2)
            proxy.add_to_capabilities(capabilities)
        self.command_executor = command_executor
        if type(self.command_executor) is bytes or isinstance(self.command_executor, str):
            self.command_executor = RemoteConnection(command_executor, keep_alive=keep_alive)
        self._is_remote = True
        self.session_id = None
        self.capabilities = {}
        self.error_handler = ErrorHandler()
        self.start_client()
        if browser_profile is not None:
            warnings.warn("Please use FirefoxOptions to set browser profile",
                          DeprecationWarning, stacklevel=2)
>       self.start_session(capabilities, browser_profile)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None

    def start_session(self, capabilities, browser_profile=None):
        """
        Creates a new session with the desired capabilities.
    
        :Args:
         - browser_name - The name of the browser to request.
         - version - Which browser version to request.
         - platform - Which platform to request the browser on.
         - javascript_enabled - Whether the new session should support JavaScript.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object. Only used if Firefox is requested.
        """
        if not isinstance(capabilities, dict):
            raise InvalidArgumentException("Capabilities must be a dictionary")
        if browser_profile:
            if "moz:firefoxOptions" in capabilities:
                capabilities["moz:firefoxOptions"]["profile"] = browser_profile.encoded
            else:
                capabilities.update({'firefox_profile': browser_profile.encoded})
        w3c_caps = _make_w3c_caps(capabilities)
        parameters = {"capabilities": w3c_caps,
                      "desiredCapabilities": capabilities}
>       response = self.execute(Command.NEW_SESSION, parameters)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
driver_command = 'newSession'
params = {'capabilities': {'alwaysMatch': {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ...ns': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}}

    def execute(self, driver_command, params=None):
        """
        Sends a command to be executed by a command.CommandExecutor.
    
        :Args:
         - driver_command: The name of the command to execute as a string.
         - params: A dictionary of named parameters to send with the command.
    
        :Returns:
          The command's JSON response loaded into a dictionary object.
        """
        if self.session_id is not None:
            if not params:
                params = {'sessionId': self.session_id}
            elif 'sessionId' not in params:
                params['sessionId'] = self.session_id
    
        params = self._wrap_value(params)
        response = self.command_executor.execute(driver_command, params)
        if response:
>           self.error_handler.check_response(response)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:321: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f6ab152e320>
response = {'status': 500, 'value': '{"status": 13, "sessionId": "8d47caed825b4c38965bfba3c867c776", "value": {"message": "Sauce ...r more information on what happened, please visit https://app.saucelabs.com/tests/8d47caed825b4c38965bfba3c867c776"}}'}

    def check_response(self, response):
        """
        Checks that a JSON response from the WebDriver does not have an error.
    
        :Args:
         - response - The JSON response from the WebDriver server as a dictionary
           object.
    
        :Raises: If the response contains an error message.
        """
        status = response.get('status', None)
        if status is None or status == ErrorCode.SUCCESS:
            return
        value = None
        message = response.get("message", "")
        screen = response.get("screen", "")
        stacktrace = None
        if isinstance(status, int):
            value_json = response.get('value', None)
            if value_json and isinstance(value_json, basestring):
                import json
                try:
                    value = json.loads(value_json)
                    if len(value.keys()) == 1:
                        value = value['value']
                    status = value.get('error', None)
                    if status is None:
                        status = value["status"]
                        message = value["value"]
                        if not isinstance(message, basestring):
                            value = message
                            message = message.get('message')
                    else:
                        message = value.get('message', None)
                except ValueError:
                    pass
    
        exception_class = ErrorInResponseException
        if status in ErrorCode.NO_SUCH_ELEMENT:
            exception_class = NoSuchElementException
        elif status in ErrorCode.NO_SUCH_FRAME:
            exception_class = NoSuchFrameException
        elif status in ErrorCode.NO_SUCH_WINDOW:
            exception_class = NoSuchWindowException
        elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
            exception_class = StaleElementReferenceException
        elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
            exception_class = ElementNotVisibleException
        elif status in ErrorCode.INVALID_ELEMENT_STATE:
            exception_class = InvalidElementStateException
        elif status in ErrorCode.INVALID_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
            exception_class = InvalidSelectorException
        elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
            exception_class = ElementNotSelectableException
        elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
            exception_class = ElementNotInteractableException
        elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
            exception_class = InvalidCookieDomainException
        elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
            exception_class = UnableToSetCookieException
        elif status in ErrorCode.TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.SCRIPT_TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.UNKNOWN_ERROR:
            exception_class = WebDriverException
        elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
            exception_class = UnexpectedAlertPresentException
        elif status in ErrorCode.NO_ALERT_OPEN:
            exception_class = NoAlertPresentException
        elif status in ErrorCode.IME_NOT_AVAILABLE:
            exception_class = ImeNotAvailableException
        elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
            exception_class = ImeActivationFailedException
        elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
            exception_class = MoveTargetOutOfBoundsException
        elif status in ErrorCode.JAVASCRIPT_ERROR:
            exception_class = JavascriptException
        elif status in ErrorCode.SESSION_NOT_CREATED:
            exception_class = SessionNotCreatedException
        elif status in ErrorCode.INVALID_ARGUMENT:
            exception_class = InvalidArgumentException
        elif status in ErrorCode.NO_SUCH_COOKIE:
            exception_class = NoSuchCookieException
        elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
            exception_class = ScreenshotException
        elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
            exception_class = ElementClickInterceptedException
        elif status in ErrorCode.INSECURE_CERTIFICATE:
            exception_class = InsecureCertificateException
        elif status in ErrorCode.INVALID_COORDINATES:
            exception_class = InvalidCoordinatesException
        elif status in ErrorCode.INVALID_SESSION_ID:
            exception_class = InvalidSessionIdException
        elif status in ErrorCode.UNKNOWN_METHOD:
            exception_class = UnknownMethodException
        else:
            exception_class = WebDriverException
        if value == '' or value is None:
            value = response['value']
        if isinstance(value, basestring):
            if exception_class == ErrorInResponseException:
                raise exception_class(response, value)
            raise exception_class(value)
        if message == "" and 'message' in value:
            message = value['message']
    
        screen = None
        if 'screen' in value:
            screen = value['screen']
    
        stacktrace = None
        if 'stackTrace' in value and value['stackTrace']:
            stacktrace = []
            try:
                for frame in value['stackTrace']:
                    line = self._value_or_default(frame, 'lineNumber', '')
                    file = self._value_or_default(frame, 'fileName', '<anonymous>')
                    if line:
                        file = "%s:%s" % (file, line)
                    meth = self._value_or_default(frame, 'methodName', '<anonymous>')
                    if 'className' in frame:
                        meth = "%s.%s" % (frame['className'], meth)
                    msg = "    at %s (%s)"
                    msg = msg % (meth, file)
                    stacktrace.append(msg)
            except TypeError:
                pass
        if exception_class == ErrorInResponseException:
            raise exception_class(response, message)
        elif exception_class == UnexpectedAlertPresentException:
            alert_text = None
            if 'data' in value:
                alert_text = value['data'].get('text')
            elif 'alert' in value:
                alert_text = value['alert'].get('text')
            raise exception_class(message, screen, stacktrace, alert_text)
>       raise exception_class(message, screen, stacktrace)
E       selenium.common.exceptions.WebDriverException: Message: Sauce could not start your job. For more information on what happened, please visit https://app.saucelabs.com/tests/8d47caed825b4c38965bfba3c867c776

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py:242: WebDriverException

Check failure on line 0 in test-results/test.xml

See this annotation in the file changed.

@github-actions github-actions / test-report-Object__chrome_test_splunk_ta_example_addon_account

pytest ► tests.ui.test_splunk_ta_example_addon_account.chrome_TestAccount ► test_account_add_valid_title

Failed test found in:
  test-results/test.xml
Error:
  request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_add_valid_title>>
Raw output
request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_add_valid_title>>

    @pytest.fixture(scope="function", autouse=True)
    def ucc_smartx_selenium_wrapper(request):
        """
        Calls ucc_smartx_selenium_helper fixture
        """
        if "ucc_smartx_selenium_helper" in request.fixturenames:
>           request.node.selenium_helper = request.getfixturevalue(
                "ucc_smartx_selenium_helper"
            )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:254: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_add_valid_title>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
                selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )
                break
            except Exception as e:
                last_exc = e
                LOGGER.warn(
                    "Failed to configure the browser or login to Splunk instance for - Try={} \nTRACEBACK::{}".format(
                        try_number, traceback.format_exc()
                    )
                )
        else:
            LOGGER.error(
                "Could not connect to Browser or login to Splunk instance. Please check the logs for detailed error of each retry"
            )
>           raise (last_exc)

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:198: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_add_valid_title>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
>               selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab14c35b0>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_add_valid_title'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )
    
            # selenium local stack
            elif browser == "chrome_grid":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://chrome-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_grid":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://firefox-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
            # kubernetes selenium
            elif browser == "chrome_k8s":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_k8s":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
    
            elif browser == "edge":
                if debug:
                    self.browser = Edge(
                        executable_path="msedgedriver",
                        desired_capabilities=self.get_local_edge_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    command_executor = EdgeRemoteConnection(
                        "https://ondemand.saucelabs.com:443/wd/hub"
                    )
                    options = EdgeOptions()
                    options.use_chromium = True
                    self.browser = webdriver.Remote(
                        command_executor=command_executor,
                        options=options,
                        desired_capabilities=self.get_sauce_edge_opts(browser_version),
                    )
    
            elif browser == "IE":
                if debug:
                    self.browser = webdriver.Ie(capabilities=self.get_local_ie_opts())
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_ie_opts(browser_version),
                    )
            elif browser == "safari":
                if debug:
                    self.browser = webdriver.Safari()
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_safari_opts(
                            browser_version
                        ),
                    )
            else:
                raise Exception(
                    "No valid browser found.! expected=[firefox, chrome, safari], got={}".format(
                        browser
                    )
                )
        except Exception as e:
>           raise e

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:203: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab14c35b0>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_add_valid_title'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
>                   self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
command_executor = 'https://ondemand.saucelabs.com:443/wd/hub'
desired_capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None, proxy = None, keep_alive = False, file_detector = None
options = None

    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
                 desired_capabilities=None, browser_profile=None, proxy=None,
                 keep_alive=False, file_detector=None, options=None):
        """
        Create a new driver that will issue commands using the wire protocol.
    
        :Args:
         - command_executor - Either a string representing URL of the remote server or a custom
             remote_connection.RemoteConnection object. Defaults to 'http://127.0.0.1:4444/wd/hub'.
         - desired_capabilities - A dictionary of capabilities to request when
             starting the browser session. Required parameter.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object.
             Only used if Firefox is requested. Optional.
         - proxy - A selenium.webdriver.common.proxy.Proxy object. The browser session will
             be started with given proxy settings, if possible. Optional.
         - keep_alive - Whether to configure remote_connection.RemoteConnection to use
             HTTP keep-alive. Defaults to False.
         - file_detector - Pass custom file detector object during instantiation. If None,
             then default LocalFileDetector() will be used.
         - options - instance of a driver options.Options class
        """
        capabilities = {}
        if options is not None:
            capabilities = options.to_capabilities()
        if desired_capabilities is not None:
            if not isinstance(desired_capabilities, dict):
                raise WebDriverException("Desired Capabilities must be a dictionary")
            else:
                capabilities.update(desired_capabilities)
        if proxy is not None:
            warnings.warn("Please use FirefoxOptions to set proxy",
                          DeprecationWarning, stacklevel=2)
            proxy.add_to_capabilities(capabilities)
        self.command_executor = command_executor
        if type(self.command_executor) is bytes or isinstance(self.command_executor, str):
            self.command_executor = RemoteConnection(command_executor, keep_alive=keep_alive)
        self._is_remote = True
        self.session_id = None
        self.capabilities = {}
        self.error_handler = ErrorHandler()
        self.start_client()
        if browser_profile is not None:
            warnings.warn("Please use FirefoxOptions to set browser profile",
                          DeprecationWarning, stacklevel=2)
>       self.start_session(capabilities, browser_profile)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None

    def start_session(self, capabilities, browser_profile=None):
        """
        Creates a new session with the desired capabilities.
    
        :Args:
         - browser_name - The name of the browser to request.
         - version - Which browser version to request.
         - platform - Which platform to request the browser on.
         - javascript_enabled - Whether the new session should support JavaScript.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object. Only used if Firefox is requested.
        """
        if not isinstance(capabilities, dict):
            raise InvalidArgumentException("Capabilities must be a dictionary")
        if browser_profile:
            if "moz:firefoxOptions" in capabilities:
                capabilities["moz:firefoxOptions"]["profile"] = browser_profile.encoded
            else:
                capabilities.update({'firefox_profile': browser_profile.encoded})
        w3c_caps = _make_w3c_caps(capabilities)
        parameters = {"capabilities": w3c_caps,
                      "desiredCapabilities": capabilities}
>       response = self.execute(Command.NEW_SESSION, parameters)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
driver_command = 'newSession'
params = {'capabilities': {'alwaysMatch': {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ...ns': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}}

    def execute(self, driver_command, params=None):
        """
        Sends a command to be executed by a command.CommandExecutor.
    
        :Args:
         - driver_command: The name of the command to execute as a string.
         - params: A dictionary of named parameters to send with the command.
    
        :Returns:
          The command's JSON response loaded into a dictionary object.
        """
        if self.session_id is not None:
            if not params:
                params = {'sessionId': self.session_id}
            elif 'sessionId' not in params:
                params['sessionId'] = self.session_id
    
        params = self._wrap_value(params)
        response = self.command_executor.execute(driver_command, params)
        if response:
>           self.error_handler.check_response(response)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:321: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f6ab14c2c20>
response = {'status': 500, 'value': '{"status": 13, "sessionId": "bf56e3834c444003b7e5eda71bfdeede", "value": {"message": "Sauce ...r more information on what happened, please visit https://app.saucelabs.com/tests/bf56e3834c444003b7e5eda71bfdeede"}}'}

    def check_response(self, response):
        """
        Checks that a JSON response from the WebDriver does not have an error.
    
        :Args:
         - response - The JSON response from the WebDriver server as a dictionary
           object.
    
        :Raises: If the response contains an error message.
        """
        status = response.get('status', None)
        if status is None or status == ErrorCode.SUCCESS:
            return
        value = None
        message = response.get("message", "")
        screen = response.get("screen", "")
        stacktrace = None
        if isinstance(status, int):
            value_json = response.get('value', None)
            if value_json and isinstance(value_json, basestring):
                import json
                try:
                    value = json.loads(value_json)
                    if len(value.keys()) == 1:
                        value = value['value']
                    status = value.get('error', None)
                    if status is None:
                        status = value["status"]
                        message = value["value"]
                        if not isinstance(message, basestring):
                            value = message
                            message = message.get('message')
                    else:
                        message = value.get('message', None)
                except ValueError:
                    pass
    
        exception_class = ErrorInResponseException
        if status in ErrorCode.NO_SUCH_ELEMENT:
            exception_class = NoSuchElementException
        elif status in ErrorCode.NO_SUCH_FRAME:
            exception_class = NoSuchFrameException
        elif status in ErrorCode.NO_SUCH_WINDOW:
            exception_class = NoSuchWindowException
        elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
            exception_class = StaleElementReferenceException
        elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
            exception_class = ElementNotVisibleException
        elif status in ErrorCode.INVALID_ELEMENT_STATE:
            exception_class = InvalidElementStateException
        elif status in ErrorCode.INVALID_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
            exception_class = InvalidSelectorException
        elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
            exception_class = ElementNotSelectableException
        elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
            exception_class = ElementNotInteractableException
        elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
            exception_class = InvalidCookieDomainException
        elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
            exception_class = UnableToSetCookieException
        elif status in ErrorCode.TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.SCRIPT_TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.UNKNOWN_ERROR:
            exception_class = WebDriverException
        elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
            exception_class = UnexpectedAlertPresentException
        elif status in ErrorCode.NO_ALERT_OPEN:
            exception_class = NoAlertPresentException
        elif status in ErrorCode.IME_NOT_AVAILABLE:
            exception_class = ImeNotAvailableException
        elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
            exception_class = ImeActivationFailedException
        elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
            exception_class = MoveTargetOutOfBoundsException
        elif status in ErrorCode.JAVASCRIPT_ERROR:
            exception_class = JavascriptException
        elif status in ErrorCode.SESSION_NOT_CREATED:
            exception_class = SessionNotCreatedException
        elif status in ErrorCode.INVALID_ARGUMENT:
            exception_class = InvalidArgumentException
        elif status in ErrorCode.NO_SUCH_COOKIE:
            exception_class = NoSuchCookieException
        elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
            exception_class = ScreenshotException
        elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
            exception_class = ElementClickInterceptedException
        elif status in ErrorCode.INSECURE_CERTIFICATE:
            exception_class = InsecureCertificateException
        elif status in ErrorCode.INVALID_COORDINATES:
            exception_class = InvalidCoordinatesException
        elif status in ErrorCode.INVALID_SESSION_ID:
            exception_class = InvalidSessionIdException
        elif status in ErrorCode.UNKNOWN_METHOD:
            exception_class = UnknownMethodException
        else:
            exception_class = WebDriverException
        if value == '' or value is None:
            value = response['value']
        if isinstance(value, basestring):
            if exception_class == ErrorInResponseException:
                raise exception_class(response, value)
            raise exception_class(value)
        if message == "" and 'message' in value:
            message = value['message']
    
        screen = None
        if 'screen' in value:
            screen = value['screen']
    
        stacktrace = None
        if 'stackTrace' in value and value['stackTrace']:
            stacktrace = []
            try:
                for frame in value['stackTrace']:
                    line = self._value_or_default(frame, 'lineNumber', '')
                    file = self._value_or_default(frame, 'fileName', '<anonymous>')
                    if line:
                        file = "%s:%s" % (file, line)
                    meth = self._value_or_default(frame, 'methodName', '<anonymous>')
                    if 'className' in frame:
                        meth = "%s.%s" % (frame['className'], meth)
                    msg = "    at %s (%s)"
                    msg = msg % (meth, file)
                    stacktrace.append(msg)
            except TypeError:
                pass
        if exception_class == ErrorInResponseException:
            raise exception_class(response, message)
        elif exception_class == UnexpectedAlertPresentException:
            alert_text = None
            if 'data' in value:
                alert_text = value['data'].get('text')
            elif 'alert' in value:
                alert_text = value['alert'].get('text')
            raise exception_class(message, screen, stacktrace, alert_text)
>       raise exception_class(message, screen, stacktrace)
E       selenium.common.exceptions.WebDriverException: Message: Sauce could not start your job. For more information on what happened, please visit https://app.saucelabs.com/tests/bf56e3834c444003b7e5eda71bfdeede

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py:242: WebDriverException

Check failure on line 0 in test-results/test.xml

See this annotation in the file changed.

@github-actions github-actions / test-report-Object__chrome_test_splunk_ta_example_addon_account

pytest ► tests.ui.test_splunk_ta_example_addon_account.chrome_TestAccount ► test_account_edit_valid_title

Failed test found in:
  test-results/test.xml
Error:
  request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_edit_valid_title>>
Raw output
request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_edit_valid_title>>

    @pytest.fixture(scope="function", autouse=True)
    def ucc_smartx_selenium_wrapper(request):
        """
        Calls ucc_smartx_selenium_helper fixture
        """
        if "ucc_smartx_selenium_helper" in request.fixturenames:
>           request.node.selenium_helper = request.getfixturevalue(
                "ucc_smartx_selenium_helper"
            )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:254: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_edit_valid_title>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
                selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )
                break
            except Exception as e:
                last_exc = e
                LOGGER.warn(
                    "Failed to configure the browser or login to Splunk instance for - Try={} \nTRACEBACK::{}".format(
                        try_number, traceback.format_exc()
                    )
                )
        else:
            LOGGER.error(
                "Could not connect to Browser or login to Splunk instance. Please check the logs for detailed error of each retry"
            )
>           raise (last_exc)

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:198: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_edit_valid_title>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
>               selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab14c37f0>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_edit_valid_title'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )
    
            # selenium local stack
            elif browser == "chrome_grid":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://chrome-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_grid":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://firefox-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
            # kubernetes selenium
            elif browser == "chrome_k8s":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_k8s":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
    
            elif browser == "edge":
                if debug:
                    self.browser = Edge(
                        executable_path="msedgedriver",
                        desired_capabilities=self.get_local_edge_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    command_executor = EdgeRemoteConnection(
                        "https://ondemand.saucelabs.com:443/wd/hub"
                    )
                    options = EdgeOptions()
                    options.use_chromium = True
                    self.browser = webdriver.Remote(
                        command_executor=command_executor,
                        options=options,
                        desired_capabilities=self.get_sauce_edge_opts(browser_version),
                    )
    
            elif browser == "IE":
                if debug:
                    self.browser = webdriver.Ie(capabilities=self.get_local_ie_opts())
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_ie_opts(browser_version),
                    )
            elif browser == "safari":
                if debug:
                    self.browser = webdriver.Safari()
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_safari_opts(
                            browser_version
                        ),
                    )
            else:
                raise Exception(
                    "No valid browser found.! expected=[firefox, chrome, safari], got={}".format(
                        browser
                    )
                )
        except Exception as e:
>           raise e

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:203: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab14c37f0>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_edit_valid_title'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
>                   self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
command_executor = 'https://ondemand.saucelabs.com:443/wd/hub'
desired_capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None, proxy = None, keep_alive = False, file_detector = None
options = None

    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
                 desired_capabilities=None, browser_profile=None, proxy=None,
                 keep_alive=False, file_detector=None, options=None):
        """
        Create a new driver that will issue commands using the wire protocol.
    
        :Args:
         - command_executor - Either a string representing URL of the remote server or a custom
             remote_connection.RemoteConnection object. Defaults to 'http://127.0.0.1:4444/wd/hub'.
         - desired_capabilities - A dictionary of capabilities to request when
             starting the browser session. Required parameter.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object.
             Only used if Firefox is requested. Optional.
         - proxy - A selenium.webdriver.common.proxy.Proxy object. The browser session will
             be started with given proxy settings, if possible. Optional.
         - keep_alive - Whether to configure remote_connection.RemoteConnection to use
             HTTP keep-alive. Defaults to False.
         - file_detector - Pass custom file detector object during instantiation. If None,
             then default LocalFileDetector() will be used.
         - options - instance of a driver options.Options class
        """
        capabilities = {}
        if options is not None:
            capabilities = options.to_capabilities()
        if desired_capabilities is not None:
            if not isinstance(desired_capabilities, dict):
                raise WebDriverException("Desired Capabilities must be a dictionary")
            else:
                capabilities.update(desired_capabilities)
        if proxy is not None:
            warnings.warn("Please use FirefoxOptions to set proxy",
                          DeprecationWarning, stacklevel=2)
            proxy.add_to_capabilities(capabilities)
        self.command_executor = command_executor
        if type(self.command_executor) is bytes or isinstance(self.command_executor, str):
            self.command_executor = RemoteConnection(command_executor, keep_alive=keep_alive)
        self._is_remote = True
        self.session_id = None
        self.capabilities = {}
        self.error_handler = ErrorHandler()
        self.start_client()
        if browser_profile is not None:
            warnings.warn("Please use FirefoxOptions to set browser profile",
                          DeprecationWarning, stacklevel=2)
>       self.start_session(capabilities, browser_profile)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None

    def start_session(self, capabilities, browser_profile=None):
        """
        Creates a new session with the desired capabilities.
    
        :Args:
         - browser_name - The name of the browser to request.
         - version - Which browser version to request.
         - platform - Which platform to request the browser on.
         - javascript_enabled - Whether the new session should support JavaScript.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object. Only used if Firefox is requested.
        """
        if not isinstance(capabilities, dict):
            raise InvalidArgumentException("Capabilities must be a dictionary")
        if browser_profile:
            if "moz:firefoxOptions" in capabilities:
                capabilities["moz:firefoxOptions"]["profile"] = browser_profile.encoded
            else:
                capabilities.update({'firefox_profile': browser_profile.encoded})
        w3c_caps = _make_w3c_caps(capabilities)
        parameters = {"capabilities": w3c_caps,
                      "desiredCapabilities": capabilities}
>       response = self.execute(Command.NEW_SESSION, parameters)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
driver_command = 'newSession'
params = {'capabilities': {'alwaysMatch': {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ...ns': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}}

    def execute(self, driver_command, params=None):
        """
        Sends a command to be executed by a command.CommandExecutor.
    
        :Args:
         - driver_command: The name of the command to execute as a string.
         - params: A dictionary of named parameters to send with the command.
    
        :Returns:
          The command's JSON response loaded into a dictionary object.
        """
        if self.session_id is not None:
            if not params:
                params = {'sessionId': self.session_id}
            elif 'sessionId' not in params:
                params['sessionId'] = self.session_id
    
        params = self._wrap_value(params)
        response = self.command_executor.execute(driver_command, params)
        if response:
>           self.error_handler.check_response(response)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:321: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f6ab14c2cb0>
response = {'status': 500, 'value': '{"status": 13, "sessionId": "5b087dd93be24369a01cbe5554b88222", "value": {"message": "Sauce ...r more information on what happened, please visit https://app.saucelabs.com/tests/5b087dd93be24369a01cbe5554b88222"}}'}

    def check_response(self, response):
        """
        Checks that a JSON response from the WebDriver does not have an error.
    
        :Args:
         - response - The JSON response from the WebDriver server as a dictionary
           object.
    
        :Raises: If the response contains an error message.
        """
        status = response.get('status', None)
        if status is None or status == ErrorCode.SUCCESS:
            return
        value = None
        message = response.get("message", "")
        screen = response.get("screen", "")
        stacktrace = None
        if isinstance(status, int):
            value_json = response.get('value', None)
            if value_json and isinstance(value_json, basestring):
                import json
                try:
                    value = json.loads(value_json)
                    if len(value.keys()) == 1:
                        value = value['value']
                    status = value.get('error', None)
                    if status is None:
                        status = value["status"]
                        message = value["value"]
                        if not isinstance(message, basestring):
                            value = message
                            message = message.get('message')
                    else:
                        message = value.get('message', None)
                except ValueError:
                    pass
    
        exception_class = ErrorInResponseException
        if status in ErrorCode.NO_SUCH_ELEMENT:
            exception_class = NoSuchElementException
        elif status in ErrorCode.NO_SUCH_FRAME:
            exception_class = NoSuchFrameException
        elif status in ErrorCode.NO_SUCH_WINDOW:
            exception_class = NoSuchWindowException
        elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
            exception_class = StaleElementReferenceException
        elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
            exception_class = ElementNotVisibleException
        elif status in ErrorCode.INVALID_ELEMENT_STATE:
            exception_class = InvalidElementStateException
        elif status in ErrorCode.INVALID_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
            exception_class = InvalidSelectorException
        elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
            exception_class = ElementNotSelectableException
        elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
            exception_class = ElementNotInteractableException
        elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
            exception_class = InvalidCookieDomainException
        elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
            exception_class = UnableToSetCookieException
        elif status in ErrorCode.TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.SCRIPT_TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.UNKNOWN_ERROR:
            exception_class = WebDriverException
        elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
            exception_class = UnexpectedAlertPresentException
        elif status in ErrorCode.NO_ALERT_OPEN:
            exception_class = NoAlertPresentException
        elif status in ErrorCode.IME_NOT_AVAILABLE:
            exception_class = ImeNotAvailableException
        elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
            exception_class = ImeActivationFailedException
        elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
            exception_class = MoveTargetOutOfBoundsException
        elif status in ErrorCode.JAVASCRIPT_ERROR:
            exception_class = JavascriptException
        elif status in ErrorCode.SESSION_NOT_CREATED:
            exception_class = SessionNotCreatedException
        elif status in ErrorCode.INVALID_ARGUMENT:
            exception_class = InvalidArgumentException
        elif status in ErrorCode.NO_SUCH_COOKIE:
            exception_class = NoSuchCookieException
        elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
            exception_class = ScreenshotException
        elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
            exception_class = ElementClickInterceptedException
        elif status in ErrorCode.INSECURE_CERTIFICATE:
            exception_class = InsecureCertificateException
        elif status in ErrorCode.INVALID_COORDINATES:
            exception_class = InvalidCoordinatesException
        elif status in ErrorCode.INVALID_SESSION_ID:
            exception_class = InvalidSessionIdException
        elif status in ErrorCode.UNKNOWN_METHOD:
            exception_class = UnknownMethodException
        else:
            exception_class = WebDriverException
        if value == '' or value is None:
            value = response['value']
        if isinstance(value, basestring):
            if exception_class == ErrorInResponseException:
                raise exception_class(response, value)
            raise exception_class(value)
        if message == "" and 'message' in value:
            message = value['message']
    
        screen = None
        if 'screen' in value:
            screen = value['screen']
    
        stacktrace = None
        if 'stackTrace' in value and value['stackTrace']:
            stacktrace = []
            try:
                for frame in value['stackTrace']:
                    line = self._value_or_default(frame, 'lineNumber', '')
                    file = self._value_or_default(frame, 'fileName', '<anonymous>')
                    if line:
                        file = "%s:%s" % (file, line)
                    meth = self._value_or_default(frame, 'methodName', '<anonymous>')
                    if 'className' in frame:
                        meth = "%s.%s" % (frame['className'], meth)
                    msg = "    at %s (%s)"
                    msg = msg % (meth, file)
                    stacktrace.append(msg)
            except TypeError:
                pass
        if exception_class == ErrorInResponseException:
            raise exception_class(response, message)
        elif exception_class == UnexpectedAlertPresentException:
            alert_text = None
            if 'data' in value:
                alert_text = value['data'].get('text')
            elif 'alert' in value:
                alert_text = value['alert'].get('text')
            raise exception_class(message, screen, stacktrace, alert_text)
>       raise exception_class(message, screen, stacktrace)
E       selenium.common.exceptions.WebDriverException: Message: Sauce could not start your job. For more information on what happened, please visit https://app.saucelabs.com/tests/5b087dd93be24369a01cbe5554b88222

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py:242: WebDriverException

Check failure on line 0 in test-results/test.xml

See this annotation in the file changed.

@github-actions github-actions / test-report-Object__chrome_test_splunk_ta_example_addon_account

pytest ► tests.ui.test_splunk_ta_example_addon_account.chrome_TestAccount ► test_account_clone_valid_title

Failed test found in:
  test-results/test.xml
Error:
  request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_clone_valid_title>>
Raw output
request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_clone_valid_title>>

    @pytest.fixture(scope="function", autouse=True)
    def ucc_smartx_selenium_wrapper(request):
        """
        Calls ucc_smartx_selenium_helper fixture
        """
        if "ucc_smartx_selenium_helper" in request.fixturenames:
>           request.node.selenium_helper = request.getfixturevalue(
                "ucc_smartx_selenium_helper"
            )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:254: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_clone_valid_title>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
                selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )
                break
            except Exception as e:
                last_exc = e
                LOGGER.warn(
                    "Failed to configure the browser or login to Splunk instance for - Try={} \nTRACEBACK::{}".format(
                        try_number, traceback.format_exc()
                    )
                )
        else:
            LOGGER.error(
                "Could not connect to Browser or login to Splunk instance. Please check the logs for detailed error of each retry"
            )
>           raise (last_exc)

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:198: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_clone_valid_title>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
>               selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab140dde0>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_clone_valid_title'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )
    
            # selenium local stack
            elif browser == "chrome_grid":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://chrome-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_grid":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://firefox-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
            # kubernetes selenium
            elif browser == "chrome_k8s":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_k8s":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
    
            elif browser == "edge":
                if debug:
                    self.browser = Edge(
                        executable_path="msedgedriver",
                        desired_capabilities=self.get_local_edge_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    command_executor = EdgeRemoteConnection(
                        "https://ondemand.saucelabs.com:443/wd/hub"
                    )
                    options = EdgeOptions()
                    options.use_chromium = True
                    self.browser = webdriver.Remote(
                        command_executor=command_executor,
                        options=options,
                        desired_capabilities=self.get_sauce_edge_opts(browser_version),
                    )
    
            elif browser == "IE":
                if debug:
                    self.browser = webdriver.Ie(capabilities=self.get_local_ie_opts())
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_ie_opts(browser_version),
                    )
            elif browser == "safari":
                if debug:
                    self.browser = webdriver.Safari()
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_safari_opts(
                            browser_version
                        ),
                    )
            else:
                raise Exception(
                    "No valid browser found.! expected=[firefox, chrome, safari], got={}".format(
                        browser
                    )
                )
        except Exception as e:
>           raise e

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:203: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab140dde0>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_clone_valid_title'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
>                   self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
command_executor = 'https://ondemand.saucelabs.com:443/wd/hub'
desired_capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None, proxy = None, keep_alive = False, file_detector = None
options = None

    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
                 desired_capabilities=None, browser_profile=None, proxy=None,
                 keep_alive=False, file_detector=None, options=None):
        """
        Create a new driver that will issue commands using the wire protocol.
    
        :Args:
         - command_executor - Either a string representing URL of the remote server or a custom
             remote_connection.RemoteConnection object. Defaults to 'http://127.0.0.1:4444/wd/hub'.
         - desired_capabilities - A dictionary of capabilities to request when
             starting the browser session. Required parameter.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object.
             Only used if Firefox is requested. Optional.
         - proxy - A selenium.webdriver.common.proxy.Proxy object. The browser session will
             be started with given proxy settings, if possible. Optional.
         - keep_alive - Whether to configure remote_connection.RemoteConnection to use
             HTTP keep-alive. Defaults to False.
         - file_detector - Pass custom file detector object during instantiation. If None,
             then default LocalFileDetector() will be used.
         - options - instance of a driver options.Options class
        """
        capabilities = {}
        if options is not None:
            capabilities = options.to_capabilities()
        if desired_capabilities is not None:
            if not isinstance(desired_capabilities, dict):
                raise WebDriverException("Desired Capabilities must be a dictionary")
            else:
                capabilities.update(desired_capabilities)
        if proxy is not None:
            warnings.warn("Please use FirefoxOptions to set proxy",
                          DeprecationWarning, stacklevel=2)
            proxy.add_to_capabilities(capabilities)
        self.command_executor = command_executor
        if type(self.command_executor) is bytes or isinstance(self.command_executor, str):
            self.command_executor = RemoteConnection(command_executor, keep_alive=keep_alive)
        self._is_remote = True
        self.session_id = None
        self.capabilities = {}
        self.error_handler = ErrorHandler()
        self.start_client()
        if browser_profile is not None:
            warnings.warn("Please use FirefoxOptions to set browser profile",
                          DeprecationWarning, stacklevel=2)
>       self.start_session(capabilities, browser_profile)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None

    def start_session(self, capabilities, browser_profile=None):
        """
        Creates a new session with the desired capabilities.
    
        :Args:
         - browser_name - The name of the browser to request.
         - version - Which browser version to request.
         - platform - Which platform to request the browser on.
         - javascript_enabled - Whether the new session should support JavaScript.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object. Only used if Firefox is requested.
        """
        if not isinstance(capabilities, dict):
            raise InvalidArgumentException("Capabilities must be a dictionary")
        if browser_profile:
            if "moz:firefoxOptions" in capabilities:
                capabilities["moz:firefoxOptions"]["profile"] = browser_profile.encoded
            else:
                capabilities.update({'firefox_profile': browser_profile.encoded})
        w3c_caps = _make_w3c_caps(capabilities)
        parameters = {"capabilities": w3c_caps,
                      "desiredCapabilities": capabilities}
>       response = self.execute(Command.NEW_SESSION, parameters)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
driver_command = 'newSession'
params = {'capabilities': {'alwaysMatch': {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ...ns': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}}

    def execute(self, driver_command, params=None):
        """
        Sends a command to be executed by a command.CommandExecutor.
    
        :Args:
         - driver_command: The name of the command to execute as a string.
         - params: A dictionary of named parameters to send with the command.
    
        :Returns:
          The command's JSON response loaded into a dictionary object.
        """
        if self.session_id is not None:
            if not params:
                params = {'sessionId': self.session_id}
            elif 'sessionId' not in params:
                params['sessionId'] = self.session_id
    
        params = self._wrap_value(params)
        response = self.command_executor.execute(driver_command, params)
        if response:
>           self.error_handler.check_response(response)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:321: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f6ab140efe0>
response = {'status': 500, 'value': '{"status": 13, "sessionId": "17f2cc6ea20b4ebeaa14c161550992ce", "value": {"message": "Sauce ...r more information on what happened, please visit https://app.saucelabs.com/tests/17f2cc6ea20b4ebeaa14c161550992ce"}}'}

    def check_response(self, response):
        """
        Checks that a JSON response from the WebDriver does not have an error.
    
        :Args:
         - response - The JSON response from the WebDriver server as a dictionary
           object.
    
        :Raises: If the response contains an error message.
        """
        status = response.get('status', None)
        if status is None or status == ErrorCode.SUCCESS:
            return
        value = None
        message = response.get("message", "")
        screen = response.get("screen", "")
        stacktrace = None
        if isinstance(status, int):
            value_json = response.get('value', None)
            if value_json and isinstance(value_json, basestring):
                import json
                try:
                    value = json.loads(value_json)
                    if len(value.keys()) == 1:
                        value = value['value']
                    status = value.get('error', None)
                    if status is None:
                        status = value["status"]
                        message = value["value"]
                        if not isinstance(message, basestring):
                            value = message
                            message = message.get('message')
                    else:
                        message = value.get('message', None)
                except ValueError:
                    pass
    
        exception_class = ErrorInResponseException
        if status in ErrorCode.NO_SUCH_ELEMENT:
            exception_class = NoSuchElementException
        elif status in ErrorCode.NO_SUCH_FRAME:
            exception_class = NoSuchFrameException
        elif status in ErrorCode.NO_SUCH_WINDOW:
            exception_class = NoSuchWindowException
        elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
            exception_class = StaleElementReferenceException
        elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
            exception_class = ElementNotVisibleException
        elif status in ErrorCode.INVALID_ELEMENT_STATE:
            exception_class = InvalidElementStateException
        elif status in ErrorCode.INVALID_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
            exception_class = InvalidSelectorException
        elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
            exception_class = ElementNotSelectableException
        elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
            exception_class = ElementNotInteractableException
        elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
            exception_class = InvalidCookieDomainException
        elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
            exception_class = UnableToSetCookieException
        elif status in ErrorCode.TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.SCRIPT_TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.UNKNOWN_ERROR:
            exception_class = WebDriverException
        elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
            exception_class = UnexpectedAlertPresentException
        elif status in ErrorCode.NO_ALERT_OPEN:
            exception_class = NoAlertPresentException
        elif status in ErrorCode.IME_NOT_AVAILABLE:
            exception_class = ImeNotAvailableException
        elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
            exception_class = ImeActivationFailedException
        elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
            exception_class = MoveTargetOutOfBoundsException
        elif status in ErrorCode.JAVASCRIPT_ERROR:
            exception_class = JavascriptException
        elif status in ErrorCode.SESSION_NOT_CREATED:
            exception_class = SessionNotCreatedException
        elif status in ErrorCode.INVALID_ARGUMENT:
            exception_class = InvalidArgumentException
        elif status in ErrorCode.NO_SUCH_COOKIE:
            exception_class = NoSuchCookieException
        elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
            exception_class = ScreenshotException
        elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
            exception_class = ElementClickInterceptedException
        elif status in ErrorCode.INSECURE_CERTIFICATE:
            exception_class = InsecureCertificateException
        elif status in ErrorCode.INVALID_COORDINATES:
            exception_class = InvalidCoordinatesException
        elif status in ErrorCode.INVALID_SESSION_ID:
            exception_class = InvalidSessionIdException
        elif status in ErrorCode.UNKNOWN_METHOD:
            exception_class = UnknownMethodException
        else:
            exception_class = WebDriverException
        if value == '' or value is None:
            value = response['value']
        if isinstance(value, basestring):
            if exception_class == ErrorInResponseException:
                raise exception_class(response, value)
            raise exception_class(value)
        if message == "" and 'message' in value:
            message = value['message']
    
        screen = None
        if 'screen' in value:
            screen = value['screen']
    
        stacktrace = None
        if 'stackTrace' in value and value['stackTrace']:
            stacktrace = []
            try:
                for frame in value['stackTrace']:
                    line = self._value_or_default(frame, 'lineNumber', '')
                    file = self._value_or_default(frame, 'fileName', '<anonymous>')
                    if line:
                        file = "%s:%s" % (file, line)
                    meth = self._value_or_default(frame, 'methodName', '<anonymous>')
                    if 'className' in frame:
                        meth = "%s.%s" % (frame['className'], meth)
                    msg = "    at %s (%s)"
                    msg = msg % (meth, file)
                    stacktrace.append(msg)
            except TypeError:
                pass
        if exception_class == ErrorInResponseException:
            raise exception_class(response, message)
        elif exception_class == UnexpectedAlertPresentException:
            alert_text = None
            if 'data' in value:
                alert_text = value['data'].get('text')
            elif 'alert' in value:
                alert_text = value['alert'].get('text')
            raise exception_class(message, screen, stacktrace, alert_text)
>       raise exception_class(message, screen, stacktrace)
E       selenium.common.exceptions.WebDriverException: Message: Sauce could not start your job. For more information on what happened, please visit https://app.saucelabs.com/tests/17f2cc6ea20b4ebeaa14c161550992ce

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py:242: WebDriverException

Check failure on line 0 in test-results/test.xml

See this annotation in the file changed.

@github-actions github-actions / test-report-Object__chrome_test_splunk_ta_example_addon_account

pytest ► tests.ui.test_splunk_ta_example_addon_account.chrome_TestAccount ► test_account_delete_valid_title

Failed test found in:
  test-results/test.xml
Error:
  request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_delete_valid_title>>
Raw output
request = <SubRequest 'ucc_smartx_selenium_wrapper' for <Function test_account_delete_valid_title>>

    @pytest.fixture(scope="function", autouse=True)
    def ucc_smartx_selenium_wrapper(request):
        """
        Calls ucc_smartx_selenium_helper fixture
        """
        if "ucc_smartx_selenium_helper" in request.fixturenames:
>           request.node.selenium_helper = request.getfixturevalue(
                "ucc_smartx_selenium_helper"
            )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:254: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_delete_valid_title>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
                selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )
                break
            except Exception as e:
                last_exc = e
                LOGGER.warn(
                    "Failed to configure the browser or login to Splunk instance for - Try={} \nTRACEBACK::{}".format(
                        try_number, traceback.format_exc()
                    )
                )
        else:
            LOGGER.error(
                "Could not connect to Browser or login to Splunk instance. Please check the logs for detailed error of each retry"
            )
>           raise (last_exc)

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:198: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

request = <SubRequest 'ucc_smartx_selenium_helper' for <Function test_account_delete_valid_title>>
ucc_smartx_configs = SmartConfigs(driver='chrome', driver_version='latest', local_run=False, retry_count=3, headless_run=False)
splunk = {'forwarder_host': 'splunk', 'host': 'splunk', 'password': 'Chang3d!', 'port': '8089', ...}
splunk_web_uri = 'http://splunk:8000/'
splunk_rest_uri = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')

    @pytest.fixture(scope=get_browser_scope)
    def ucc_smartx_selenium_helper(
        request, ucc_smartx_configs, splunk, splunk_web_uri, splunk_rest_uri
    ):
        # Try to configure selenium & Login to splunk instance
        test_case = "{}_{}".format(
            ucc_smartx_configs.driver, request.node.nodeid.split("::")[-1]
        )
        for try_number in range(ucc_smartx_configs.retry_count):
            last_exc = Exception()
            try:
>               selenium_helper = SeleniumHelper(
                    ucc_smartx_configs.driver,
                    ucc_smartx_configs.driver_version,
                    splunk_web_uri,
                    splunk_rest_uri,
                    debug=ucc_smartx_configs.local_run,
                    cred=(splunk["username"], splunk["password"]),
                    headless=ucc_smartx_configs.headless_run,
                    test_case=test_case,
                )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/plugin.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab150a350>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_delete_valid_title'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )
    
            # selenium local stack
            elif browser == "chrome_grid":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://chrome-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_grid":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://firefox-grid:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
            # kubernetes selenium
            elif browser == "chrome_k8s":
                google_cert_opts = {
                    "goog:chromeOptions": {
                        "w3c": True,
                        "args": ["ignore-certificate-errors", "ignore-ssl-errors=yes"],
                    }
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts("chrome", google_cert_opts),
                )
            elif browser == "firefox_k8s":
                firefox_cert_opts = {
                    "acceptInsecureCerts": True,
                    "acceptSslCerts": True,
                }
    
                self.browser = webdriver.Remote(
                    command_executor="http://selenium-hub.selenium.svc.cluster.local:4444/wd/hub",
                    desired_capabilities=self.get_grid_opts(
                        "firefox", firefox_cert_opts
                    ),
                )
    
            elif browser == "edge":
                if debug:
                    self.browser = Edge(
                        executable_path="msedgedriver",
                        desired_capabilities=self.get_local_edge_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
                    command_executor = EdgeRemoteConnection(
                        "https://ondemand.saucelabs.com:443/wd/hub"
                    )
                    options = EdgeOptions()
                    options.use_chromium = True
                    self.browser = webdriver.Remote(
                        command_executor=command_executor,
                        options=options,
                        desired_capabilities=self.get_sauce_edge_opts(browser_version),
                    )
    
            elif browser == "IE":
                if debug:
                    self.browser = webdriver.Ie(capabilities=self.get_local_ie_opts())
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_ie_opts(browser_version),
                    )
            elif browser == "safari":
                if debug:
                    self.browser = webdriver.Safari()
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_safari_opts(
                            browser_version
                        ),
                    )
            else:
                raise Exception(
                    "No valid browser found.! expected=[firefox, chrome, safari], got={}".format(
                        browser
                    )
                )
        except Exception as e:
>           raise e

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:203: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f6ab150a350>
browser = 'chrome', browser_version = 'latest'
splunk_web_url = 'http://splunk:8000/'
splunk_mgmt_url = (<requests.sessions.Session object at 0x7f6ab15baf20>, 'https://splunk:8089/')
debug = False, cred = ('admin', 'Chang3d!'), headless = False
test_case = 'chrome_test_account_delete_valid_title'

    def __init__(
        self,
        browser,
        browser_version,
        splunk_web_url,
        splunk_mgmt_url,
        debug=False,
        cred=("admin", "Chang3d!"),
        headless=False,
        test_case=None,
    ):
        self.splunk_web_url = splunk_web_url
        self.splunk_mgmt_url = splunk_mgmt_url
        self.cred = cred
        self.test_case = test_case
        self.skip_saucelab_job = False
    
        if "grid" in browser:
            self.skip_saucelab_job = True
            debug = True
    
        if not debug:
            # Using Saucelabs
            self.init_sauce_env_variables()
    
        try:
            if browser == "firefox":
                if debug:
                    self.browser = webdriver.Firefox(
                        firefox_options=self.get_local_firefox_opts(headless),
                        log_path="selenium.log",
                    )
                else:
                    self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_firefox_opts(
                            browser_version
                        ),
                    )
    
            elif browser == "chrome":
                if debug:
                    self.browser = webdriver.Chrome(
                        chrome_options=self.get_local_chrome_opts(headless),
                        service_args=["--verbose", "--log-path=selenium.log"],
                    )
                else:
>                   self.browser = webdriver.Remote(
                        command_executor="https://ondemand.saucelabs.com:443/wd/hub",
                        desired_capabilities=self.get_sauce_chrome_opts(
                            browser_version
                        ),
                    )

/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
command_executor = 'https://ondemand.saucelabs.com:443/wd/hub'
desired_capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None, proxy = None, keep_alive = False, file_detector = None
options = None

    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
                 desired_capabilities=None, browser_profile=None, proxy=None,
                 keep_alive=False, file_detector=None, options=None):
        """
        Create a new driver that will issue commands using the wire protocol.
    
        :Args:
         - command_executor - Either a string representing URL of the remote server or a custom
             remote_connection.RemoteConnection object. Defaults to 'http://127.0.0.1:4444/wd/hub'.
         - desired_capabilities - A dictionary of capabilities to request when
             starting the browser session. Required parameter.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object.
             Only used if Firefox is requested. Optional.
         - proxy - A selenium.webdriver.common.proxy.Proxy object. The browser session will
             be started with given proxy settings, if possible. Optional.
         - keep_alive - Whether to configure remote_connection.RemoteConnection to use
             HTTP keep-alive. Defaults to False.
         - file_detector - Pass custom file detector object during instantiation. If None,
             then default LocalFileDetector() will be used.
         - options - instance of a driver options.Options class
        """
        capabilities = {}
        if options is not None:
            capabilities = options.to_capabilities()
        if desired_capabilities is not None:
            if not isinstance(desired_capabilities, dict):
                raise WebDriverException("Desired Capabilities must be a dictionary")
            else:
                capabilities.update(desired_capabilities)
        if proxy is not None:
            warnings.warn("Please use FirefoxOptions to set proxy",
                          DeprecationWarning, stacklevel=2)
            proxy.add_to_capabilities(capabilities)
        self.command_executor = command_executor
        if type(self.command_executor) is bytes or isinstance(self.command_executor, str):
            self.command_executor = RemoteConnection(command_executor, keep_alive=keep_alive)
        self._is_remote = True
        self.session_id = None
        self.capabilities = {}
        self.error_handler = ErrorHandler()
        self.start_client()
        if browser_profile is not None:
            warnings.warn("Please use FirefoxOptions to set browser profile",
                          DeprecationWarning, stacklevel=2)
>       self.start_session(capabilities, browser_profile)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
capabilities = {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}
browser_profile = None

    def start_session(self, capabilities, browser_profile=None):
        """
        Creates a new session with the desired capabilities.
    
        :Args:
         - browser_name - The name of the browser to request.
         - version - Which browser version to request.
         - platform - Which platform to request the browser on.
         - javascript_enabled - Whether the new session should support JavaScript.
         - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object. Only used if Firefox is requested.
        """
        if not isinstance(capabilities, dict):
            raise InvalidArgumentException("Capabilities must be a dictionary")
        if browser_profile:
            if "moz:firefoxOptions" in capabilities:
                capabilities["moz:firefoxOptions"]["profile"] = browser_profile.encoded
            else:
                capabilities.update({'firefox_profile': browser_profile.encoded})
        w3c_caps = _make_w3c_caps(capabilities)
        parameters = {"capabilities": w3c_caps,
                      "desiredCapabilities": capabilities}
>       response = self.execute(Command.NEW_SESSION, parameters)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.webdriver.WebDriver (session="None")>
driver_command = 'newSession'
params = {'capabilities': {'alwaysMatch': {'browserName': 'chrome', 'browserVersion': 'latest', 'goog:chromeOptions': {'args': ...ns': {'args': ['ignore-certificate-errors', 'ignore-ssl-errors=yes'], 'w3c': True}, 'platformName': 'Windows 10', ...}}

    def execute(self, driver_command, params=None):
        """
        Sends a command to be executed by a command.CommandExecutor.
    
        :Args:
         - driver_command: The name of the command to execute as a string.
         - params: A dictionary of named parameters to send with the command.
    
        :Returns:
          The command's JSON response loaded into a dictionary object.
        """
        if self.session_id is not None:
            if not params:
                params = {'sessionId': self.session_id}
            elif 'sessionId' not in params:
                params['sessionId'] = self.session_id
    
        params = self._wrap_value(params)
        response = self.command_executor.execute(driver_command, params)
        if response:
>           self.error_handler.check_response(response)

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:321: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f6ab150b010>
response = {'status': 500, 'value': '{"status": 13, "sessionId": "83931538a19a45ec8e84a736d5d8d223", "value": {"message": "Sauce ...r more information on what happened, please visit https://app.saucelabs.com/tests/83931538a19a45ec8e84a736d5d8d223"}}'}

    def check_response(self, response):
        """
        Checks that a JSON response from the WebDriver does not have an error.
    
        :Args:
         - response - The JSON response from the WebDriver server as a dictionary
           object.
    
        :Raises: If the response contains an error message.
        """
        status = response.get('status', None)
        if status is None or status == ErrorCode.SUCCESS:
            return
        value = None
        message = response.get("message", "")
        screen = response.get("screen", "")
        stacktrace = None
        if isinstance(status, int):
            value_json = response.get('value', None)
            if value_json and isinstance(value_json, basestring):
                import json
                try:
                    value = json.loads(value_json)
                    if len(value.keys()) == 1:
                        value = value['value']
                    status = value.get('error', None)
                    if status is None:
                        status = value["status"]
                        message = value["value"]
                        if not isinstance(message, basestring):
                            value = message
                            message = message.get('message')
                    else:
                        message = value.get('message', None)
                except ValueError:
                    pass
    
        exception_class = ErrorInResponseException
        if status in ErrorCode.NO_SUCH_ELEMENT:
            exception_class = NoSuchElementException
        elif status in ErrorCode.NO_SUCH_FRAME:
            exception_class = NoSuchFrameException
        elif status in ErrorCode.NO_SUCH_WINDOW:
            exception_class = NoSuchWindowException
        elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
            exception_class = StaleElementReferenceException
        elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
            exception_class = ElementNotVisibleException
        elif status in ErrorCode.INVALID_ELEMENT_STATE:
            exception_class = InvalidElementStateException
        elif status in ErrorCode.INVALID_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
            exception_class = InvalidSelectorException
        elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
            exception_class = ElementNotSelectableException
        elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
            exception_class = ElementNotInteractableException
        elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
            exception_class = InvalidCookieDomainException
        elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
            exception_class = UnableToSetCookieException
        elif status in ErrorCode.TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.SCRIPT_TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.UNKNOWN_ERROR:
            exception_class = WebDriverException
        elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
            exception_class = UnexpectedAlertPresentException
        elif status in ErrorCode.NO_ALERT_OPEN:
            exception_class = NoAlertPresentException
        elif status in ErrorCode.IME_NOT_AVAILABLE:
            exception_class = ImeNotAvailableException
        elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
            exception_class = ImeActivationFailedException
        elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
            exception_class = MoveTargetOutOfBoundsException
        elif status in ErrorCode.JAVASCRIPT_ERROR:
            exception_class = JavascriptException
        elif status in ErrorCode.SESSION_NOT_CREATED:
            exception_class = SessionNotCreatedException
        elif status in ErrorCode.INVALID_ARGUMENT:
            exception_class = InvalidArgumentException
        elif status in ErrorCode.NO_SUCH_COOKIE:
            exception_class = NoSuchCookieException
        elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
            exception_class = ScreenshotException
        elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
            exception_class = ElementClickInterceptedException
        elif status in ErrorCode.INSECURE_CERTIFICATE:
            exception_class = InsecureCertificateException
        elif status in ErrorCode.INVALID_COORDINATES:
            exception_class = InvalidCoordinatesException
        elif status in ErrorCode.INVALID_SESSION_ID:
            exception_class = InvalidSessionIdException
        elif status in ErrorCode.UNKNOWN_METHOD:
            exception_class = UnknownMethodException
        else:
            exception_class = WebDriverException
        if value == '' or value is None:
            value = response['value']
        if isinstance(value, basestring):
            if exception_class == ErrorInResponseException:
                raise exception_class(response, value)
            raise exception_class(value)
        if message == "" and 'message' in value:
            message = value['message']
    
        screen = None
        if 'screen' in value:
            screen = value['screen']
    
        stacktrace = None
        if 'stackTrace' in value and value['stackTrace']:
            stacktrace = []
            try:
                for frame in value['stackTrace']:
                    line = self._value_or_default(frame, 'lineNumber', '')
                    file = self._value_or_default(frame, 'fileName', '<anonymous>')
                    if line:
                        file = "%s:%s" % (file, line)
                    meth = self._value_or_default(frame, 'methodName', '<anonymous>')
                    if 'className' in frame:
                        meth = "%s.%s" % (frame['className'], meth)
                    msg = "    at %s (%s)"
                    msg = msg % (meth, file)
                    stacktrace.append(msg)
            except TypeError:
                pass
        if exception_class == ErrorInResponseException:
            raise exception_class(response, message)
        elif exception_class == UnexpectedAlertPresentException:
            alert_text = None
            if 'data' in value:
                alert_text = value['data'].get('text')
            elif 'alert' in value:
                alert_text = value['alert'].get('text')
            raise exception_class(message, screen, stacktrace, alert_text)
>       raise exception_class(message, screen, stacktrace)
E       selenium.common.exceptions.WebDriverException: Message: Sauce could not start your job. For more information on what happened, please visit https://app.saucelabs.com/tests/83931538a19a45ec8e84a736d5d8d223

/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py:242: WebDriverException