Forum Discussion
Hi Robert,
Thank you for your quick answer. I am very new in Test Complete so this definitely helps me. Anyway, so when I use //UseUnit, I don't need to export/import them? Can I use //USEUNIT in javascript?
Thanks,
Correct, with //USEUNIT you don't need to the export/import stuff and it is available in JavaScript in TestComplete
- CSL7 years agoContributor
Awesome, but I'm wondering what is the purpose of import/export then. Why does TC even have that? just curious.
Thanks, I'll give //USEUNIT a try.
- tristaanogre7 years agoEsteemed Contributor
Import/export is part of JavaScript, usuable outside of the TestComplete environment. so, it's not a matter of it being something that TestComplete does but just native to JavaScript.
TestComplete includes the //USEUNIT support for those situations where someone has converted a JScript project to JavaScript so that little editing needs to be done. THAT is part of TestComplete.
As mentioned, you CAN use modules.export to export an object... There's a few different ways you can do that, but, in essence, anything you want available in other units needs to be exported somehow if you're going to go that route.
See https://support.smartbear.com/testcomplete/docs/scripting/calling-routines/declared-in-another-unit/javascript.html- CSL7 years agoContributor
Thanks
Related Content
- 10 months agolodecesa
Recent Discussions
- 10 hours agosimonaferrara
- 19 hours agoSubhraDas