Hi All,


I am trying to automate an interaction with the web page and i am using Win32::IE::Mechanize module as the page involves javascripting. I am able to login to the page and access all the information i need but the problem arises when i try to log off from the page. The button is not associated to any form tag.


Below is the HTML code of the page i am trying to access.
<form action="#" name="colorset"><input type="hidden" id="clr" + name="c" value=""></form> <fieldset class="buttonbartop"> <input class="titlebutton" type="button" name="searchcases" value="S +earch All Cases" onclick="javascript:searchcases();"> <input class="titlebutton" type="button" name="getnew" value="Get N +ew Case" onclick="javascript:searchcase();"> <input class="titlebutton" type="button" name="create" value="Creat +e Case" onclick="javascript:makecase();"> <input class="titlebutton" type="button" name="addressbook" value=" +Address Book" onclick="javascript:addressbook();"> <input class="newfeaturebtn" type="button" name="userhistory" value +="My History" onclick="javascript:showhistory();"> <input class="newfeaturebtn" type="button" name="usersettings" valu +e="Settings" onclick="javascript:showsettings();"> <input class="titlebutton" type="button" name="reportproblem" value +="Report a Problem" onclick="javascript:reportproblem();"> <input class="titlebutton" type="button" name="logoff" value="Log O +ff" onclick="javascript:snag('?logoff');"> </fieldset>



My Perl code is given below:
#!C:/perl/bin/perl.exe use Win32::IE::Mechanize; my $url = 'http://mallet'; my $ie = Win32::IE::Mechanize->new(visible => 1); $ie->get($url); sleep(2); #wait for 2 sec so that the requested page will be displayed +. $ie->click_button(value => 'Log Off');



Though the above code is not returning any error, it's not loggin off. I know i can try WWW::Selenium module but i have written most part of my code using Win32::IE::Mechanize module and i think there might be a way to accomplish this.


Any suggestions would be greatly appreciated!!!


Thanks

In reply to Clicking on a button without a form using Win32::IE::Mechanize by venkatesan_G02

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.