Forum Discussion

ajohnson2020's avatar
ajohnson2020
Contributor
15 years ago

CallObjectMethodAsync from TestExecute in VMWare

Hi all,



I've just started experimenting with TestExecute in a VMWare session on Windows 7.

I have the following lines in my code that click a drop down menu object and wait for it to open:



ResultObj := Runner.CallObjectMethodAsync(Obj, 'Click');      

ResultObj.WaitForCompletion(10000);



This works fine on my Win 7 workstation with TestComplete 8.5 and via remote desktop to a Windows XP workstation running TestExecute.

But when I try it on my new TestExecute installation in the VMWare session I get the following error on Runner.CallObjectMethodAsync:



Unknown name



I have already passed the section of my code that verifies that the application started as an Open process, so I don't think that's it.  I have

already verified that the Obj object exists.



Have I missed something in my installation configuration?  Or is this something peculiar to a VMWare session?



Thanks.

Allen

7 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Is the VMWare workstation logged in and "unlocked"?  If not, any GUI interaction scripts will fail as the objects and components are not available.
  • Yes, I am logged in to the VMWare workstation and can see the application open as it tries to access the menu.



    Allen
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Next stop on the "troubleshooting" train...



    In my experience with VM's, the application usually runs a good bit slower on the VM than on a real workstation, usually because VM's aren't typically speced out as high performance machines.  So, in this case, the "Obj" that you are passing to the method may not be fully resolved by the time you call the "Click" method and may return an empty object.  In the statement where you are assigning "Obj", if you're not using a WaitNNN method, you might want to consider doing so.  You could also play around with increasing the default object timeout settings on your project level.
  • No such luck, I've tried inserting manual delays and doing an 'If Obj.Exists then' check before calling the proc, and it's all happy until the actual procedure call.  This VMWare session is hosted on a Pentium i7 with a gig of memory dedicated, it's actually faster than my XP box.



    Thanks.

    Allen
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    The error being returned basically means that some method or other does not exist on the object.



    Since I don't know much about the object you're using... could it be possible that, because of the change in Windows environment, the object in question doesn't actually support the "Click" method?  It would be interesting to find some way of inspecting that object to see what methods it actually has on your Windows 7 environment.



    Can you call Obj.Click outside of the Asynch call?
  • Argh!  I figured I must have been missing something basic, sure enough, my .tds file was missing.  I had copied it into the VMWare session, but it must have gone to the wrong directory by accident.  So the application was open, but couldn't find the necessary Debug Agent information for that object.  Working as designed!



    Thanks for your help!

    Allen
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Glad it was something easy, actually.   Sorry we went down so many rabbit trails.



    Happy testing!