Ask a Question

How to find the script unit name ?

nimishbhuta
Frequent Contributor

How to find the script unit name ?

Hello, 

 

I want to know how can I find out script unit name that I am using and also need to find out the keyword test name. I have searched around the community blogs but could not find appropriate answer.

 

Regards,

 

Nimish

10 REPLIES 10
shankar_r
Community Hero

Your question quite confusing.

 

Do you want to know the Script unit name for the function which is being used in a KeywordTests?

 

if so, you will be able to find it in Operation column

 

viewti.PNG

If you want to see list of functions created in your project, you can see it here


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

tristaanogre
Esteemed Contributor

If you are looking to find out this information at runtime via code, for keyword tests, there currently isn't a way to say "This is the keyword test I'm currently running".  For script code, you can find out what script routine is calling your current script routine using the "caller" methodology built into JavaScript.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

The closest I got for the keyword tests is to push the keyword test name to the indicator at the top of every test and do a pop afterwards.  This does a pretty good job of showing what test is running.  I made it part of our template, but if you forget one, it'll be pretty obvious.

 

https://support.smartbear.com/testcomplete/docs/keyword-testing/reference/misc/push-indicator-text.h...

Hello Robert, 

 

Thanks for your response. 

 

Can you let me know how can I do this with VBScript?

 

Regards,

 

Nimish

I'm not familiar enough with VB script to answer that.

 

What's your use case/purpose for needing that information?


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Hello Robert, 

 

My use case is to use the script name to construct the test data path of excel sheet. For ex: I create a test script as such TC01_CreateOrder then I will  use the test script as CreateOrder  to construct the excel file name. C:\Project\TestData\<testscripname.xls>

 

 

Regards,

 

Nimish

Does anyone has a solution in VBscript?

I'm not super familiar with VBScript but I don't think this is something that you can do.

 

If you're associating a known excel sheet with a known function / sub though, why do you need this? Just store the you need excel path in your function / sub. Unless I am missing something from your explanation. 


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
nimishbhuta
Frequent Contributor

Hello,

 

My excel sheet names are based on the test case name, so it should be dynamically pick the excel file name and construct the data path. 

 

Regards,

 

Nimish  

cancel
Showing results for 
Search instead for 
Did you mean: