Forum Discussion

rlent's avatar
rlent
Contributor
16 years ago

TestExecute not finding application in VM

I am attempting to run a script in a VM using TestExecute 8. I upgraded my Test Suite to TestComplete 8. It worked fine when running from TestComplete outside of the VM. But when run from TestExecute in the VM, it starts the tested app, but will not recognize any objects: it sits there waiting for the login window the tested application to appear, even though the login window is there. I have tried to manually log in to see if TE could recognize objects if I got it past this point. It still didn't recognize anything.



If I could run TestComplete in the VM, I could figure out what was going wrong. I used to be able to do that, but installing on a VM was taken away in TC8. If the object spy was available, I could at least figure out what TE is seeing when it tries to run the script. Does anyone have any pointers for using TestExecute 8 in a VM?

7 Replies

  • I updated the test using TestComplete on a Windows 7 64-bit machine. It worked fine on a Windows 7 x86 VM, but would not work on a Windows XP x86 VM.
  • I tried it on another XM VM, it still couldn't find the login dialog for the tested application. I'll try it in Vista next.
  • I tried it with a Vista VM, it looks like it is just a problem with TextExecute when running XP in the VM. Until this problem is resolved, I will have to scrounge up a real computer with XP so I can see if it will work in XP outside of a VM.
  • It works when TestExecute is run from a real PC running XP.
  • Hi Robert,


    To help us investigate the problem, please follow the steps below:


    1. Insert the following routine call before retrieving the problematic object in your test (change the process name):




    LogAppStructure(Sys.Process("MyProcessName"))


    Here is the LogAppStructure routine code:




    ' VBScript


    Sub LogAppStructure(obj)

      Err.Clear

      On Error Resume Next

      Dim count, i, Str  

      ReDim params(7)

      params(0) = "WndClass"

      params(1) = "WndCaption"

      params(2) = "Index"

      params(3) = "Visible"

      params(4) = "Exists"

      params(5) = "ClrFullClassName"

      params(6) = "ProductName"

      params(7) = "ProductVersion" 

     

      Str = ""

      For i = 0 To UBound(params)

        If IsSupported(obj, params(i)) Then

          Str = Str & params(i) & " = " & VarToStr(Eval("obj." & params(i))) & VbCrLf

        End If

      Next

     

      Call Log.AppendFolder(obj.Name, Str)

      For i = 0 To obj.ChildCount - 1

        Call LogAppStructure(obj.Child(i))

      Next

      Log.PopLogFolder


      On Error GoTo 0

    End Sub




    // JScript, C#Script


    function LogAppStructure(obj)

    {

      var count, i, Str;

     

      var params = new Array();

      params.push("WndClass");

      params.push("WndCaption");

      params.push("Index");

      params.push("VisibleOnScreen");

      params.push("Exists");

      params.push("Visible");

      params.push("FullName");

      params.push("ClrFullClassName");

     

      Str = "";

      for (var i = 0; i < params.length; i++) {

        if (IsSupported(obj, params))

          Str += params + " = " + VarToStr(eval("obj." + params)) + "\r\n";

      }

     

      Log.AppendFolder(obj.Name, Str);

      for (var i = 0; i < obj.ChildCount; i++) {

        LogAppStructure(obj.Child(i));

      }

      Log.PopLogFolder();

    }


    2. Execute your test and reproduce the "Object not found" problem. The LogAppStructure function will post the entire structure of the tested application to the test log and you will be able to see how objects are recognized right before the problem occurs.

    3. If you fail to find the cause of the problem using the test log, zip your entire TestComplete project suite folder along with the log of the test execution and send me the archive via our Contact Support form (http://www.automatedqa.com/support/message). Make sure that messages in your log correspond to correct actions in the latest version of your test.

  • Thanks, I can see what is going on now.



    Normally, I expect the log to look like this:



    Process("MyApp")

      Window("LoginDialog")



    But when I run it in an XP VM, I get this:



    Process("MyApp")

      Window("WindowsForms10.Window.8.app.0.3ce0bb8", "Login", 1)



    I don't know why it is doing this, but at least I can see what it is doing.
  • Hi Robert,


    It appears that your .NET application is not recognized as Open - that is why, the dialog cannot be recognized. There was a known problem which caused such behavior in TestComplete/TestExecute 7, however, it should be fixed in TestComplete/TestExecute 8. Please answer the following questions:


    1. A possible cause of the problem is that some complex actions which take long to be complete are performed in the application's GUI threads when the application is started (the application's main window may become blank or unresponsive in such cases). If so, try increasing the "Method invoke timeout" option described in the "Project Properties - General Open Applications Options" help topic, check whether the problem persists, and let us know your results.


    2. Is your tested application compiled for an x86 platform or for a x64 platform?


    3. Exactly how is the application launched? Is it launched as an item of the Tested Applications collection? Is it launched under another account (in RunAs mode)? Is it launched before or after TestComplete is launched? Please send us detailed steps you follow to launch the application.


    4. Is the application launched from a network folder or from a folder having specific Runtime Security Policy settings? In either of these cases, please make sure that the Runtime Security Policy settings for the folder from which the application is started are set as it is described in the "Working With Network and No-Touch-.NET-Deployment Applications" help topic.


    5. Is the application treated as Open according to the Process Filter options? Please see the "Project Properties - Process Filter Options" help topic for details.


    6. The problem can be caused by the fact that TestComplete is terminated incorrectly and the tested application is not restarted after that. Is this your case?


    7. Does your tested application use components that are not a part of the Windows Forms application framework by default (e.g. VCL.NET) or WPF components?


    8. Does your application's process have child objects named "AppDomain(...)" when the application is not recognized as Open?