Forum Discussion

coharness's avatar
coharness
Occasional Contributor
6 years ago

Cannot find dotNET child objects

I have a project that I was able to run in TestComplete 12. I recently installed TC 14 onto a new computer and copied the scripts into a new project. Now, I'm getting a JavaScript runtime error that the object I'm trying to use is undefined.

 

My code is simple:

dotNET.System_Management_Automation.PowerShell.Create().AddScript(command).Invoke()

but now it can't even compile because the System_Management_Automation object is undefined.

 

I did add the System.Management.Automation assembly to the CLR Bridge as instructed here. The code completion window shows absolutely nothing for dotNET after I hit the period (it does autocomplete dotNET, nothing after).

 

What am I missing to get PowerShell functional again?

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Double check the bitness of your assembly and of TestComplete.  TestComplete, by default, creates shortcuts to run the 64-bit version of the tool.  If your assembly is 32-bit version or you don't have the bitness set up properly, that could be causing your issue.

    • coharness's avatar
      coharness
      Occasional Contributor

      It appears that the library is 32 bit. I tried running the test with the "preferred architecture of the assembly hosting process to be" both 32 and 64 bit, but neither worked.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        As mentioned, TestComplete may also be running as 64-bit.

         

        What happens if you close out TC and run the TestComplete.exe executable from 

        C:\Program Files (x86)\SmartBear\TestComplete 14\Bin

         

        That should be the 32-bit version.  See if that allows you to see the object.s

    • coharness's avatar
      coharness
      Occasional Contributor

      Yes, that was one of the first things I checked. The extension was already installed.