Forum Discussion
HKosova
SmartBear Alumni (Retired)
VirtualWorld
10 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_michaud10 years agoModerator
Does the JScript eval method not work for you?
function mytest() { var name = "Test2"; eval("KeywordTests." + name + ".Run();"); }
- VirtualWorld10 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!
- HKosova10 years agoSmartBear Alumni (Retired)
Another way is to use the square bracket syntax:
// JScript
var test_name = "Test1";
KeywordTests[test_name].Run();
Related Content
- 10 months ago
Recent Discussions
- 4 days ago
- 4 days ago