Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I think I've reached the end of my quest here. This is not the usual 'freeze after click' problem searching keeps finding for me.

I'm working on scripting automated interfaces to HP iLO logins using WWW::Mechanize::Firefox. For the most part, things are falling into place as expected. Navigating login, getting to information tabs, pulling information out of the html. But I'm having one unexplainable problem with the logout button. I have different versions of iLO to interface with - 2, 3 and 4. The web layout and design for 3 and 4 are very similar. They both have the same page layout, included javascript, and design. The logout button design in particular is identical for both, except for one small detail. Version 3 uses an onclick event, while Version 3 uses an onmouseup event

(version 3) <a id="home_link" rel="localize[masthd.home]" onclick="iLO.openLink("s +ummary.html");this.blur();return false;" href="summary.html">Home</a> | <button id="logout_button" rel="localize[masthd.signout]" onclick="iLO +.doLogout();">Sign Out</button>
(version 4) <a id="home_link" rel="localize[masthd.home]" onclick="iLO.openLink("s +ummary.html");this.blur();return false;" href="summary.html">Home</a> | <button id="logout_button" rel="localize[masthd.signout]" onmouseup="i +LO.doLogout();">Sign Out</button>

For iLO version 3 I can activate the logout button as expected with:

$mech->click_button(id => 'logout_button');

But that same action on iLO version 4 does nothing. Seems nothing I do will activate the button. I've tried $mech->click with the appropriate xpath keys, I've tried using $mech->by_id to get the node, followed by $node->click. I've also tried $mech->follow_link( tag => 'button', id => 'logout_button' );

If I try $mech->eval('iLO.doLogout();'), I get:

(in cleanup) MozRepl::RemoteObject: ReferenceError: iLO is not defined + at ...

I can find and retrieve the logout button node and manipulate it without errors, but it just doesn't do anything. I guess I should expect that being that it has no onclick handler. If I check the page for $mech->clickables, it clearly shows both 'Home' and 'Sign Out' for version 3, but only 'Home' for version 4.

What can I do to trigger this event? Is there any way to send an onmouseup event with WWW::Mechanize::Firefox? Maybe some hoops I can jump through to execute the javascript doLogout() function directly?


In reply to WWW::Mechanize::Firefox button click problem HP iLO by ruzam

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 21:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found