cancel
Showing results for 
Search instead for 
Did you mean: 

Error while Calling Script Routine from another Script Routine

SOLVED
Occasional Contributor

Error while Calling Script Routine from another Script Routine

Error.PNGGetting an error while calling routine from another routine. It gets executed but in the end I get this error. Tried with semicolon as well in the end. Same error.

Error.PNG

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Hero

Re: Error while Calling Script Routine from another Script Routine

What does your export look like in the Login script? Are exporting the testLogin function?


Thanks,
Carson

Click the Accept as Solution button if my answer has helped

View solution in original post

Community Hero

Re: Error while Calling Script Routine from another Script Routine

FYI, I tried something very simple.  I have one unit called "Login" that I did the following:

 

function testLogin(){
    Log.Message('test login')
}

module.exports = Login

I then created unit that looks like this

 

var Login = require('Login');

function test1(){
    Login.testLogin()
}

When I run test1 in that second unit, I get no error.  So... this tells me that there's something going on in the "Login" unit that you are exporting that we can't see.  Can you share all your code, please?

 

Thanks.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available

View solution in original post

4 REPLIES 4
Community Hero

Re: Error while Calling Script Routine from another Script Routine

What's in the "Login" unit that you're set up for?  How do you have the modules.export set up?  It might be helpful to see how that's working to know better how to help you.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Community Hero

Re: Error while Calling Script Routine from another Script Routine

What does your export look like in the Login script? Are exporting the testLogin function?


Thanks,
Carson

Click the Accept as Solution button if my answer has helped

View solution in original post

Community Hero

Re: Error while Calling Script Routine from another Script Routine

FYI, I tried something very simple.  I have one unit called "Login" that I did the following:

 

function testLogin(){
    Log.Message('test login')
}

module.exports = Login

I then created unit that looks like this

 

var Login = require('Login');

function test1(){
    Login.testLogin()
}

When I run test1 in that second unit, I get no error.  So... this tells me that there's something going on in the "Login" unit that you are exporting that we can't see.  Can you share all your code, please?

 

Thanks.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available

View solution in original post

Occasional Contributor

Re: Error while Calling Script Routine from another Script Routine

Thanks so much. I was maing a mistake while exporting. Followed your methid and it has helped

New Here?
Join us and watch the welcome video:
Watch the new Interview
Top Kudoed Authors