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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:28:11+00:00 2026-05-18T00:28:11+00:00

Good day, I’m new to selenium and I’m trying to write a simple test.

  • 0

Good day,

I’m new to selenium and I’m trying to write a simple test. I want to test my AJAX functionality so I thought that the waitForCondition() method was the right fit for me. Problem is, I get an error every time, saying that ‘testLoop’ is not defined. My test is simple:

@Test
public void firstTest() 
{
    selenium.open(BASE_URL);
    assertTrue(selenium.isElementPresent("css=a#performAjax"));
    selenium.click("link=Add some content!");
    String script = "selenium.browserbot.getCurrentWindow().document.getElementByClassName('ajaxMessage').length > 0";
    selenium.waitForCondition(script, "10000");
    Assert.assertEquals(selenium.getText("css=div.ajaxMessage"), "You got me with AJAX!");
}

But every time I run it, I get the error:

com.thoughtworks.selenium.SeleniumException: ERROR: Command execution failure. Please search the forum at http://clearspace.openqa.org for error details from the log window. The error message is: testLoop is not defined

I’ve searched forums, etc, for an answer to this but I’ve found nothing helpful thus far. Any tips are appreciated.

Other tips regarding better ways to write selenium tests are also welcome, but my main goal is to get around this error 🙂

In case anybody is wondering, yes, I’ve verified that the error is thrown during my call to waitForCondition().

  • 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-18T00:28:12+00:00Added an answer on May 18, 2026 at 12:28 am

    Some more searching did the trick! For anyone else who is wondering…

    A user commenting on this post mentions that the current implementation of the waitForCondition() extension is out of sync with the current version of selenium. The user-extensions.js file must be updated to replace all instances of ‘testLoop’ with ‘TestLoop’.

    If you’ve imported selenium-rc as an external jar into Eclipse like I did, this is a matter of decompressing the jar, editing the js file, and re-compressing it into a jar.

    Update:

    After further research, it seems that waitForElementPresent() is the preferred way to do this, as you can simply specify a locator rather than evaluating a JavaScript expression. There is also waitForTextPresent() and other equivalents.

    These AJAX methods are not present in the .jar files that you get with selenium-rc. They are available in Selenium-IDE, and if you export these tests to Java, you will see that it is simply creating a loop with a default timeout of 60 seconds and checking for isElementPresent().

    If you prefer to work strictly from Java-driven mode, you can probably create some helpers to do this work for you, since unzipping the jar, modifying user extensions, and re-zipping the jar gets rather tedious and annoying.

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

Sidebar

Related Questions

Good day, In SQL Server 2005, when I write a new query, I like
Good day, I'm having a problem with asp.net 2.0 viewstate. Basically, I want to
Good day, I have a question here. I am trying to fetch image from
Good day. I am trying to fetch an asp.net label control's text value using
Good day, We just converted our web application .NET 1.1 to .NET 2.0. We
Good day, In visual studio 2005, when I drop a webcontrol in the designer,
I've spent a good part of the day searching, writing and finally scrapping a
Good morning, I am the developer of a medium sized PDA application that will
Good day folks, I'm in a need of a bit of guidance. Basically, I'm
Good day, I have a parent gridview with a few columns. On each row,

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.