Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cascading heirarchy drop down list timing problem
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
Hello,

I have a script that uses descriptive programming running against a web application. I am running into a problem with a set of drop down lists which are AJAX enabled. The load time of the lists often varies, and Qtp seems to be running too fast in some cases.

When a user selects an option from a drop down, a splash screen fills the page until the new set within the control has loaded. Choosing one of the options in a DDL determines the list in the box below it.

For example:
DDL 1: Options for Country. User Chooses "USA"
DDL 2: Loads in states or provinces within the USA, based on the previous selection. User Chooses "Alabama"
DDL 3: Loads all Cities from Alabama.... etc.

QTP seems to be trying to access the drop down before it finishes loading in the selections.

I have tried using Exists, WaitProperty, and Wait statements. The exists only verifies that the page loaded the drop down list, not the content of the list. WaitProperty seems only to be suited on checking if a selection has been made correctly. I have also tried searching the list to make sure that the entry i wish to select is in the "all items" property, but I cannot be sure that this check is run when the list has loaded. The only one of these that seems to be working as needed are the Wait statements. However, if the set takes too long to load, and my wait statement is too short, qtp will attempt to select an option from an empty list before it is loaded, and in the end, no option will be chosen at all.

The load time is fairly unpredictable at times, and since this action of choosing a drop down set is repeated hundreds (maybe thousands) of times within a single run of this script alone, I want to make sure it can run as quickly as possible, without making a wrong selection.

Here is the code I currently have in place:
Code:
Dim dpBrowser
dpBrowser = "micclass:=Browser"
Dim dpPage
dpPage = "micclass:=Page"

country = Trim(DataTable("country", dtLocalSheet))
state_province = Trim(DataTable("state_province", dtLocalSheet))
city = Trim(DataTable("city", dtLocalSheet))

<for loop here>
If country <> "" AND state_province <> "" AND city <> "" Then
    If Browser(dpBrowser).Page(dpPage).WebList("html id:=.*ddlCountry.*").Exist(10) AND Instr(1, Browser(dpBrowser).Page(dpPage).WebList("html id:=.*ddlCountry.*").getROProperty("all items"), country) <> 0 Then
        Browser(dpBrowser).Page(dpPage).WebList("html id:=.*ddlCountry.*").Select country
        Wait(2)
    End If
    If Browser(dpBrowser).Page(dpPage).WebList("html id:=.*ddlState_Province.*").Exist(10) AND Instr(1, Browser(dpBrowser).Page(dpPage).WebList("html id:=.*ddlState_Province.*").getROProperty("all items"), state_province) <> 0 Then
        Browser(dpBrowser).Page(dpPage).WebList("html id:=.*ddlState_Province.*").Select state_province
        Wait (2)
    End If
    If Browser(dpBrowser).Page(dpPage).WebList("html id:=.*ddlcity.*").Exist(10) AND Instr(1, Browser(dpBrowser).Page(dpPage).WebList("html id:=.*ddlcity.*").getROProperty("all items"), city) <> 0 Then
        Browser(dpBrowser).Page(dpPage).WebList("html id:=.*ddlcity.*").Select city
        Wait (2)
    End If
End If
<some other code>
<save entry>
<end for loop>

Is a way to solve this problem, other than increasing the wait time?

Thank you,

Incite1321
Reply


Messages In This Thread
Cascading heirarchy drop down list timing problem - by incite1321 - 10-09-2009, 09:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Compare second web list value according to the first web list value roselin6 1 2,892 10-07-2015, 09:14 PM
Last Post: supputuri
  Drop-Downs in excel sheet indianinworld 1 3,727 03-01-2011, 08:40 PM
Last Post: indianinworld
  How to do DP for a site with multiple heirarchy? viv_karthy 1 1,710 05-13-2009, 04:32 PM
Last Post: tarunpandey4@gmail.com
  Drop-down box mahadevan.swamy 5 4,392 11-03-2008, 12:47 PM
Last Post: amilar
  Unable to Record Drop down Menu and it's list items samuluru 3 4,448 07-02-2008, 01:48 PM
Last Post: nageshpv

Forum Jump:


Users browsing this thread: 3 Guest(s)