Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7703323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:25:54+00:00 2026-05-31T23:25:54+00:00

I have a unique situation over here. I have a button on a form

  • 0

I have a unique situation over here. I have a button on a form which produces a popup if there are some errors in the form. [I know this is not good practice, but the developers of the product would not be changing that behavior!] The form navigates to a different page if all the required fields are correctly populated. Now, I need to write a script in order to click the “Submit” button on the form which either might produce a popup or navigate to the next page.

I have the used the click_no_wait on the “Submit” button and handled the popup using AutoIt as per Javascript Popups in Watir. Now, if all the information is valid and the form navigates to the next page, I use a delay in the script by following some of the techniques described in How to wait with Watir. I am using a Watir::wait_until() to wait in the script.

Now sometimes because of some network issues, it takes time to go to the next page (report-generation) page when the form is submitted and thus the script fails because of the timeout value specified in the wait_until.

I was wondering whether there is a way to intercept the onload event of the HTML page in Watir, since the onload event isn’t fired until the entire page is loaded. By that way I could have an accurate estimate of the timeout value and not experiment with it. Thus, my script will pass 100% rather than say 98% right now.

Thanks for any help on this topic.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:25:55+00:00Added an answer on May 31, 2026 at 11:25 pm

    You could try setting up a rescue for the time out, then looping a reasonable amount of times (2 or 3?) if it encounters a timeout.

    E.g.

    # All your button clicking and autoit stuff here
    i = 0
    begin
      b.wait_until{ # the thing you're waiting to happen }
      rescue TheSpecificTimeOutException 
      # Sorry I can't remember it, the command prompt will tell you exactly 
      # which one
       if i < 3
         i += 1
         retry
       else
         raise
       end
     end
    

    I’m sure i’ll have messed something up in the above, or there’ll be more concise ways of doing it, but you get the idea. When it times out, give it another few tries before giving up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have quite unique situation. Here is my scenario: 4 thumbnails linking to the
I have a very unique situation. We use a Cisco Web VPN (don't know
I have a unique situation here. Essentially, I have an absolutely positioned block of
I may have a unique situation here. I want gVim (gui version, in Linux)
I have a unique problem/situation here. Trying to make it as simple as possible.
I have a, probably unique situation in which I need to use a single
I have a fairly unique situation, I have never needed to this before anyways.
Here's the situation Over the time I will have a MySQL database with around
I have a unique situation where I'm building a site that will call data
I have a sort of unique situation....I want to populate a ModelChoiceField based of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.