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

  • Home
  • SEARCH
  • 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 8861657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:32:23+00:00 2026-06-14T15:32:23+00:00

I have a web page where after the dom is loaded javascript continues to

  • 0

I have a web page where after the dom is loaded javascript continues to run on the page and adds elements onto the page. After all the javascript is run I fire a jquery event page.loaded so that components on the page that are interested in doing something after all my javascripts are run can do so.

I am trying to automate the testing of this webpage using casperjs/phantomjs and I would like to examine elements on the page only after the jQuery page loaded event is fired. How should I go about doing this?

  • 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-06-14T15:32:24+00:00Added an answer on June 14, 2026 at 3:32 pm

    Look at the waitFor family functions in order to wait for something to happen in the page environment. You can either wait for some element or text to be available in the DOM, or directly add a specific jQuery listener in order to process further steps:

    casper.start('test.html', function() {
        this.evaluate(function() {
            $(document).on('site:loaded', function() {
                window.siteLoaded = true;
            });
        });
    });
    
    casper.waitFor(function() {
        return this.evaluate(function() {
            return window.siteLoaded === true;
        });
    });
    
    casper.then(function() {
        // process further
    });
    

    Note: this is factice pseudo code, purpose is only to picture the concept.

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

Sidebar

Related Questions

I have web page i want that when page is loaded after some time
Hi I have a web page that opens up from another page after the
I have the following piece of code in my web page. After the method
I have web page in PHP which displays all records in a table. I
I have a dynamic web page that after clicking a link, I insert a
I have submission web page, after submission i am sending the data to workflow
I have read this link How can we stop web page view after sign-out
On my web page I have a button that opens a modal jQuery dialog.
I have a web page which reloads some data using a jquery post every
I have a page with js. I need get dom after js execute at

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.