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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:34:04+00:00 2026-06-06T09:34:04+00:00

I am using QUnit and JQuery and want to test user interface of my

  • 0

I am using QUnit and JQuery and want to test user interface of my website. My webapp resides in an iframe. I want to click on a navigation-Link, then wait until the new page is loaded and then I want to select a few items via JQuery to make sure that the correct page was loaded.

How to achieve this?

I read about setTimeout(), delay(), ajaxSetup(), setInterval(), up to now: no success.

Here is a code snippet:

// Klick auf Unternehmen und vergleiche h1-Ueberschrift.
        test("Klick Unternehmen, checke Ueberschrift", function() {
            var mes = "test: Klick Unternehmen, checke Ueberschrift;";
            var exp = "Unternehmen";
            jQuery.ajaxSetup({ async: false }); //turn off async so tests will wait for ajax results
            jQuery('#testframe').attr('src', './../index/unternehmen/').delay(3000);
            var t = setTimeout('doNothing()', 2000);
            //alert('now');
            var act = jQuery('h1').eq(1);
            //var act = "Unternehmen";
            //console.log(mes);
            equal(act, exp, mes);
        });

UPDATE: I was able to call the ressource by ajax. Anyway still no idea how to call click() – wait() – compare().

// Klick auf Unternehmen und vergleiche h1-Ueberschrift, Ajax S. 250
        test("Klick Unternehmen, checke Ueberschrift", function() {
            jQuery.ajax({
                url: "./../index/unternehmen/",
                async: false,
                success: function(response){
                    if (response){
                        jQuery('#ajaxcontent').html(response);
                    }
                },
                context: document.body,
                type: "POST"
            });
            var mes = "test: Klick Unternehmen, checke Ueberschrift;";
            var exp = "Unternehmen";
            var act = jQuery('#ajaxcontent h1').eq(0).text();
            equal(act, exp, mes);
        });
  • 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-06T09:34:05+00:00Added an answer on June 6, 2026 at 9:34 am

    You should try

    $("#yourIframeID").load(function(){
        //do your testing stuff here..
    
    })
    

    There’s also a way for async testing in QUnit, but I’m nor sure it applies to your case (asyncTest( name, expected, test ))

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

Sidebar

Related Questions

I am using qunit and jquery. Latest version of both. In my code when
I'm starting to write some unit test for my javascript code using qunit and
I have started using Qunit to test my JS code. I am looking into
Can I test live websites using QUnit? For example, can I write a test
I am using QUnit to perform various simple tests on my website. One of
I've been using QUnit to test some javascript in my Visual Studio 11 solution
We are starting to using Test Driven Development on a project. We use jQuery,
As part of my unit tests (using QUnit) for a backbone project, I test
I'm trying to run unit tests written in QUnit using jsTestDriver. I'm getting ReferenceError:
Using a populated Table Type as the source for a TSQL-Merge. I want to

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.