cancel
Showing results for 
Search instead for 
Did you mean: 

Referring VIX API in Test complete (To open vxm files)

jvkumar
Occasional Contributor

Referring VIX API in Test complete (To open vxm files)

Hi,



We have some image files (vmx files) created using VMware. And we need to open these files from Test complete. And i have installed VIX API in my system. However, the references are not updated. And the functions under this is not listed under .Net class.



Please let us know, how to install VIX API in testcomplete. We have Testcomplete 7.5 enterprise edition.



Please help us on this.



Regards,

Vijay
5 REPLIES 5
AlexanderM
Staff

RE: Referring VIX API in Test complete (To open vxm files)


Hi,





Please let us know, how to install VIX API in testcomplete.


There is no way to do this. However, as far as I know, VIX API provides the "VixCOM.VixLib" COM object, so if this object provides automation interfaces (IDispatch, in addition to IUnknown), TestComplete should be able to work with this object via COM. For additional information see the "Working With COM Objects" help topic and VIX API Reference.
-----

Alexander
Customer Care Manager
jvkumar
Occasional Contributor

RE: Referring VIX API in Test complete (To open vxm files)

Hi Alex,



Thanks for your reply.  Yes I know this can be achieved by using the COM object after I saw the sample code from the below link

http://www.automatedqa.com/techpapers/testcomplete/automated-testing-in-virtual-labs



But my problem is though I have installed VIX  API in my system, it is not shown under Registered ActiveX Libraries of the Testcomplete project - ActiveXObjects.



I couldn't refer VixCOM.VixLib from the Test Complete project as there is no COM reference for that.



Can you please help me on this.



Thanks and Regards,

Vijay
AlexKaras
Community Hero

RE: Referring VIX API in Test complete (To open vxm files)

Hi Vijayakumar,



If some entity is registered as a COM object, there is no need for it to be added to TC ActiveX Objects. You just write the code that instantiates the needed COM object and use it via its methods and properties.

E.g. (copied from the http://www.vmware.com/support/developer/vix-api/vix16_reference/, PowerOn function usage):



[VBScript:]
Dim lib
Dim host
Dim vm
Dim err
Dim results
Dim job




Set lib = CreateObject("VixCOM.VixLib") ' instantiate a COM object


' use obtained COM object
Set job = lib.Connect(VixCOM.Constants.VIX_API_VERSION, VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_WORKSTATION, Empty, 0, Empty, Empty, 0, Nothing, Nothing)

' results needs to be initialized before it's used, even if it's just going to be overwritten.
Set results = Nothing

err = job.Wait(Array(VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE), results)
If lib.ErrorIndicatesFailure(err) Then
' Handle the error...
End If

Set host = results(0)

Set job = host.OpenVM("C:\VMs\winxppro\winxppro.vmx", Nothing)
err = job.Wait(Array(VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE), results)
If lib.ErrorIndicatesFailure(err) Then
' Handle the error...
End If

Set vm = results(0)

Set job = vm.PowerOn(VixCOM.Constants.VIX_VMPOWEROP_LAUNCH_GUI, Nothing, Nothing)
err = job.WaitWithoutResults()
If lib.ErrorIndicatesFailure(err) Then
' Handle the error...
End If

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
chriswal
Occasional Contributor

RE: Referring VIX API in Test complete (To open vxm files)

 When i try your script i get this error.

With vmrun i can start the vm


YMinaev
Staff

RE: Referring VIX API in Test complete (To open vxm files)

Hi,



I recommend that you ask the VIX API support department to help you find out why the needed COM object has not been registered in your system.
------
Yuri
TestComplete Customer Care Engineer

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Top Kudoed Authors