Forum Discussion

randall's avatar
randall
Contributor
9 years ago

'Run Current Routine' button in the Code Editor toolbar

What causes this button to become disabled?  How do I re-enable it?

  • Are you setting the cursor inside the DeleteDatabase() function?  The Run button only works with functions that have no parameters...

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Hi Randall,

     

    "Run Current Routine" is disabled when:

    • The cursor is outside of any function. (You need to place the cursor inside the function you want to run.)
    • The function has parameters. (You need to write a wrapper function that would call this function.)
    • The script has syntax errors. (Use the menu command Test | Check Syntax to find the errors.)
    • randall's avatar
      randall
      Contributor

      Thanks for your timely response HKosova but none of your suggestions apply to my case.  My cursor is inside the function  and the control is disabled.  It is a wrapped function with parameters.  And it does not have any syntax errors, at least none identified by the 'Check Syntax' command.  There are no red circles with 'x'es on them on any line of the function.  In fact, every function in the library, the entire file, no matter where I place my cursor the 'Run Current Routine' button is disabled.  And this is true for several of my libraries while others don't have the problem at all.

       

      I have tried saving, closing, and reopening TestComplete and that didn't work.  I have double checked to make sure all braces and parenthesis are matched, all lines end in a semi-colon.  I have introduced syntax errors to get the red circle with an X to appear and then correct the error to get the red circle to go away in hopes that would re-enable the button.  Nothing worked.

       

      Do you have any other suggestions?

      • joseph_michaud's avatar
        joseph_michaud
        Moderator

        Start with a new project and a test routine taking no parameters which does something simple (like Log.Message()).  Is the Run button active and can you use it to run the test routine?  If so, start importing your script files, checking after each import that you can still use the Run button on your test routine.

      • Marsha_R's avatar
        Marsha_R
        Moderator

        Can you post a screenshot of the code?   Just the one you're trying to run is fine.