Forum Discussion

SouthernGeorge's avatar
SouthernGeorge
New Contributor
10 years ago

Some objects are not found when run with TestExecute on a VM

I've been having an issue with one of my projects. On my desktop it runs fine. When I try to run it on a VM using TestExecute I have been consistently running into an issue where it cannot find some objects.

 

I am testing a windows 10 store application. UIAObject seemed to work best when I mapped the objects, so I put "NativeUIAObject" at the top of the "Priority of objects".

 

It does find most of the UIAObjects though.

 

I've made sure all the plugins match between TestComplete on my machine and TestExecute on the VM.

 

Sadly, I dont have ObjectSpy on the VM, so I cannot see what it is identifying the object as. 

 

Any suggestions?

Thanks!

 

 

5 Replies

  • Marsha_R's avatar
    Marsha_R
    Icon for Champion Level 3 rankChampion Level 3

    It's possible that there's just a timing issue.  We find this when running tests on different machines.  The object may be loading slower or the test running faster and then the object is missed.

     

    There are a few ways to try fixing this.

     

    A quick but not very elegant way to see if this is the issue is just to put a Delay right before the line where the error occurs.  If this fixes it, you can just leave the delay in and move on.

     

    Another way is to use one of the Wait statements to specifically look for that object.

     

    A third way is to go to Project Properties under Playback and change the time between events to something a little longer.  This has the effect of slowing your whole test down a little, but if you are seeing the not found error in several places, this may be an easier fix than the others.

     

  • So far, no dice. I upped the wait-out time to 10 sec, put a 5 sec delay before the line of code, and put a system refresh command before line of code with the issue and it still couldn't find the object. In fact, it cannot find the immediate parent object either. 

     

    I installed TestExecute on my local machine and ran the test and it worked fine. So it would appear that there is a discrepancy between the two systems. 

     

    At first I thought it might be an issue with the .NET framework, because the UIAObject uses the .NET framework, but when I tried to install .NET 4.5, it says that it is already part of the system.

     

    Im going to try to do a snapshot to see what it is identifying the child objects as.

  • cunderw's avatar
    cunderw
    Community Hero

    Are you using name mapping for your objects? If so have you checked the properties on both machines in the object spy?

     

    Perhaps there is something in the application that is determined by environment (machine name, username or something like that) that is different between the two systems. 

    • SouthernGeorge's avatar
      SouthernGeorge
      New Contributor

      I am using the name mapping for my projects.

       

      Part of the problem is that I only have the object spy on my local machine (Since it is the only one with TestComplete). The VM has TestExecute, and finds the majority of the mapped objects, but a few it just doesn't find. What is interesting, is that it consistently doesn't find the same objects. 

       

      That makes sense. It appears that the properties used to identify the object change between the two machines(?) Because the objects are there. I watch the test and it gets hung up at the same spot every time.

       

      Is there anyway to use TestExecute to save the properties and children of an object to see what it is actually finding? I tried the snapshot method, but it never seems to save any actual file. 

       

  • I failed to mention that this is a windows 10 store application. It uses the XAML framework which is why I have to utilize UIAObject properties.