In most cases, you can use npm packages directly within your Rapise test. Since version 8.0, Rapise offers a straightforward way to integrate essential packages into your testing framework:
- Open Tools → npm console. This launches the npm console, which installs packages globally for the current test or testing framework.
- With the console open, run the
npm install <package name>
command for all the required packages.
This method is typically sufficient to install the necessary packages.
Note: If you need to install a module globally on a machine then do npm install <package name> -g
; -g switch is a standard npm switch for global installation. Global modules are placed into C:\ProgramData\Inflectra\Rapise\npm\node_modules
.
Alternatively, you can run NodeJS as an external process. This approach allows you to work with different module and package formats in NodeJS and even use different versions of Node itself.
For a working example and a more detailed explanation, please refer to the Inflectra GitHub repository:
https://github.com/Inflectra/rapise-samples/tree/master/CallingNodeJs