Forum Discussion

exdunepilot's avatar
exdunepilot
Contributor
8 years ago

Runtime Behavior and Object Spy Do Not Correspond

I have a custom class based on a JavaFX class.  In Object Spy I can traverse the tree and find the properties/fields/methods I'm looking for.  However, at runtime in my test code & using debug "watch" these same properties/fields/methods are not available.   Is there some config/setting I can use to make the custom class available at runtime?  TIA.

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    If it's available in Object Spy, it should be accessible during runtime.  So, the question is, what are you doing in runtime to access that information?  How are you referencing your objects? Are you using NameMapping? If so, how are you mapping the objects?

    Object identification during runtime sometimes has to do with timing.  You click on a control and then look for an object... but if the object is not immediately available, you may get "cannot find object" errors depending upon a number of situations.

    Additionally, if the objects have some dynamically generated properties and you are using these in NameMapping, these properties may change from run to run so when they are initially mapped, the object is found. But when you run it again, the object is not found.

     

    As for custom classes, this is something that needs to be addressed in the Object Mapping portion of your project properties. Read https://support.smartbear.com/testcomplete/docs/working-with/managing-projects/properties/object-mapping.html


    So... some specifics of code, name mapping criteria, etc., would be helpful for us to be able to help you but I'd start with the object mapping, move to object identification, and then start working on cleaning up timing.