Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QCUtil.CurrentTestSet not working

Status
Not open for further replies.

nupur21

Systems Engineer
Mar 28, 2019
8
0
0
SG
Hi All,
I am trying to get test set name, folder name & other properties using QCUtil.CurrentTestset but UFT is not identifying it.
No methods are visible for this object. I am getting a vbscript runtime error "424 object required".
I have tried to clear all the cache, temp files, restarted machine several time.
UFT version : 14 , ALM version: 12.53

----------- Trying to get test set name ----------------------------
Set ObjCurrentTest = QCUtil.CurrentTestSet
Dim strTestName : strTestName = ObjCurrentTest.Name

------ Trying to get folder name -----------------------------------
Dim objCurrentTestSet: Set objCurrentTestSet = QCUtil.CurrentTestSet
Dim folder: Set folder = objCurrentTestSet.TestSetFolder
Dim folderName: folderName = folder.Name
---------------------------------------------------------------------

If I use below code to fetch test name, then it works but if I use the same "QCUtil.CurrentTest" to fetch folder name, then its behavior is same as "QCUtil.CurrentTestSet"

Set ObjCurrentTest = QCUtil.CurrentTest
Dim strTestName: strTestName = ObjCurrentTest.Name

-----------------------------------------------------------------------
I have googled a lot but I didn't find the exact solution.
Please help, it's really urgent.

Thanks,
 
Here's the thing - sadly we don't know ALL the ActiveX objects that VBScript can automate - so in general you probably need to help us to help you by identifying what it is you are trying to automate. Also, at what exact point are you getting the error message?

I should point out that the documentation for the QCUtil object makes it clear that the CurrentTestSet "is supported only when UFT is connected to ALM and the run results location is an ALM location.". i.e. if that condition is not met, it won't return an object - which is what your error message is saying. CurrentTest on the other hand "is supported only when UFT is connected to ALM and the test is saved in an ALM project"

You might need to be talking to MicroFocus UFT experts, rather than VbScript experts.
 
Hey strongm,

Thanks for your reply.
ALM & UFT are already connected, the test case that I am trying to execute is already present in the ALM, I have opened the test case through ALM in UFT.

I am getting the error at Line 2:
Line 1: Set ObjCurrentTest = QCUtil.CurrentTestSet
Line 2: Dim strTestName : strTestName = ObjCurrentTest.Name

The error code is 424, error description: object required, error source: Microsoft vbscript runtime error.

I think the error I am getting is related to vbscript.
Please let me know if some more information is required.

Note: This piece of code was working earlier, it suddenly stopped working.

Thanks,
 
The error is basically telling you that

[tt]QCUtil.CurrentTestSet[/tt]

is not returning an object. Which suggests that, despite it being VBScript that raises an error, the problem lies somewhere within ALM/UFT

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top