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 7657993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:08:37+00:00 2026-05-31T13:08:37+00:00

I am new to automated web testing and I am currently migrating from an

  • 0

I am new to automated web testing and I am currently migrating from an old Selenium RC implementation to Selenium 2 in Ruby. Is there a way to halt the execution of commands until the page gets loaded, similar to “wait_for_page_to_load” in Selenium RC?

  • 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-31T13:08:37+00:00Added an answer on May 31, 2026 at 1:08 pm

    Try using Javascript to inform you!

    I created a couple methods that checks via our javascript libraries and waits to see if the page has finished loading the DOM and that all ajax requests are complete. Here’s a sample snippet. The javascript you will need to use is just going to depend on your library.

    Selenium::WebDriver::Wait.new(:timeout => 30).until { @driver.execute_script("[use javascript to return true once loaded, false if not]"}
    

    I then wrapped these methods in a clickAndWait method that clicks the element and calls the waitForDomLoad and waitForAjaxComplete. Just for good measure, the very next command after a clickAndWait is usually a waitForVisble element command to ensure that we are on the right page.

    # Click element and wait for page elements, ajax to complete, and then run whatever else
    def clickElementAndWait(type, selector)
        @url = @driver.current_url
        clickElement(type, selector)
        # If the page changed to a different URL, wait for DOM to complete loading
        if @driver.current_url != @url
          waitForDomLoad
        end
        waitForAjaxComplete
        if block_given?
          yield
        end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Use case: Fitnesse is used for automated testing of the web site. SUT (software
We are migrating web servers, and it would be nice to have an automated
I'm currently working on a new web application and it's being developed using Oracle
I am trying to do some automated web testing of my ASP.NET application. I
I have been assigned for automated testing of Web services to achieve the following
I am very new to web automation testing tools. I want to automate my
I am fairly new to ASP.NET. I recently set up automated email from my
I have successfully automated the process of creating a new IIS website, however the
I am attempting to automate moving files from a folder to a new folder
New Question I am looking for a way in Javascript to get the parent

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.