Forum Discussion

conehead's avatar
conehead
Occasional Contributor
7 years ago

Can not insert 'run script routine' into a keyword test.

I have a opened keyword test and want to insert 'run script routine'. When I attempt this I'm getting a TestComplete message 'No tests were found in you project suite.'


As mentioned, I'm already in a keyword test and am trying to insert the 'run script routine' operation. Can someone explain to me what 'No tests were found in your project suite.' means?  Does it have something to do with inserting the 'run script routine'?

 

Thanks in advance.

8 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Do you have, in your project, a "Script" project item with at least one code unit with at least one function/procedure within that unit?  If not, then "Run Script Routine" won't work for you because there are no script routines actually in your project.

    • conehead's avatar
      conehead
      Occasional Contributor

      No I did not. That clears up the 'No tests were found...' error message.

       

      Thanks for the scoop.

    • socaltester's avatar
      socaltester
      Contributor

      I do have a script listed in Project Explorer under <Project Suite> -> <Project Name> -> Advanced -> Script , but the "Run Script Routine", when selected, still presents "No tests were found in your project suite." message.  Do I have the script routine located in the wrong directory or is there some environment variable needing added or configured?

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        socaltester wrote:

        I do have a script listed in Project Explorer under <Project Suite> -> <Project Name> -> Advanced -> Script , but the "Run Script Routine", when selected, still presents "No tests were found in your project suite." message.  Do I have the script routine located in the wrong directory or is there some environment variable needing added or configured?


        The script in project explorer is a file that should contain functions, methods, etc.  You can't just add a file.  In that file, do you have method defined?  (what code language are you using?)

         

        For example, if you have a file that is JavaScript, you can't just do this:

         

        //This is a script file
        
        var MyName = "Test";
        Log.Message(MyName);

        You need to put your code into a function:

         

        //This is a script file
        
        function MyTest(){
        var MyName = "Test";
        Log.Message(MyName);
        }

        Depending upon the language you're using the syntax may differ, but that's basically the problem.