MILINDB
22 days agoNew Member
Getting error message as "Functionname is not defined".
Hi, I have created two .js files in the project, and they are included in the project. I am trying to call a function from one file into another. But it is giving me an error message as "Functionname...
- 21 days ago
Hello MILINDB,
There are a few ways to do this. I prefer using require.
- At the top of the file you need the call the function...
- const _mainMenuDefs = require("mainMenuDefinitions");
- At the bottom of the file you want to export from...
- module.exports.mainMenuDefs = mainMenuDefs;
- module.exports.mainMenuDefs = mainMenuDefs;
This can be done manually or using the option in test complete...
https://support.smartbear.com/testcomplete/docs/scripting/calling-routines/declared-in-another-unit/from-gui.html
You can also use (Legacy) USEUNIT... If you find my posts helpful drop me a like! 👍 Be sure to mark or post the solution to help others out and/or to credit the one who helped you. 😎
- At the top of the file you need the call the function...