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

test_delete_rbd_pool_attached_to_sc_UI[3-aggressive-Immediate-Bound] failing with selenium.common.exceptions.TimeoutException: Message: Failed to find the element #9791

Open
sidhant-agrawal opened this issue May 10, 2024 · 0 comments
Assignees
Labels
Medium Priority Fix this after High Priority tickets are fixed. Squad/Green ui_automation

Comments

@sidhant-agrawal
Copy link
Contributor

test_delete_rbd_pool_attached_to_sc_UI[3-aggressive-Immediate-Bound] is failing in 4.16 runs with below error:

selenium.common.exceptions.TimeoutException: Message: Failed to find the element (xpath,//td[@id='name']//a[contains(text(), 'cbp-test-a2cbf74c891a4808aebb2ba54dd5346')]/../../..//button[@aria-label='Actions'])

Stack Trace:

_locator = ("//td[@id='name']//a[contains(text(), 'cbp-test-a2cbf74c891a4808aebb2ba54dd5346')]/../../..//button[@aria-label='Actions']", 'xpath')
_timeout = 30, _enable_screenshot = True, _copy_dom = False

    def _do_click(_locator, _timeout=30, _enable_screenshot=False, _copy_dom=False):
        # wait for page fully loaded only if an element was not located
        # prevents needless waiting and frequent crushes on ODF Overview page,
        # when metrics and alerts frequently updated
        if not self.get_elements(_locator):
            self.page_has_loaded()
        screenshot = (
            ocsci_config.UI_SELENIUM.get("screenshot") and enable_screenshot
        )
        if screenshot:
            self.take_screenshot()
        if _copy_dom:
            self.copy_dom()
    
        wait = WebDriverWait(self.driver, timeout)
        try:
            if (
                version.get_semantic_version(get_ocp_version(), True)
                <= version.VERSION_4_11
            ):
                element = wait.until(
                    ec.element_to_be_clickable((locator[1], locator[0]))
                )
            else:
>               element = wait.until(
                    ec.visibility_of_element_located((locator[1], locator[0]))
                )

ocs_ci/ocs/ui/base_ui.py:202: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.support.wait.WebDriverWait (session="029b76164d3195d3d08207390a277211")>
method = <selenium.webdriver.support.expected_conditions.visibility_of_element_located object at 0x7fe84d06ad90>
message = ''

    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:

venv/lib64/python3.9/site-packages/selenium/webdriver/support/wait.py:80: TimeoutException

During handling of the above exception, another exception occurred:

self = <tests.functional.storageclass.test_delete_rbd_pool_attached_to_sc.TestDeleteRbdPool object at 0x7fe84d8bd100>
replica = 3, compression = 'aggressive', volume_binding_mode = 'Immediate'
pvc_status = 'Bound'
storageclass_factory_class = <function storageclass_factory_fixture.<locals>.factory at 0x7fe84dffe0d0>
pvc_factory = <function pvc_factory_fixture.<locals>.factory at 0x7fe83633cdc0>
pod_factory = <function pod_factory_fixture.<locals>.factory at 0x7fe83633c8b0>
setup_ui = <selenium.webdriver.chrome.webdriver.WebDriver (session="029b76164d3195d3d08207390a277211")>

    @tier1
    @skipif_external_mode
    @pytest.mark.parametrize(
        argnames=["replica", "compression", "volume_binding_mode", "pvc_status"],
        argvalues=[
            pytest.param(
                *[
                    3,
                    "aggressive",
                    constants.IMMEDIATE_VOLUMEBINDINGMODE,
                    constants.STATUS_BOUND,
                ],
                marks=pytest.mark.polarion_id("OCS-5151"),
            )
        ],
    )
    def test_delete_rbd_pool_attached_to_sc_UI(
        self,
        replica,
        compression,
        volume_binding_mode,
        pvc_status,
        storageclass_factory_class,
        pvc_factory,
        pod_factory,
        setup_ui,
    ):
        cbp_name = preconditions_rbd_pool_created_associated_to_sc(
            compression,
            pod_factory,
            pvc_factory,
            pvc_status,
            replica,
            storageclass_factory_class,
            volume_binding_mode,
        )
        blocking_pool_tab = (
            PageNavigator()
            .nav_odf_default_page()
            .nav_storage_systems_tab()
            .nav_storagecluster_storagesystem_details()
            .nav_ceph_blockpool()
        )
>       assert not blocking_pool_tab.delete_block_pool(
            cbp_name, cannot_be_deleted=True
        ), "blocking pool attached by storage class was deleted, no Warning message was shown"

tests/functional/storageclass/test_delete_rbd_pool_attached_to_sc.py:228: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
ocs_ci/ocs/ui/page_objects/block_pools.py:87: in delete_block_pool
    self.do_click(resource_actions, enable_screenshot=True)
ocs_ci/ocs/ui/base_ui.py:215: in do_click
    _do_click(locator, timeout, enable_screenshot, copy_dom)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

_locator = ("//td[@id='name']//a[contains(text(), 'cbp-test-a2cbf74c891a4808aebb2ba54dd5346')]/../../..//button[@aria-label='Actions']", 'xpath')
_timeout = 30, _enable_screenshot = True, _copy_dom = False

    def _do_click(_locator, _timeout=30, _enable_screenshot=False, _copy_dom=False):
        # wait for page fully loaded only if an element was not located
        # prevents needless waiting and frequent crushes on ODF Overview page,
        # when metrics and alerts frequently updated
        if not self.get_elements(_locator):
            self.page_has_loaded()
        screenshot = (
            ocsci_config.UI_SELENIUM.get("screenshot") and enable_screenshot
        )
        if screenshot:
            self.take_screenshot()
        if _copy_dom:
            self.copy_dom()
    
        wait = WebDriverWait(self.driver, timeout)
        try:
            if (
                version.get_semantic_version(get_ocp_version(), True)
                <= version.VERSION_4_11
            ):
                element = wait.until(
                    ec.element_to_be_clickable((locator[1], locator[0]))
                )
            else:
                element = wait.until(
                    ec.visibility_of_element_located((locator[1], locator[0]))
                )
            element.click()
        except TimeoutException as e:
            self.take_screenshot()
            self.copy_dom()
            logger.error(e)
>           raise TimeoutException(
                f"Failed to find the element ({locator[1]},{locator[0]})"
            )
E           selenium.common.exceptions.TimeoutException: Message: Failed to find the element (xpath,//td[@id='name']//a[contains(text(), 'cbp-test-a2cbf74c891a4808aebb2ba54dd5346')]/../../..//button[@aria-label='Actions'])

ocs_ci/ocs/ui/base_ui.py:210: TimeoutException
@sidhant-agrawal sidhant-agrawal self-assigned this May 10, 2024
@sidhant-agrawal sidhant-agrawal added Medium Priority Fix this after High Priority tickets are fixed. and removed High Priority High priority issues labels May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Medium Priority Fix this after High Priority tickets are fixed. Squad/Green ui_automation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant