Forum Discussion

suzanne_raine's avatar
suzanne_raine
Contributor
11 years ago

Object does not exist.

Hi, 



I'm trying to run a test where I click a button on my plugin which is a WPF application.

Unfortunately, it's not recognising my plugin window as an object, so therefore when it gets to my button it just won't click it. 



I searched the forums and found people with similar problems.



The main solution seems to be adding the VisibleOnScreen property to the object, which I've done. And also adding the RefreshMappingInfo() method line in to my code. 

Unfortunately, it's still not working. 



Any help? It'd be much appreciated! :)





  • I had a similar (or at least, similar-sounding) issue this week..  Next time it doesn't work, try looking in the Object browser and see what TC is recognizing the name as.  In my case, TC was viewing the name incorrectly at random times (but especially when the program under test was closed and re-opened while TC was running), and therefore wasn't able to recognize the objects.  And then, it would sometimes randomly recognize the object correctly again.



    The solution in my case was to increase the Method invoke timeout property in the Project Settings.  Maybe that will help here, too?



    Edit:  If Object Browser appears to recognize it correctly, it could still be the problem I linked to.  I've seen TC re-name stuff in the Object Browser over the course of just a few seconds - it just takes time for it to realize that it's looking at an open application and get the proper names, I guess.
  • rickh_28's avatar
    rickh_28
    Occasional Contributor
    Have you tried identifying the object using the Object Spy?  I've had plugins that don't quite get recognized properly during recording, but once I use Object Spy, it works well.



    If it's a drop-down list, you might need to use the Point and Fix method.
  • rickh_28's avatar
    rickh_28
    Occasional Contributor
    I had a similar (or at least, similar-sounding) issue this week..  Next time it doesn't work, try looking in the Object browser and see what TC is recognizing the name as.  In my case, TC was viewing the name incorrectly at random times (but especially when the program under test was closed and re-opened while TC was running), and therefore wasn't able to recognize the objects.  And then, it would sometimes randomly recognize the object correctly again.



    The solution in my case was to increase the Method invoke timeout property in the Project Settings.  Maybe that will help here, too?



    Edit:  If Object Browser appears to recognize it correctly, it could still be the problem I linked to.  I've seen TC re-name stuff in the Object Browser over the course of just a few seconds - it just takes time for it to realize that it's looking at an open application and get the proper names, I guess.
  • I have a similar issue,



    I'm trying to run a test where on a form, I click an option within a dropdown list to select it, then click a different dropdown list to select it. Once the Test selects the dropdown list it is not recognizing the list and pauses with an error.



    The test does seem to recognize the dropdown if I Tab into the dropdown box and arrow down to select my answer. 



    Seems like Test Complete has some issues with Clicking.  



    I also had an issues right clicking. Simply trying to bring up the right click options stopped Test Complete with an error.



    Help would be appreciated.



    thanks,

  • Thanks for the suggestion Rick :) 



    I have tried the object spy and point and fix, yes. Unfortunately it didn't solve my problem. 



    When I use the highlight on screen feature, it finds my object without any problems but it just won't find it when I'm running the test! :(
  • Alex to my rescue again! :) 



    Okay well this isn't the exact same problem I was having yesterday when I posted this, but I'm having similar problems today with something else so I'll use todays code as my example.



    Browsers.Item(btIExplorer).Navigate("<myurl>");



    Now, when I ran this an hour ago, TestComplete loved it and ran it just fine.

    An hour later, and suddenly the browser object doesn't exist. I've checked it in name mapping, I have no idea why it would suddenly decide this. 
  • Update to previous post. 



    So after messing around, I decided that I think either me using Chrome (default browser) messed it up, or that it thought another instance of Internet Explorer was open somewhere in the background(???) So I restarted my PC...



    ... and it worked! Hurrah. Then it decided no, the next object, didn't exist. Cue: my head hitting my desk. 



    Any help would be appreciated! :)
  • Although looking at the errors for that, it all traces back to my browser object. It just doesn't like it! 



    See my screenshot when I try to look at it!



    (I'm sorry btw, this is fast becoming the dairy of a mad woman!)