0

How might I execute the javascript submenu triggered by this button, "x-auto-54"?

    <table id="x-auto-54" 
        class=" x-btn avtar-x-btn x-component x-btn-noicon x-unselectable " 
        cellspacing="0" role="presentation" unselectable="on">

The ultimate goal, is then to click this submenu link, \\a[@id="x-auto-89"]:

<div id="x-auto-55" class=" x-ignore x-menu x-component " style="z-index: 1053; width: 118px; display: block; position: absolute; left: 1095px; top: 18px;" tabindex="0" hidefocus="true" aria-labelledby="x-auto-54">
            <div class=" x-menu-list" style="height: 96px;">
                <div id="x-menu-el-x-auto-89" class="x-menu-list-item ">
                    <a id="x-auto-89" class=" x-menu-item x-component" href="#"></a>
                </div>
                <div id="x-menu-el-x-auto-90" class="x-menu-list-item "></div>
                <div id="x-menu-el-x-auto-91" class="x-menu-list-item "></div>
                <div id="x-menu-el-x-auto-92" class="x-menu-list-item "></div>
            </div>
        </div>
    </body>

</html

I found these buttons using the Selenium IDE (after clicking them while recording). The entire source is otherwise very very large (I will post upon request if necessary).

My strategy has been to access each hierarchal tag one at a time, so as to catch where the WebElements are no longer able to be found (in this case the submenu isn't opening so x-auto-89 isn't found):

a54 = driver.find_element_by_id('x-auto-54')
hover = ActionChains(driver).move_to_element(a54).click()
hover.perform()
driver.find_element_by_id('x-auto-89').click()

this clicking code was referenced according to these solutions: 1, 2,

1 Answer 1

1

First thing these id looks to be auto generated. Are these ids (x-auto-54 or x-auto-89) same all the time or each refresh of page is changing them?

I will suggest use class in place of ID.

When you run the code do you see the click happen on button x-auto-54 and submenu appear?

How long it takes to submenu appear? Try using waitForElement instead of find element.

Sign up to request clarification or add additional context in comments.

1 Comment

you're right, while x-auto-54 stays the same x-auto-89 definitely changes. Also, no, the submenu does not appear, ever. I think this is why I am unable to click the second button, I'm not triggering the javascript?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.