Ask a Question

'Run Current Routine' button in the Code Editor toolbar

SOLVED
randall
Contributor

'Run Current Routine' button in the Code Editor toolbar

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

12 REPLIES 12
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.)

Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

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?

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
Community Hero

What version of TestComplete are you using?


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame

Joseph,

 

I will give that a shot but it will be very laborious.  My project has 58 library and functional script files.

 

Thanks,

Randall

11.21.2420.7

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


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame

function DeleteDatabase(srvrInstanceName, scriptPath) {
         var commandDraft = "sqlcmd -S " + srvrInstanceName + " -i " + scriptPath;
         var command = """ + commandDraft + """;
         Log.Message("scriptPath = " + scriptPath);
         Log.Message("command = " + command);
         var Return = shell.Run(command, 1, true);
         Log.Message("Return = " + Return);
         if (Return != 0) { Log.Error("database deletion failed") }
}

In my VBScript scripts, only the Sub section will enable the button.  The Functions won't run separately.   I wonder if this is a similar issue.


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
cancel
Showing results for 
Search instead for 
Did you mean: