CheshireCaat / bas-remote-node

NodeJS library, which allows you to automate Google Chrome browser.
MIT License
28 stars 7 forks source link

Error during running default example. #3

Closed bablosoft closed 4 years ago

bablosoft commented 4 years ago

Execute script provided as quick example

const BasRemoteClient = require('bas-remote-node');

//Set script name, and optionally auth details (login, password) 
const options = {
    scriptName: 'TestRemoteControl' /* or 'YourScriptName' */
};

//Create client
const scriptClient = new BasRemoteClient(options);

//Start application, this may take some time
await scriptClient.start();

//Set parameters for function
const scriptParams = {
    Query: 'cats'
};

//Run function and wait for result
//Following function will return list of strings
const result = await scriptClient.runFunction(
    'GoogleSearch', /* or 'YourFunctionName' */
    scriptParams);

//Iterate and output results
result.forEach(link => {
    console.log(link);
});

await scriptClient.close();

Following error will be thrown:

(node:18544) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, rmdir '3afb1'
    at Object.rmdirSync (fs.js:684:3)
    at fs.readdirSync.map.filter.map.filter.forEach (d:\dev\BASRemoteControl\node\node_modules\bas-remote-node\lib\services\engine.js:104:20)
    at Array.forEach (<anonymous>)
    at EngineService._clearRunDirectory (d:\dev\BASRemoteControl\node\node_modules\bas-remote-node\lib\services\engine.js:103:14)
    at EngineService.start (d:\dev\BASRemoteControl\node\node_modules\bas-remote-node\lib\services\engine.js:45:14)

Please do at least initial testing before releasing/doing commit.

CheshireCaat commented 4 years ago

I was able to repeat the error, made a fix in https://github.com/CheshireCaat/bas-remote-node/commit/52134389eec3291fcb0c86cbdb66a25839f79acf

bablosoft commented 4 years ago

Thanks, works after fix.