Ask a Question

"Run This Routine" Greyed out in script mode


"Run This Routine" Greyed out in script mode

Hey All,


Hello.  I have a block of code I want to reuse multiple times with a parameter on the "Test Items" page.  

It's for navigating to specific buttons on a nav bar.


When I run the test through the Test Items page (via right click + run Focused Test item) it works just as I expect, which is great...I can select the param as a string and put a value in and its good to go. 


but when Im editing in the script mode editor, I cannot do the "run this routine" option, and is making me think there is an error in the code somewhere? Its greyed out and apparently is suggesting to click Code Completion, which Im not sure what it's trying to do there. Any thoughts would be very appreaciated! 


I've isolated a small chunk and  thought if I made it this basic it would work, but no - it is still greyed out.  


function teleport(NEWPARAM) {
Indicator.PushText("Navigating to Blade...");
let navigate =
let navbar =
//Clear any open blades;

Frequent Contributor

You can't run function with parameters by 'Run this routine' action. 

Try to create an additional function to run need test manually from the script.






It appears I can run the routine when I'm on the Test items page, and if I make a keyword test with params then convert it to script mode it looks just like what I'm trying to do above.. so I'm not entirely sure.


Are you saying that I can achieve what I'm trying to do by making the params in a function INSIDE of a parent function? 

Inside of a parent with no parameters I think is the point.  You can't run it the way you have it because there's no way to give it the parameters.

[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.

Ty I will try that! 

Esteemed Contributor

The routine has a parameter.  You can't run a parameterized routine using the right-click context menu because you need to have some way of indicating the value of the parameter.  Work-around: create a "harness" function that, all it does is call your routine with the proper parameter value.

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Showing results for 
Search instead for 
Did you mean: