Forum Discussion

maxtester's avatar
maxtester
Contributor
8 years ago

Is it possible to export all functionames

Hi all,

 

for the scriptdokumentation I would like to have an overview of all functions and their parametes that I have created in my suite. Is there any possibility to export or to get a list with all scripts, their function, paramter in the functions.....

 

Regards

 

 

Max

4 Replies

  • djadhav's avatar
    djadhav
    Regular Contributor

    What language you are using for scripting? Please give an example of the content of the documentation you would like to create.

  • I am using JScript and looking for a method that lists all functions that are within a script. Something like this:

     

    script foo.sj

       - function test1(param 1)

      -  function test 2()

      - .....

     

    script foo2.sj

      - ....

     

    and so on. Something like javadoc in eclipse

    • djadhav's avatar
      djadhav
      Regular Contributor

      Here is a simple way to do it with Powershell. Open Powershell with Administrator privileges (Right click and select 'Run as Administrator')

       

      Command

      Select-String -Path "C:\TC11Projects\abc\scripts\*.svb" -Pattern ^[ \t]*function

       

      Explanation:

      "C:\TC11Projects\abc\scripts\*.svb" - Folder where the script files are. *.svb identifies the files to be scanned.

      ^[ \t]*function - regular expression that specifies 'All lines that have function as the first word preceded by 0 or more spaces or tabs'

       

      This will give you an output like this:

      TC11Projects\abc\scripts\ManageAccess.svb:34: FUNCTION Init()
      TC11Projects\abc\scripts\ManageAccess.svb:43: FUNCTION Goto_HomePage
      TC11Projects\abc\scripts\CommonActions.svb:43: FUNCTION LogOut

      • maxtester's avatar
        maxtester
        Contributor

        I have already imlemented such parser which gives me each function in each script, parameters, my descritpion and so on. It works fine for me. But I am also looking for such a in TC function and I am wondered that t does not exist