Can I launch a .js file from within a Test Complete test? If so, what are the best practices and common mistakes that occur when trying to do this?
Thank you.
Solved! Go to Solution.
In addition, if yu want to play a plain .js file to execute something, you can call ms script runner (cscript.exe or wscript.exe) by command line.
Or you can register in TestedApps cscript.exe/wscript.exe and call it directly without the command line.
The command line version allows you to eventually read the console output of your .js execution.
Un sourire et ça repart
TestComplete supports test scripting, and it supports javascript as its test scripts.
From a keyword test you can use the Run Script Routine operation to run a script function.
What are you wanting to achieve in running this .js script?
1.The js script that you mentioned is done by TestComplete?
2.Or you want to run the script out of TestComplete?
If it is 1 , please do it as tphillips said.
if it is 2, I haven't any experience. But as I know, you can run js code in TestComplete during testing web.
Like 'pageObj.contentDocument.Script.eval("history.back()");'
Please check the link Run JavaScript on Web Page in detail.
In addition, if yu want to play a plain .js file to execute something, you can call ms script runner (cscript.exe or wscript.exe) by command line.
Or you can register in TestedApps cscript.exe/wscript.exe and call it directly without the command line.
The command line version allows you to eventually read the console output of your .js execution.
Un sourire et ça repart
Thanks everyone for such great help!
@KJ Which advice did you end up using? Please mark the best reply as a Solution!
Subject | Author | Latest Post |
---|---|---|