Forum Discussion
HKosova
SmartBear Alumni (Retired)
VirtualWorld
9 years agoNew Contributor
Hi,
I'm trying to do the same thing in JScript but I can't seem to find a solution.
Can you please help me?
Kind regards,
Thomas
P.s. Sorry for bumping an old post.
- joseph_michaud9 years agoModerator
Does the JScript eval method not work for you?
function mytest() { var name = "Test2"; eval("KeywordTests." + name + ".Run();"); }
- VirtualWorld9 years agoNew Contributor
Sorry, I didn't know of the eval function within JScript.
I'm now using the square-bracket way and it works perfectly :)
Thanks!
- HKosova9 years agoSmartBear Alumni (Retired)
Another way is to use the square bracket syntax:
// JScript
var test_name = "Test1";
KeywordTests[test_name].Run();
Related Content
- 7 months ago
Recent Discussions
- 2 days ago