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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:19:52+00:00 2026-05-12T05:19:52+00:00

I have two dropdown lists, one containing a list of countries and one for

  • 0

I have two dropdown lists, one containing a list of countries and one for states/regions that is not populated until one of the countries is selected. Both of these dropdowns are wrapped in an updatepanel. When I select the USA, the state dropdown list is filled with the 50 states and I am able to move forward from there.

We are using Selenium to run tests on this code, and the tests always break when it reaches the state dropdown. It either takes too long to generate the state list, or perhaps it just can’t find the values since they are not in the initial html that is rendered. I’ve seen some things about a javascript “WaitForCondition” field, but can’t find any details about how to use this in the selenium documentation. I’m not a javascript slouch, but am not the greatest with it either. Can anyone explain to me how you might go about solving my dilemma, and if it happens to require knowledge of how the WaitForCondition field, can you explain to me how I can get that to work?

For the record, I have seen this post: (click here for semi-useful stackoverflow post) but I do not understand how to relate it to my own situation. Thanks in advance for anything you can give me.

  • 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-12T05:19:52+00:00Added an answer on May 12, 2026 at 5:19 am

    So it turns out I have found the solution to my own problem.

    I used the following line in my C# tests and it finds the value in my dropdown list instantly:

    selenium.WaitForCondition("var ddl = selenium.browserbot.getCurrentWindow().document.getElementById('insert-id-of-dropdownlist-here'); ddl.options[ddl.selectedIndex].text == 'insert-text-value-to-search-for-in-dropdown-here';", "10000");
    

    In the IDE I used the following parameters:

    Command: waitForCondition

    Target: var ddl = selenium.browserbot.getCurrentWindow().document.getElementById(‘insert-id-of-dropdownlist-here’); ddl.options[ddl.selectedIndex].text == ‘insert-the-text-value-to-search-for-in-dropdown-here’;

    Value: 10000

    This is the page that ultimately helped me figure out the solution:
    http://wiki.openqa.org/display/SEL/waitForCondition

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

Sidebar

Related Questions

I have two dropdown lists (one dynamically populated, the other not) that determine the
I have two custom dropdown lists that have the same markup. I need to
I have two search buttons on a page, one linked to a dropdown list
I'm creating a server control that basically binds two dropdown lists, one for country
I have two drop down lists. Second one is populated based on value chosen
I have created a populated dropdown list in HTML. When the two dropdowns have
I have a page with two ContentPlaceHolders. One has a DropDown and another UpdatePanel
I have two database tables, one for Users of a web site, containing the
I have the following code that populates two drop down lists, it all works
There will be two drop down lists, First have the list of mobile vendor,

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.