Forum Discussion

Morgan's avatar
Morgan
Frequent Contributor
12 years ago
Solved

checking to see which script is running

I'm sure this is easy but I can't figure it out... what do I use to look for which script routine is running?  Like "If x is the script being run then do y..."  



Thanks!

Morgan

2 Replies

  • karkadil's avatar
    karkadil
    Valued Contributor
    If you use Test Items for running your tests, you can use TestItems.Current.Name property. You can find usage example here

    http://support.smartbear.com/viewarticle/56316/



    However, if you want to get the name of the current function, it will be more challenging :)

  • Hi Morgan, two questions:


     


    1. Are you after the name of the Script Unit or the name of the function?


    2. What language are you using to write test scripts?


     


    If you are using JScript, this thread describes some ways how to obtain the name of the currently executing function.


     


    Regards,


    Phil Baird