title: My test script is not finding items in dynamic web list control - list in code not updated with current info
body: <p>I am having a problem in QTP with selection of a web list box and I have exhausted what I know to do to resolve it.  I am hoping someone can help.</p>
  
  <p>There are 5 controls in a container, 2 webedit controls and 3 weblist controls.  Together, they allow entry of accounts associated with a customer, and there can be 16 accounts for any customer.  There are only ever five controls active at any time, whether editing or entering information for an account.  When the information for an account is entered and accepted, it changes to a read-only table row and a new set of controls appears below it for entry of the next account.   </p>
  
  <p>The information entered in these controls is the account number, type, description, designation, and status.   The status value is contingent on the designation, and the items in the list change dynamically depending on what the user specifies for the designation.  The status list is not enabled until the designation is specified.</p>
  
  <p>After some experimenting with timing, I was able to get past an issue where the status list for the first account was seen by QTP as disabled even though it was clearly enabled.   I was then able to advance to entry of the second account.   </p>
  
  <p>I change the designation on the second account and try to select an appropriate item (specified in a data table) in the status list.   My specification from the data table is never found.  I figured it was a problem with verbiage differences and also that I should probably anticipate that and address it now, so I wrote a function to accept three parameters, the list and up to two search items.   My function searches the listbox passed to it and looks for a match (full or partial) on the search items it receives.  Here is where I encountered a significant problem.   </p>
  
  <p>The list of the control my function received was from the previous iteration of the test, corresponding to the designation of that account.  This is why my function was not finding the selection item.   The list on the screen shows the appropriate items, which suggests that I am looking at the wrong object.  I also get the ‘object is disabled’ message when I put my data table value directly into the list with the select statement.</p>
  
  <p>The active controls are displayed below the readonly presentation of the previously entered accounts.  I am very new to QTP, but I also read documentation.  My only theory at this point is that ATP is not passing the right list to my function… that perhaps that how it was learned included the position, which will change each time.  However, the spy identifies the screen control as the same item I processed for the preceding account, which makes my theory suspect.  In addition, the other four controls, which are not dynamically changing, do not present the same problem.  I can put the information in them consistently.</p>
  
  <p>I apologize for the length of this question, but I wanted to be as thorough and clear as possible.   Can anyone help me get past this obstacle.</p>