Forum Discussion

mortenb123's avatar
mortenb123
Contributor
5 years ago

import nodejs modules

Hi

I've written a very basic login module in node.js, which works fine, but I need the following base modules enclosed:

var exec = require('child_process').exec;
var stream = require('stream');

is this possible, there is nothing about importing modules in

https://support.smartbear.com/testcomplete/docs/scripting/specifics/javascript.html 

 

testComplete give me this:

Error: Unable to find the specified module

Thanks

 

 

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    TestComplete is not the same type of environment as a regular IDE.  If you want to include external JavaScript code into TestComplete, you need to bring the units into TestComplete itself.  It doesn't consume nodejs like a web browser would normally.

     

    So "child_process" and "stream" are JS modules that you would need to add to the TestComplete project via the Add -> Existing Item dialogs.