Thanks Corion. Validating the field values outside the form is not an issue. As I mentioned earlier, right now I am doing the form submission skipping the javascript validation. But the webpage under test which I am trying to automate, sometimes give invalid alert messages based on the values in certain fields. These messages are generated by the javascript. So if I ignore the javascript validation in the webpage, form will be submitted successfully but the error with the javascript goes unnoticed.

For example, if I submit the form manually by selecting the 'OK' button, the webpage gives an alert message which says "Please complete the red entry" even when there are no empty fields. And then webpage submission does not get initiated. This is the main reason for which I cannot ignore the alert boxes in the webpage.

Now I believe that I made my point clear to you. If it does, that justifies this lengthy reply. Please help me to sort out this issue.


In reply to Re^2: (OT) How to override the javascript alert when submitting a form using WWW::Mechanize::Firefox by ajose
in thread (OT) How to override the javascript alert when submitting a form using WWW::Mechanize::Firefox by ajose

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.