Forum Discussion

angelodiego's avatar
angelodiego
Occasional Contributor
13 years ago

Running virtual pc

In my test scenario I have a client and a server running in two wirtual machines as slave project, the master project is on the server,

I'd like to always start with fresh virtual machines for my tests, I delete the "used" virtual machines and replace them with the original pristine version.

Now my problem is how to "start" the two virtual machines from a script in testcomplete.



I already tried with cmd /c start but it doesn't seem to work



Thanks,

Angelo Diego Crabolu

1 Reply

  • Hi,


    You can record a script that will run Virtual PC.exe and select the needed virtual machine from the Virtual PC Console window. For example:




    function Test()

    {

      var virtual_PC;

      var wndAfx;

      var sysListView32;

      var btnStart;

      TestedApps.Virtual_PC.Run(1, true);

      virtual_PC = Sys.Process("Virtual PC");

      wndAfx = virtual_PC.Window("Afx:00400000:20*", "Virtual PC Console");

      sysListView32 = wndAfx.Window("SysListView32");

      sysListView32.ClickItem("MyVirtualMachine", 0);

      btnStart = wndAfx.Window("Button", "&Start");

      btnStart.ClickButton();

    }