Calling JavaScript routines in TestComplete
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2020
12:00 PM
12-24-2020
12:00 PM
Calling JavaScript routines in TestComplete
Hi Folks,
I have been trying to use //[Commonunit] and //[MainUnit] to use one unit into another but it's not working.
Let's say i have one unit called A and another called B. I'm trying to pass call constructor from B.
A:
//[A]
var u, p;
function A(u,p){
this.u = u;
this.p = p;
}
module.exports.A()=A;
B:
//[B]
var c = require(A);
c.A("abc","xyz");
I don't know how to use commonunit and mainunit at the beginning.
Also, I'm using BDD cucumber and want to adopt modularity in my scripts but gherkin supplies parameters in it's when, then statements in feature file. Is there a way I can use variable instead of values in gherkin feature file and supply data from some other unit such as from executing constructor etc. like in oop.
Thanks
I have been trying to use //[Commonunit] and //[MainUnit] to use one unit into another but it's not working.
Let's say i have one unit called A and another called B. I'm trying to pass call constructor from B.
A:
//[A]
var u, p;
function A(u,p){
this.u = u;
this.p = p;
}
module.exports.A()=A;
B:
//[B]
var c = require(A);
c.A("abc","xyz");
I don't know how to use commonunit and mainunit at the beginning.
Also, I'm using BDD cucumber and want to adopt modularity in my scripts but gherkin supplies parameters in it's when, then statements in feature file. Is there a way I can use variable instead of values in gherkin feature file and supply data from some other unit such as from executing constructor etc. like in oop.
Thanks
Solved! Go to Solution.
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2020
07:37 PM
12-24-2020
07:37 PM
Please try it below capture.
About gherkin, I haven't done it before. Sorry, I can't help you.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2021
04:22 AM
01-07-2021
04:22 AM
Great! thanks, works fine.
I'm trying to make my scripts to be able to some OOP things, would that be possible?
