Forum Discussion

kish's avatar
kish
Contributor
13 years ago

TC 8.50 unable to find the Combo box item while running the script.

Hi,



 In each iteration I am trying to select an item from the combo box . While running this script TC is selecting the first item from the combo box.

for 2nd iteration ,combo box item is not found error is displayed . The items are not displayed in the combo box during execution.



Regards,

Kish

4 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    If the items are not actually in the combo box on the second iteration, it sounds to me like you've actually found a bug in your application.



    Can you reproduce this situation manually?  Could you post your code or a screenshot of the keyword test you're using?
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Not knowing the full details of your application, my suggestion is that you might want to take a look at doing some additional delays of the automation to let your application catch up.  Each time through the driver, if you're selecting "ClickItem", it's selecting an item but there's other processing going one where you're entering in data, clicking OK buttons, etc.  It's entirely possible that when you get to the second time through the loop, there's enough going on behind the scenes that the combo box is not getting populated in time.  



    I see you're using aqUtils.Delay to put in some hardcoded delays.  These may not be long enough to handle your specific situation.  Instead of using aqUtils.delay, you might want to try something like this.




    var replacesitem=Aliases.IEXPLORE.pageModuledetails.panelMsDlgcontent.panelMsDlgborder.panelMsDlgframecontainer.frameDlgframe8c026eae13514a938be.formAspnetform.panelS4Workspace.panelS4Bodycontainer.panelS4Mainarea.panelMsoContenttable.panelS4Ba.panelMsBodyareacell.Replaces;

    while (replacesitem.WaitProperty("wItemCount", 0, 1000))

    {

    Delay(1000)

    }


       var listcount = replacesitem.wItemCount;  



    This is a rather "quick and dirty" insertion here and I'd recommend adding some code to break out of that new while loop if it takes too long.  But the bolded code above will continue to loop so long as the item count in your combo box is zero.  As soon as it becomes non-zero, you break out of the loop and continue in your code.
  • kish's avatar
    kish
    Contributor
    Hi Robert,



    This one is resolved . Thanks for your help.



    Regards,

    Kish