Forum Discussion

zdanov's avatar
zdanov
Contributor
8 years ago

how to handle "member not found" runtime exception error

Hello,

I'm testing my web app in Chrome, and this particular module is a Search form with a lot of filters (text boxes, drop-down lists, auto-complete fields, etc). TestComplete stores and read these objects as "textnode", "textnode2", "textnode3". The step where it is failing is when trying to select a value from a drop-down list control. First I got that "Ambiguous recognition of the tested object" on one drop-down control, followed by "member not found" exception. I then turned off this warning and on the 2nd run, it was able to select a value from the list from that same drop-down control, but then it failed on the next drop-down selection with the same "member not found" exception.

 

Please let me know if you have any ideas on how to bypass these exceptions on drop-down controls.

 

Thanks!!

Serge.


  • zdanov wrote:

     

    I did not modify identification/mapping criteria; just left the defaults as TC captured it during test recording.


    Just as a note...  while TC does a decent job of automatically mapping items, as you have experienced, it's not perfect.  I rarely, if ever, keep the default mapping TC supplies me for the very same reason that you have experienced.

     

    I'm looking at your components and yes, definitely, you need to remap these things.

     

    First of all, in Tools | Options | Engines | NameMapping turn off the option for use extended find when possible.  Having this automatically turned on can cause issues in situations like yours where there are a LOT of objects that are very similar with minimal distinguishing characteristics.

     

    Secondly... it's obvious that the controls you're using are in some way custom controls... the fact that you have a dropdown list that TestComplete recognizes simply as a textbox means that this is a bit complicated.  You're going to have to do some digging around.  one thing I'd STRONGLY recommend is go back to your developers and see if they can help you out by applying unique identifiers to the objects.  Textbox(0) and Textbox(6) are very ambiguous.  

     

    Unfortunately, this is effort that will take a LOT of work to do via web forums.  But your first step is to go back and manually edit all your objects in NameMapping, removing the Extended Find where you can and inserting parent objects, etc.  NameMapping uses two sets of criteria for identifying an object.   It looks first at the hierarchy... Starting with NameMapping.Sys, it works it's way down the tree of objects to find the specific one.  Then it uses the properties to identify specific objects.  So, the more specific you can be with hierarchy and the more specific you can be with properties, the less likely you'll have the issues you're experiencing.  This will take time, but in the end it's worth it.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    My guess is that the problem is due to improperly selected identification criteria for your components.  You don't want to "bypass" the member not found... you want to correct your identification so a) you do not get the Ambiguous recognition message and b) don't get the "member not found" exception.

     

    so... each filter needs to be properly identified as a control in NameMapping.  The "Ambiguous recognition" means that the identification criteria you've given TestComplete to identify that object actually resulted in TestComplete finding more than one matching object... so, it gives the warning and then attempts to move forward.  The "member not found" means that, then, the second control is, for some reason, not found at all.  I expect that if you fix the first one with proper identification, the second one will go away as well.

     

    If you need help making these modifications, please post the following:

     

    1) A screenshot showing the Object Browser property listing (all properties, please)for one of the drop down controls that you're having problems with.

    2) A screenshot showing the mapping criteria for the object in nameMapping.  Please include the hierarchy of objects for the control in question.

     

    With this information, we should be able to give you a general idea of how to fix your problem.

    • zdanov's avatar
      zdanov
      Contributor

      Hi Robert, 

      Thank you for your reply! :)

      I did not modify identification/mapping criteria; just left the defaults as TC captured it during test recording.

      Attached are the Object Browser properties (2 screenshots, top and bottom properties) for the drop-down control itself, and then the screenshots (2 screenshots, top and bottom) for the Object Browser properties for the actual list when drop-down is expanded for selecting an item (the one that triggers "member not found" exception).

       

      Also, I have attached the screenshots for the drop-down list that triggers the error from the NameMapping.

       

      Thank you very much!

       

      Regards, 

      Serge.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        zdanov wrote:

         

        I did not modify identification/mapping criteria; just left the defaults as TC captured it during test recording.


        Just as a note...  while TC does a decent job of automatically mapping items, as you have experienced, it's not perfect.  I rarely, if ever, keep the default mapping TC supplies me for the very same reason that you have experienced.

         

        I'm looking at your components and yes, definitely, you need to remap these things.

         

        First of all, in Tools | Options | Engines | NameMapping turn off the option for use extended find when possible.  Having this automatically turned on can cause issues in situations like yours where there are a LOT of objects that are very similar with minimal distinguishing characteristics.

         

        Secondly... it's obvious that the controls you're using are in some way custom controls... the fact that you have a dropdown list that TestComplete recognizes simply as a textbox means that this is a bit complicated.  You're going to have to do some digging around.  one thing I'd STRONGLY recommend is go back to your developers and see if they can help you out by applying unique identifiers to the objects.  Textbox(0) and Textbox(6) are very ambiguous.  

         

        Unfortunately, this is effort that will take a LOT of work to do via web forums.  But your first step is to go back and manually edit all your objects in NameMapping, removing the Extended Find where you can and inserting parent objects, etc.  NameMapping uses two sets of criteria for identifying an object.   It looks first at the hierarchy... Starting with NameMapping.Sys, it works it's way down the tree of objects to find the specific one.  Then it uses the properties to identify specific objects.  So, the more specific you can be with hierarchy and the more specific you can be with properties, the less likely you'll have the issues you're experiencing.  This will take time, but in the end it's worth it.