Forum Discussion

makula's avatar
makula
Occasional Contributor
9 years ago

objects are identified differently based on .net version

Hi,

 

I find same object is identified as WPF Object in .Net 4.0 version and Form Object(Button,ListItem,etc) in .Net 4.5 version.

Making automation script compatible to .Net versions costs more as it is same as rewrite of whole script.

 

I have attached dotNet40 image file which holds object tree on .Net 4.0 machine and dotNet45 image file which holds object tree on .Net 4.5 machine

 

Can anyone suggest why Test Complete identifies same object in differenyt ways? Do we have any efficient workaround for this?

 

Let me know if any additional information is required.

 

Thanks & Regards,

Mamatha

7 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Mamatha,

     

    The issue is related to the fact that TestComplete doesn’t recognize objects as WPFObject in the .NET 4.5 app. It uses the MSAA technology to identify those objects instead. Please check the following to try to resolve the recognition issue:

    1. Check your TestComplete version and review the "Supported .NET Technologies" help topic (press F1 to open the offline documentation). Perhaps, the TestComplete version you are using doesn’t support .NET Framework 4.5.
    2. Do you use the same TestComplete project to review the objects in the .NET 4.0 and 4.5 apps? If you use different projects, make sure project options in both projects are set to the same values.
    3. In the problematic project, open the Open Applications | General project settings and make sure that the NativeClrObject namespace is located in one of the top positions.

     

    Does this help?

    • makula's avatar
      makula
      Occasional Contributor

      Hi Tanya Gorbunova,

       

      Thanks for the information!! So u have mentioned TestComplete doesn’t recognize objects as WPFObject in the .NET 4.5 app. But the APP doesn't have any behaviour specific to any .NET version. The app engineer has confirmed they aren't doing anything specific to .NET version.

       

      1. Check your TestComplete version and review the "Supported .NET Technologies" help topic (press F1 to open the offline documentation). Perhaps, the TestComplete version you are using doesn’t support .NET Framework 4.5.

       

      Yes you are right, TC 8 doesn't support .NET 4.5.  But I have couple of questions regarding this compatibility check. Below is the table which gives combinations I have tried to identify same object against different .NET versions versus different TestComplete versions and OS.

                             TCdotNetComp.png

       

      From the above table it is evident that though WIN8 has .NET 4.5 version which is supported by TC9, still objects are identified as Form Objects than WPFObjects. I think something is missing here. Can you detail why it is different with WIN8 OS?

       

      2. Do you use the same TestComplete project to review the objects in the .NET 4.0 and 4.5 apps? If you use different projects, make sure project options in both projects are set to the same values.

       

      We have same TC project settings for all the apps on any .NET version.

       

      3. In the problematic project, open the Open Applications | General project settings and make sure that the NativeClrObject namespace is located in one of the top positions.

       

      Moving NativeClrObject namespace didn't help.

       

       

      -Mamatha

      • TanyaYatskovska's avatar
        TanyaYatskovska
        SmartBear Alumni (Retired)

        Hi Mamatha,

         

        If your application was built with .NET Framework 4.5, TestComplete 8 won’t be able to get access to its object – the tool doesn’t know how to work with this wrapper. So, if you are planning to test your new application, you need to consider updating to the latest TestComplete version.