fix: ADDON-65405 multi level menu #882
test-report-9.0.6__chrome_test_splunk_ta_example_addon_input_2 ❌
❌ test-results/test.xml
43 tests were completed in 3544s with 0 passed, 43 failed and 0 skipped.
Test suite | Passed | Failed | Skipped | Time |
---|---|---|---|---|
pytest | 43❌ | 3544s |
❌ pytest
tests.ui.test_splunk_ta_example_addon_input_2.chrome_TestInput
❌ test_example_input_two_required_field_name
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf414e3d90>
❌ test_example_input_two_valid_length_name
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf413500d0>
❌ test_example_input_two_valid_input_name
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41350100>
❌ test_example_input_two_required_field_interval
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41350340>
❌ test_example_input_two_valid_input_interval
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf413502b0>
❌ test_example_input_two_required_field_index
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41350940>
❌ test_example_input_two_default_value_index
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41350bb0>
❌ test_example_input_two_required_field_example_example_account
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41350e80>
❌ test_example_input_two_required_field_example_multiple_select
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41351780>
❌ test_example_input_two_list_example_multiple_select
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41351540>
❌ test_example_input_two_select_select_value_example_multiple_select
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41351810>
❌ test_example_input_two_select_multiple_values_example_multiple_select
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41351ab0>
❌ test_example_input_two_help_text_entity
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41351d20>
❌ test_example_input_two_checked_example_checkbox
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf413526e0>
❌ test_example_input_two_unchecked_example_checkbox
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf413522c0>
❌ test_example_input_two_required_field_example_radio
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41352590>
❌ test_example_input_two_select_value_example_radio
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41352980>
❌ test_example_input_two_valid_input_query_start_date
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41352c80>
❌ test_example_input_two_add_frontend_validation
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf413535b0>
❌ test_example_input_two_add_backend_validation
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41351d80>
❌ test_example_input_two_edit_uneditable_field_name
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41353670>
❌ test_example_input_two_edit_frontend_validation
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41353430>
❌ test_example_input_two_edit_backend_validation
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41353730>
❌ test_example_input_two_clone_default_values
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41353b50>
❌ test_example_input_two_clone_frontend_validation
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf412f4280>
❌ test_example_input_two_clone_backend_validation
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf412f42b0>
❌ test_example_input_two_delete_row_frontend_validation
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf412f4e50>
❌ test_example_input_two_delete_row_backend_validation
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf412f4670>
❌ test_example_input_two_add_close_entity
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf412f49a0>
❌ test_example_input_two_edit_close_entity
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf412f4c40>
❌ test_example_input_two_clone_close_entity
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf412f58a0>
❌ test_example_input_two_delete_close_entity
browser = None
❌ test_example_input_two_add_cancel_entity
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf412f5660>
❌ test_example_input_two_edit_cancel_entity
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41353eb0>
❌ test_example_input_two_clone_cancel_entity
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf412f5780>
❌ test_example_input_two_delete_cancel_entity
browser = None
❌ test_example_input_two_add_duplicate_names
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf412f5d20>
❌ test_example_input_two_clone_duplicate_names
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf412f60b0>
❌ test_example_input_two_add_valid_title
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf412f6ce0>
❌ test_example_input_two_edit_valid_title
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf412f6710>
❌ test_example_input_two_clone_valid_title
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf412f6a70>
❌ test_example_input_two_delete_valid_title
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf412f7550>
❌ test_example_input_two_delete_valid_prompt_message
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf412f6fe0>
Annotations
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.0.6__chrome_test_splunk_ta_example_addon_input_2
pytest ► tests.ui.test_splunk_ta_example_addon_input_2.chrome_TestInput ► test_example_input_two_required_field_name
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf414e3d90>
Raw output
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf414e3d90>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7faf41402080>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7faf41424c10>
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_example_input_two_required_field_name(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""Verifies required field name in Example Input Two"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
> input_page.create_new_input.select("Example Input Two")
tests/ui/test_splunk_ta_example_addon_input_2.py:133:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf41400fa0>
value = 'Example Input Two'
def select(self, value):
"""
Selects the value we want from the type list
:param value: The value in which we want to select
:return: Returns True if successful, otherwise raises an error
"""
> self.add_input.click()
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/dropdown.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf41400fa0>
key = 'add_input'
def __getattr__(self, key):
"""
Makes the web-elements to be accessible directly.
- For example self.elements = {"textbox": Selector(by=..., select=...),
Access the element by doing self.textbox directly.
- It also has implicit wait while finding the element.
:param key: The key of the element mentioned in self.elements
:returns: The webelement we are accessing
"""
try:
> return self.get_element(key)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:222:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf41400fa0>
key = 'add_input'
def get_element(self, key):
"""
Get the web-element.
Note: There is a wait in get_element.
:param key: The key of the element mentioned in self.elements
:returns: element The element we are looking for by key
"""
element = self.elements[key]
> return self._get_element(element.by, element.select)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf41400fa0>
by = 'id', select = 'addInputBtn'
def _get_element(self, by, select):
"""
Find the element from the page.
:param by: The type of the selenium locator
:param select: The selector text of type mentioned in by.
:returns: The webelement we are accessing
"""
msg = "by={} select={} Element not found in the page".format(by, select)
> return self.wait.until(EC.presence_of_element_located((by, select)), msg)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.support.wait.WebDriverWait (session="40994db0f3614205b63e019ffce42d79")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7faf41456cb0>
message = 'by=id select=addInputBtn Element not found in the page'
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except self._ignored_exceptions as exc:
screen = getattr(exc, 'screen', None)
stacktrace = getattr(exc, 'stacktrace', None)
time.sleep(self._poll)
if time.time() > end_time:
break
> raise TimeoutException(message, screen, stacktrace)
E selenium.common.exceptions.TimeoutException: Message: by=id select=addInputBtn Element not found in the page
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:80: TimeoutException
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.0.6__chrome_test_splunk_ta_example_addon_input_2
pytest ► tests.ui.test_splunk_ta_example_addon_input_2.chrome_TestInput ► test_example_input_two_valid_length_name
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf413500d0>
Raw output
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf413500d0>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7faf4115bdc0>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7faf41424c10>
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_example_input_two_valid_length_name(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""Verifies the name field should not be more than 100 characters"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
> input_page.create_new_input.select("Example Input Two")
tests/ui/test_splunk_ta_example_addon_input_2.py:158:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf4115b9a0>
value = 'Example Input Two'
def select(self, value):
"""
Selects the value we want from the type list
:param value: The value in which we want to select
:return: Returns True if successful, otherwise raises an error
"""
> self.add_input.click()
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/dropdown.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf4115b9a0>
key = 'add_input'
def __getattr__(self, key):
"""
Makes the web-elements to be accessible directly.
- For example self.elements = {"textbox": Selector(by=..., select=...),
Access the element by doing self.textbox directly.
- It also has implicit wait while finding the element.
:param key: The key of the element mentioned in self.elements
:returns: The webelement we are accessing
"""
try:
> return self.get_element(key)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:222:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf4115b9a0>
key = 'add_input'
def get_element(self, key):
"""
Get the web-element.
Note: There is a wait in get_element.
:param key: The key of the element mentioned in self.elements
:returns: element The element we are looking for by key
"""
element = self.elements[key]
> return self._get_element(element.by, element.select)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf4115b9a0>
by = 'id', select = 'addInputBtn'
def _get_element(self, by, select):
"""
Find the element from the page.
:param by: The type of the selenium locator
:param select: The selector text of type mentioned in by.
:returns: The webelement we are accessing
"""
msg = "by={} select={} Element not found in the page".format(by, select)
> return self.wait.until(EC.presence_of_element_located((by, select)), msg)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.support.wait.WebDriverWait (session="7fafa53c95294a8f97869eaf993a6a6f")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7faf411654b0>
message = 'by=id select=addInputBtn Element not found in the page'
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except self._ignored_exceptions as exc:
screen = getattr(exc, 'screen', None)
stacktrace = getattr(exc, 'stacktrace', None)
time.sleep(self._poll)
if time.time() > end_time:
break
> raise TimeoutException(message, screen, stacktrace)
E selenium.common.exceptions.TimeoutException: Message: by=id select=addInputBtn Element not found in the page
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:80: TimeoutException
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.0.6__chrome_test_splunk_ta_example_addon_input_2
pytest ► tests.ui.test_splunk_ta_example_addon_input_2.chrome_TestInput ► test_example_input_two_valid_input_name
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41350100>
Raw output
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41350100>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7faf41192f80>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7faf41424c10>
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_example_input_two_valid_input_name(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""Verifies whether adding special characters, name field displays validation error"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
> input_page.create_new_input.select("Example Input Two")
tests/ui/test_splunk_ta_example_addon_input_2.py:176:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf41192fe0>
value = 'Example Input Two'
def select(self, value):
"""
Selects the value we want from the type list
:param value: The value in which we want to select
:return: Returns True if successful, otherwise raises an error
"""
> self.add_input.click()
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/dropdown.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf41192fe0>
key = 'add_input'
def __getattr__(self, key):
"""
Makes the web-elements to be accessible directly.
- For example self.elements = {"textbox": Selector(by=..., select=...),
Access the element by doing self.textbox directly.
- It also has implicit wait while finding the element.
:param key: The key of the element mentioned in self.elements
:returns: The webelement we are accessing
"""
try:
> return self.get_element(key)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:222:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf41192fe0>
key = 'add_input'
def get_element(self, key):
"""
Get the web-element.
Note: There is a wait in get_element.
:param key: The key of the element mentioned in self.elements
:returns: element The element we are looking for by key
"""
element = self.elements[key]
> return self._get_element(element.by, element.select)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf41192fe0>
by = 'id', select = 'addInputBtn'
def _get_element(self, by, select):
"""
Find the element from the page.
:param by: The type of the selenium locator
:param select: The selector text of type mentioned in by.
:returns: The webelement we are accessing
"""
msg = "by={} select={} Element not found in the page".format(by, select)
> return self.wait.until(EC.presence_of_element_located((by, select)), msg)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.support.wait.WebDriverWait (session="e4b08b1eba1143358d55bdcf5d8663a8")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7faf41147940>
message = 'by=id select=addInputBtn Element not found in the page'
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except self._ignored_exceptions as exc:
screen = getattr(exc, 'screen', None)
stacktrace = getattr(exc, 'stacktrace', None)
time.sleep(self._poll)
if time.time() > end_time:
break
> raise TimeoutException(message, screen, stacktrace)
E selenium.common.exceptions.TimeoutException: Message: by=id select=addInputBtn Element not found in the page
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:80: TimeoutException
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.0.6__chrome_test_splunk_ta_example_addon_input_2
pytest ► tests.ui.test_splunk_ta_example_addon_input_2.chrome_TestInput ► test_example_input_two_required_field_interval
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41350340>
Raw output
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41350340>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7faf411daa40>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7faf41424c10>
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_example_input_two_required_field_interval(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""Verifies required field interval in Example Input Two"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
> input_page.create_new_input.select("Example Input Two")
tests/ui/test_splunk_ta_example_addon_input_2.py:193:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf411d87f0>
value = 'Example Input Two'
def select(self, value):
"""
Selects the value we want from the type list
:param value: The value in which we want to select
:return: Returns True if successful, otherwise raises an error
"""
> self.add_input.click()
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/dropdown.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf411d87f0>
key = 'add_input'
def __getattr__(self, key):
"""
Makes the web-elements to be accessible directly.
- For example self.elements = {"textbox": Selector(by=..., select=...),
Access the element by doing self.textbox directly.
- It also has implicit wait while finding the element.
:param key: The key of the element mentioned in self.elements
:returns: The webelement we are accessing
"""
try:
> return self.get_element(key)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:222:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf411d87f0>
key = 'add_input'
def get_element(self, key):
"""
Get the web-element.
Note: There is a wait in get_element.
:param key: The key of the element mentioned in self.elements
:returns: element The element we are looking for by key
"""
element = self.elements[key]
> return self._get_element(element.by, element.select)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf411d87f0>
by = 'id', select = 'addInputBtn'
def _get_element(self, by, select):
"""
Find the element from the page.
:param by: The type of the selenium locator
:param select: The selector text of type mentioned in by.
:returns: The webelement we are accessing
"""
msg = "by={} select={} Element not found in the page".format(by, select)
> return self.wait.until(EC.presence_of_element_located((by, select)), msg)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.support.wait.WebDriverWait (session="14d9add363644824975ce80881e4f7c7")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7faf412195d0>
message = 'by=id select=addInputBtn Element not found in the page'
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except self._ignored_exceptions as exc:
screen = getattr(exc, 'screen', None)
stacktrace = getattr(exc, 'stacktrace', None)
time.sleep(self._poll)
if time.time() > end_time:
break
> raise TimeoutException(message, screen, stacktrace)
E selenium.common.exceptions.TimeoutException: Message: by=id select=addInputBtn Element not found in the page
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:80: TimeoutException
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.0.6__chrome_test_splunk_ta_example_addon_input_2
pytest ► tests.ui.test_splunk_ta_example_addon_input_2.chrome_TestInput ► test_example_input_two_valid_input_interval
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf413502b0>
Raw output
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf413502b0>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7faf41146c50>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7faf41424c10>
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_example_input_two_valid_input_interval(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""Verifies whether adding non numeric values, intreval field displays validation error"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
> input_page.create_new_input.select("Example Input Two")
tests/ui/test_splunk_ta_example_addon_input_2.py:216:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf41144d30>
value = 'Example Input Two'
def select(self, value):
"""
Selects the value we want from the type list
:param value: The value in which we want to select
:return: Returns True if successful, otherwise raises an error
"""
> self.add_input.click()
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/dropdown.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf41144d30>
key = 'add_input'
def __getattr__(self, key):
"""
Makes the web-elements to be accessible directly.
- For example self.elements = {"textbox": Selector(by=..., select=...),
Access the element by doing self.textbox directly.
- It also has implicit wait while finding the element.
:param key: The key of the element mentioned in self.elements
:returns: The webelement we are accessing
"""
try:
> return self.get_element(key)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:222:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf41144d30>
key = 'add_input'
def get_element(self, key):
"""
Get the web-element.
Note: There is a wait in get_element.
:param key: The key of the element mentioned in self.elements
:returns: element The element we are looking for by key
"""
element = self.elements[key]
> return self._get_element(element.by, element.select)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf41144d30>
by = 'id', select = 'addInputBtn'
def _get_element(self, by, select):
"""
Find the element from the page.
:param by: The type of the selenium locator
:param select: The selector text of type mentioned in by.
:returns: The webelement we are accessing
"""
msg = "by={} select={} Element not found in the page".format(by, select)
> return self.wait.until(EC.presence_of_element_located((by, select)), msg)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.support.wait.WebDriverWait (session="9ee4c5b7a109448cbfa85b73c6833170")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7faf412189d0>
message = 'by=id select=addInputBtn Element not found in the page'
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except self._ignored_exceptions as exc:
screen = getattr(exc, 'screen', None)
stacktrace = getattr(exc, 'stacktrace', None)
time.sleep(self._poll)
if time.time() > end_time:
break
> raise TimeoutException(message, screen, stacktrace)
E selenium.common.exceptions.TimeoutException: Message: by=id select=addInputBtn Element not found in the page
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:80: TimeoutException
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.0.6__chrome_test_splunk_ta_example_addon_input_2
pytest ► tests.ui.test_splunk_ta_example_addon_input_2.chrome_TestInput ► test_example_input_two_required_field_index
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41350940>
Raw output
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41350940>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7faf411926e0>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7faf41424c10>
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_example_input_two_required_field_index(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""Verifies required field index in Example Input Two"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
> input_page.create_new_input.select("Example Input Two")
tests/ui/test_splunk_ta_example_addon_input_2.py:234:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf41193250>
value = 'Example Input Two'
def select(self, value):
"""
Selects the value we want from the type list
:param value: The value in which we want to select
:return: Returns True if successful, otherwise raises an error
"""
> self.add_input.click()
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/dropdown.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.webelement.WebElement (session="ff0a30a6dd224b61bf26ac7c9e54b583", element="4B8100DE5686BA2A6CC5F29CDEF01D81_element_39")>
def click(self):
"""Clicks the element."""
> self._execute(Command.CLICK_ELEMENT)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webelement.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.webelement.WebElement (session="ff0a30a6dd224b61bf26ac7c9e54b583", element="4B8100DE5686BA2A6CC5F29CDEF01D81_element_39")>
command = 'clickElement'
params = {'id': '4B8100DE5686BA2A6CC5F29CDEF01D81_element_39', 'sessionId': 'ff0a30a6dd224b61bf26ac7c9e54b583'}
def _execute(self, command, params=None):
"""Executes a command against the underlying HTML element.
Args:
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 not params:
params = {}
params['id'] = self._id
> return self._parent.execute(command, params)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webelement.py:633:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.webdriver.WebDriver (session="ff0a30a6dd224b61bf26ac7c9e54b583")>
driver_command = 'clickElement'
params = {'id': '4B8100DE5686BA2A6CC5F29CDEF01D81_element_39'}
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 0x7faf41192fe0>
response = {'status': 404, 'value': '{"value":{"error":"stale element reference","message":"stale element reference: stale elemen...\n\\tRtlGetAppContainerNamedObjectPath [0x77A47A4E+286]\\n\\tRtlGetAppContainerNamedObjectPath [0x77A47A1E+238]\\n"}}'}
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.StaleElementReferenceException: Message: stale element reference: stale element not found
E (Session info: chrome=118.0.5993.71)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py:242: StaleElementReferenceException
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.0.6__chrome_test_splunk_ta_example_addon_input_2
pytest ► tests.ui.test_splunk_ta_example_addon_input_2.chrome_TestInput ► test_example_input_two_default_value_index
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41350bb0>
Raw output
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41350bb0>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7faf411b2bf0>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7faf41424c10>
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_example_input_two_default_value_index(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""Verifies default value of field index in Example Input Two"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
default_index = "default"
> input_page.create_new_input.select("Example Input Two")
tests/ui/test_splunk_ta_example_addon_input_2.py:259:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf411b0520>
value = 'Example Input Two'
def select(self, value):
"""
Selects the value we want from the type list
:param value: The value in which we want to select
:return: Returns True if successful, otherwise raises an error
"""
> self.add_input.click()
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/dropdown.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.webelement.WebElement (session="62f923b785f548e79454d567f832a719", element="7DA7BA088B7847F871FBA9268A452883_element_40")>
def click(self):
"""Clicks the element."""
> self._execute(Command.CLICK_ELEMENT)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webelement.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.webelement.WebElement (session="62f923b785f548e79454d567f832a719", element="7DA7BA088B7847F871FBA9268A452883_element_40")>
command = 'clickElement'
params = {'id': '7DA7BA088B7847F871FBA9268A452883_element_40', 'sessionId': '62f923b785f548e79454d567f832a719'}
def _execute(self, command, params=None):
"""Executes a command against the underlying HTML element.
Args:
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 not params:
params = {}
params['id'] = self._id
> return self._parent.execute(command, params)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webelement.py:633:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.webdriver.WebDriver (session="62f923b785f548e79454d567f832a719")>
driver_command = 'clickElement'
params = {'id': '7DA7BA088B7847F871FBA9268A452883_element_40'}
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 0x7faf411b3010>
response = {'status': 404, 'value': '{"value":{"error":"stale element reference","message":"stale element reference: stale elemen...\n\\tRtlGetAppContainerNamedObjectPath [0x77A17A4E+286]\\n\\tRtlGetAppContainerNamedObjectPath [0x77A17A1E+238]\\n"}}'}
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.StaleElementReferenceException: Message: stale element reference: stale element not found
E (Session info: chrome=118.0.5993.71)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py:242: StaleElementReferenceException
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.0.6__chrome_test_splunk_ta_example_addon_input_2
pytest ► tests.ui.test_splunk_ta_example_addon_input_2.chrome_TestInput ► test_example_input_two_required_field_example_example_account
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41350e80>
Raw output
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41350e80>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7faf40ff9570>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7faf41424c10>
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_example_input_two_required_field_example_example_account(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""Verifies required field Account in Example Input Two"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
> input_page.create_new_input.select("Example Input Two")
tests/ui/test_splunk_ta_example_addon_input_2.py:271:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf40ffa5c0>
value = 'Example Input Two'
def select(self, value):
"""
Selects the value we want from the type list
:param value: The value in which we want to select
:return: Returns True if successful, otherwise raises an error
"""
> self.add_input.click()
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/dropdown.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.webelement.WebElement (session="ae1b8c7b31184308aad54a9b55af03ff", element="390C5DEDAEDC6344B7BF0040498A0C03_element_37")>
def click(self):
"""Clicks the element."""
> self._execute(Command.CLICK_ELEMENT)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webelement.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.webelement.WebElement (session="ae1b8c7b31184308aad54a9b55af03ff", element="390C5DEDAEDC6344B7BF0040498A0C03_element_37")>
command = 'clickElement'
params = {'id': '390C5DEDAEDC6344B7BF0040498A0C03_element_37', 'sessionId': 'ae1b8c7b31184308aad54a9b55af03ff'}
def _execute(self, command, params=None):
"""Executes a command against the underlying HTML element.
Args:
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 not params:
params = {}
params['id'] = self._id
> return self._parent.execute(command, params)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webelement.py:633:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.webdriver.WebDriver (session="ae1b8c7b31184308aad54a9b55af03ff")>
driver_command = 'clickElement'
params = {'id': '390C5DEDAEDC6344B7BF0040498A0C03_element_37'}
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 0x7faf40ff96f0>
response = {'status': 404, 'value': '{"value":{"error":"stale element reference","message":"stale element reference: stale elemen...\n\\tRtlGetAppContainerNamedObjectPath [0x773A7A4E+286]\\n\\tRtlGetAppContainerNamedObjectPath [0x773A7A1E+238]\\n"}}'}
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.StaleElementReferenceException: Message: stale element reference: stale element not found
E (Session info: chrome=118.0.5993.71)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py:242: StaleElementReferenceException
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.0.6__chrome_test_splunk_ta_example_addon_input_2
pytest ► tests.ui.test_splunk_ta_example_addon_input_2.chrome_TestInput ► test_example_input_two_required_field_example_multiple_select
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41351780>
Raw output
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41351780>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7faf41190700>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7faf41424c10>
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_example_input_two_required_field_example_multiple_select(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""Verifies required field Example Multiple Select in Example Input Two"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
> input_page.create_new_input.select("Example Input Two")
tests/ui/test_splunk_ta_example_addon_input_2.py:294:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf4114a620>
value = 'Example Input Two'
def select(self, value):
"""
Selects the value we want from the type list
:param value: The value in which we want to select
:return: Returns True if successful, otherwise raises an error
"""
> self.add_input.click()
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/dropdown.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.webelement.WebElement (session="06d873f96049498cb8083af8b868ebc3", element="80B0BA8487373E5F27FD1BF52590DC07_element_40")>
def click(self):
"""Clicks the element."""
> self._execute(Command.CLICK_ELEMENT)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webelement.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.webelement.WebElement (session="06d873f96049498cb8083af8b868ebc3", element="80B0BA8487373E5F27FD1BF52590DC07_element_40")>
command = 'clickElement'
params = {'id': '80B0BA8487373E5F27FD1BF52590DC07_element_40', 'sessionId': '06d873f96049498cb8083af8b868ebc3'}
def _execute(self, command, params=None):
"""Executes a command against the underlying HTML element.
Args:
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 not params:
params = {}
params['id'] = self._id
> return self._parent.execute(command, params)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webelement.py:633:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.webdriver.WebDriver (session="06d873f96049498cb8083af8b868ebc3")>
driver_command = 'clickElement'
params = {'id': '80B0BA8487373E5F27FD1BF52590DC07_element_40'}
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 0x7faf41149d80>
response = {'status': 404, 'value': '{"value":{"error":"stale element reference","message":"stale element reference: stale elemen...\n\\tRtlGetAppContainerNamedObjectPath [0x77E67A4E+286]\\n\\tRtlGetAppContainerNamedObjectPath [0x77E67A1E+238]\\n"}}'}
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.StaleElementReferenceException: Message: stale element reference: stale element not found
E (Session info: chrome=118.0.5993.71)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py:242: StaleElementReferenceException
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.0.6__chrome_test_splunk_ta_example_addon_input_2
pytest ► tests.ui.test_splunk_ta_example_addon_input_2.chrome_TestInput ► test_example_input_two_list_example_multiple_select
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41351540>
Raw output
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41351540>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7faf410f5d20>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7faf41424c10>
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_example_input_two_list_example_multiple_select(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""Verifies values of Multiple Select Test dropdown in Example Input Two"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
> input_page.create_new_input.select("Example Input Two")
tests/ui/test_splunk_ta_example_addon_input_2.py:317:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf410f6a70>
value = 'Example Input Two'
def select(self, value):
"""
Selects the value we want from the type list
:param value: The value in which we want to select
:return: Returns True if successful, otherwise raises an error
"""
> self.add_input.click()
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/dropdown.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf410f6a70>
key = 'add_input'
def __getattr__(self, key):
"""
Makes the web-elements to be accessible directly.
- For example self.elements = {"textbox": Selector(by=..., select=...),
Access the element by doing self.textbox directly.
- It also has implicit wait while finding the element.
:param key: The key of the element mentioned in self.elements
:returns: The webelement we are accessing
"""
try:
> return self.get_element(key)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:222:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf410f6a70>
key = 'add_input'
def get_element(self, key):
"""
Get the web-element.
Note: There is a wait in get_element.
:param key: The key of the element mentioned in self.elements
:returns: element The element we are looking for by key
"""
element = self.elements[key]
> return self._get_element(element.by, element.select)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf410f6a70>
by = 'id', select = 'addInputBtn'
def _get_element(self, by, select):
"""
Find the element from the page.
:param by: The type of the selenium locator
:param select: The selector text of type mentioned in by.
:returns: The webelement we are accessing
"""
msg = "by={} select={} Element not found in the page".format(by, select)
> return self.wait.until(EC.presence_of_element_located((by, select)), msg)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.support.wait.WebDriverWait (session="0d7babbd6efc46918e6203d5556fe5d7")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7faf411599f0>
message = 'by=id select=addInputBtn Element not found in the page'
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except self._ignored_exceptions as exc:
screen = getattr(exc, 'screen', None)
stacktrace = getattr(exc, 'stacktrace', None)
time.sleep(self._poll)
if time.time() > end_time:
break
> raise TimeoutException(message, screen, stacktrace)
E selenium.common.exceptions.TimeoutException: Message: by=id select=addInputBtn Element not found in the page
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:80: TimeoutException
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.0.6__chrome_test_splunk_ta_example_addon_input_2
pytest ► tests.ui.test_splunk_ta_example_addon_input_2.chrome_TestInput ► test_example_input_two_select_select_value_example_multiple_select
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41351810>
Raw output
self = <ui.test_splunk_ta_example_addon_input_2.TestInput object at 0x7faf41351810>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7faf410906a0>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7faf41424c10>
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_example_input_two_select_select_value_example_multiple_select(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""Verifies selected single value of Multiple Select Test dropdown in Example Input Two"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
selected_value = ["Option One"]
> input_page.create_new_input.select("Example Input Two")
tests/ui/test_splunk_ta_example_addon_input_2.py:334:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf410914b0>
value = 'Example Input Two'
def select(self, value):
"""
Selects the value we want from the type list
:param value: The value in which we want to select
:return: Returns True if successful, otherwise raises an error
"""
> self.add_input.click()
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/dropdown.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf410914b0>
key = 'add_input'
def __getattr__(self, key):
"""
Makes the web-elements to be accessible directly.
- For example self.elements = {"textbox": Selector(by=..., select=...),
Access the element by doing self.textbox directly.
- It also has implicit wait while finding the element.
:param key: The key of the element mentioned in self.elements
:returns: The webelement we are accessing
"""
try:
> return self.get_element(key)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:222:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf410914b0>
key = 'add_input'
def get_element(self, key):
"""
Get the web-element.
Note: There is a wait in get_element.
:param key: The key of the element mentioned in self.elements
:returns: element The element we are looking for by key
"""
element = self.elements[key]
> return self._get_element(element.by, element.select)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7faf410914b0>
by = 'id', select = 'addInputBtn'
def _get_element(self, by, select):
"""
Find the element from the page.
:param by: The type of the selenium locator
:param select: The selector text of type mentioned in by.
:returns: The webelement we are accessing
"""
msg = "by={} select={} Element not found in the page".format(by, select)
> return self.wait.until(EC.presence_of_element_located((by, select)), msg)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.support.wait.WebDriverWait (session="97c45ec31e604fba8e28ae5914865623")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7faf41457c10>
message = 'by=id select=addInputBtn Element not found in the page'
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except self._ignored_exceptions as exc:
screen = getattr(exc, 'screen', None)
stacktrace = getattr(exc, 'stacktrace', None)
time.sleep(self._poll)
if time.time() > end_time:
break
> raise TimeoutException(message, screen, stacktrace)
E selenium.common.exceptions.TimeoutException: Message: by=id select=addInputBtn Element not found in the page
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:80: TimeoutException