How to I change the UFT license feature within my script?

  • Questions
  • How to I change the UFT license feature within my script?
Question ID: 108581
1
0

I need to be able to change the license feature used within my automation script so that I make sure I’m using my full UFT (GUI + API) license instead of our FT (GUI Only) licenses. Any way to do this.

Marked as spam
Posted by (Questions: 359, Answers: 26)
Asked on July 31, 2018 8:01 pm
11 views
Answers (1)
1
Private answer

I found this on the Micro Focus forums which may help. Note: this is provided ''as-is'' and you are totally on your own if you decide to use it (see full disclaimer of warranty at the bottom of the code chunk).

'Usage: ChangeLicenseFeature ''10606''

Sub ChangeLicenceFeature(autopassLicFeature)
'autopassLicFeature = Only concurrent feature IDs: 10594 -> UFT, 20528 -> FT, 10606 -> QTP
'More at https://softwaresupport.hp.com/group/softwaresupport/search-result/-/facetsearch/document/KM01765878
Set xmlDoc = CreateObject(''Microsoft.XMLDOM'')
xmlDoc.Async = ''False''
xmlfile = CreateObject(''WScript.Shell'').ExpandEnvironmentStrings(''%programdata%Hewlett-PackardUFTLicenseLicenseSettings.xml'')
xmlDoc.Load(xmlfile)
Set StartupExplicitFeatures=xmlDoc.selectSingleNode(''/LicenseSettings/StartupExplicitFeatures'')
do while StartupExplicitFeatures.childNodes.length <> 0
StartupExplicitFeatures.removeChild(StartupExplicitFeatures.childNodes.item(0))
loop
StartupExplicitFeatures.appendChild xmlDoc.createNode(1, ''feature'', '''')
Set StartupExplicitFeatures=xmlDoc.selectNodes(''/LicenseSettings/StartupExplicitFeatures/feature'')
For Each objNode in StartupExplicitFeatures
objNode.setAttribute ''id'', autopassLicFeature
objNode.setAttribute ''version'', ''1''
Next
xmlDoc.Save xmlfile
End Sub

'DISCLAIMER OF WARRANTY
'The example software is experimental and is provided as a courtesy, free of charge, ''AS-IS'' by Hewlett-Packard Development Company, L.P. (''HP''). HP shall have no obligation to maintain or support this software. HP MAKES NO EXPRESS OR IMPLIED WARRANTY OF ANY KIND REGARDING THIS SOFTWARE. HP SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, WHETHER BASED ON CONTRACT, TORT OR ANY OTHER LEGAL THEORY, IN CONNECTION WITH OR ARISING OUT OF THE FURNISHING, PERFORMANCE OR USE OF THIS SOFTWARE

Marked as spam
Posted by (Questions: 0, Answers: 707)
Answered on July 31, 2018 8:01 pm
Thanks, I will use at my own risk.
( at July 31, 2018 8:04 pm)