Tuesday, July 15, 2014

UFT API - control VCloud machines from UFT

You can control VCloud with an API test in UFT. Here is How.


1. Create a new API test.
2. Let's say we want to Revert to Snapshot a machine:
Add a HTTP Request and add following properties:

URL: https://vcloud.example.com/api/vApp/{vapp-id}/action/revertToCurrentSnapshot
HTTP Method: POST
Request headers:
Accept: application/*+xml;version=5.1
Authorization: Basic + (User + Pass in Base64)


3. Run the test and the machine will be reverted.

Here is a list with a lot more useful commands:
http://pubs.vmware.com/vchs/index.jsp#doc/landing-user_operations.html

Also use Postman - Rest Client Addin from Google Chrome to test your requests:
https://chrome.google.com/webstore/search/postman%20rest%20client?utm_source=chrome-ntp-icon


No comments:

Post a Comment