Can't click with selenium on service console option of salesforce

156 views Asked by At

i'm trying to automate Salesforce Service Console, but i'm having some troubles because the multiples iframes.

One thing i really need is to click on the option "Close all primary tabs", but everything i have tried is not working.

The weird thing is that although the click is done nothing happens, if i try to do a click on chrome inspector console using javascript the tabs are closed, also if i click manually the tabs are closed, but if is made this trought selenium/katalon although the click is done nothing happens.

I have discovered that the popup html source is not under an iframe but the render of the popup overlays a iframe which comes from the external page tab.

If i trick the webpage modifying the css with the inspector moving the popup more up, were there is not iframe, then the click is closing the tabs.

Also if i delete the iframe from the html, the click is closing the tabs.

So i understand that this could be the problem, but although i have tried switch to iframe still not working.

i'am using katalon to automate but also happens with selenium .

Can you help me?

Salesforce Service Console

code of the popup list

<div id="ext-comp-1031"
    class="x-menu x-menu-floating x-layer"
    style="position: absolute; z-index: 15000; visibility: visible; left: 1086px; top: 124px;">
    <a class="x-menu-focus"
        href="#"
        onclick="return false;"
        tabindex="-1"
        id="ext-gen173"/>
    <ul class="x-menu-list"
        id="ext-gen174"
        style="height: 158px;">
        <li id="x-menu-el-ext-comp-1106"
            class="x-menu-list-item">
            <a id="ext-comp-1106"
                class="x-menu-item tab-scroller-menu-item "
                hidefocus="true"
                unselectable="on"
                href="#">
                <img alt=""
                    src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="
                    class="x-menu-item-icon hidden"
                    id="ext-gen526">
                    <span class="x-menu-item-text"
                            id="ext-gen527">
                        <div class="tabTitle">
                            <span class="tabText">External Page</span>
                        </div>
                        <img alt=""
                            src="/s.gif"
                            class="refresh-icon"
                            id="ext-gen538">
                            <div class="x-menu-item-icon burl-link third-position"
                                id="ext-gen539"/>
                            <img alt=""
                                src="/s.gif"
                                class="bookmark-icon bookmarkNoPin"
                                id="ext-gen540"></span>
                        </a>
                    </li>
                    <li id="x-menu-el-ext-comp-1107"
                        class="x-menu-list-item">
                        <a id="ext-comp-1107"
                            class="x-menu-item tab-scroller-menu-item x-tab-tabmenu-selected "
                            hidefocus="true"
                            unselectable="on"
                            href="#">
                            <img alt=""
                                src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="
                                class="x-menu-item-icon hidden"
                                id="ext-gen528">
                                <span class="x-menu-item-text"
                                        id="ext-gen529">
                                    <div class="tabTitle">
                                        <span class="tabText">External Page</span>
                                    </div>
                                    <img alt=""
                                        src="/s.gif"
                                        class="refresh-icon"
                                        id="ext-gen541">
                                        <div class="x-menu-item-icon burl-link third-position"
                                            id="ext-gen542"/>
                                        <img alt=""
                                            src="/s.gif"
                                            class="bookmark-icon bookmarkNoPin"
                                            id="ext-gen543"></span>
                                    </a>
                                </li>
                                <li id="x-menu-el-ext-comp-1108"
                                    class="x-menu-list-item">
                                    <a id="ext-comp-1108"
                                        class="x-menu-item x-tab-tabmenu-menuItem"
                                        hidefocus="true"
                                        unselectable="on"
                                        href="#">
                                        <img alt=""
                                            src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="
                                            class="x-menu-item-icon "
                                            id="ext-gen530">
                                            <span class="x-menu-item-text"
                                                    id="ext-gen531">Close all primary tabs</span>
                                        </a>
                                    </li>
                                    <li id="x-menu-el-ext-comp-1109"
                                        class="x-menu-list-item">
                                        <a id="ext-comp-1109"
                                            class="x-menu-item x-tab-tabmenu-menuItem"
                                            hidefocus="true"
                                            unselectable="on"
                                            href="#">
                                            <img alt=""
                                                src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="
                                                class="x-menu-item-icon "
                                                id="ext-gen532">
                                                <span class="x-menu-item-text"
                                                        id="ext-gen533">Refresh all primary tabs</span>
                                            </a>
                                        </li>
                                        <li id="x-menu-el-ext-comp-1110"
                                            class="x-menu-list-item">
                                            <a id="ext-comp-1110"
                                                class="x-menu-item x-tab-tabmenu-menuItem"
                                                hidefocus="true"
                                                unselectable="on"
                                                href="#">
                                                <img alt=""
                                                    src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="
                                                    class="x-menu-item-icon "
                                                    id="ext-gen534">
                                                    <span class="x-menu-item-text"
                                                            id="ext-gen535">Reopen last-closed tab</span>
                                                </a>
                                            </li>
                                            <li id="x-menu-el-ext-comp-1111"
                                                class="x-menu-list-item">
                                                <a id="ext-comp-1111"
                                                    class="x-menu-item x-tab-tabmenu-menuItem"
                                                    hidefocus="true"
                                                    unselectable="on"
                                                    href="#">
                                                    <img alt=""
                                                        src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="
                                                        class="x-menu-item-icon "
                                                        id="ext-gen536">
                                                        <span class="x-menu-item-text"
                                                                id="ext-gen537">Show keyboard shortcuts (SHIFT+K)</span>
                                                    </a>
                                                </li>
                                            </ul>
                                        </div>

xpath i'am selecting

//*/text()[normalize-space(.)='Close all primary tabs']/parent::*
0

There are 0 answers