×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

QCUtil.CurrentTestSet not working

QCUtil.CurrentTestSet not working

QCUtil.CurrentTestSet not working

(OP)
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,

RE: QCUtil.CurrentTestSet not working

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.

RE: QCUtil.CurrentTestSet not working

(OP)
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,

RE: QCUtil.CurrentTestSet not working

The error is basically telling you that

QCUtil.CurrentTestSet

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close