Ask a Question

Which JavaScript engine is used for TC ?

SOLVED
NicolasD
New Contributor

Which JavaScript engine is used for TC ?

Hello All

 

I would like to know more about JavaScript engine used in TC.

I developed a Library in ES6 which works perfectly in NodeJs & Webapps on browser.
In TC, the script is executed without error, but the result is not as expected.

 

In one moment, In callstack, TC does not seen any local variable.

I expected an Array with rows, but in TC, it returns an empty arrows.

 

NicolasD_0-1627382316340.png

NicolasD_0-1627383040484.png

 

In the current screenshot, execution goes in the method add(), but nothing done.

 

I would like to understand why TC is not able to run correctly a basic JS Scripts which works anywhere?

 

Kindly Regards,

Nicolas D.

 

 

1 REPLY 1

Hello Mueller597,

 

Thanks you for your reply.

I found what was wrong.

 

I have a statement which testing my argument is an Array.

For TestComplete, my provided array is not considered as an instance of Array.

 

                            if (argv instanceof Array) {
                                argv.forEach(function ($value) {
                                    Log.message("argv = Array // " + $value);
                                    if (data.lastIndexOf($value) < 0) {
                                        if (this.callbacks && this.callbacks.add && this.callbacks.add.push) {
                                            $value = this.callbacks.add.push.call(this, $value);
                                        }
                                        Log.message("Not found -> push");
                                        data.push($value);
                                    }
                                }.bind(this));
                            }

  

My arguments passed like this, in strict sense, it's not an instance of Array (!= new Array())

 

const tablejs = require('tablejs');

function run() {
    let table = new tablejs(
        ['FIELD'], [],
        [                           // <<
            ['A'],                  // <<
            ['B']                   // <<
        ]                           // <<
    );
    
    let ndu;
}

 

I was able to fix the issue !

 

Kindly Regards,

Nicolas D.

cancel
Showing results for 
Search instead for 
Did you mean: