I tried the below code but it throws an error that
Caused by: :1 ReferenceError: "require" is not defined
fs.readFile('test.txt', 'utf-8',function(err,data){
if (err) {
return $log(err);
}
$log(data);
})
You are trying to use the Node.js API, which is not available in OpenTest. The proper way to read a text file is by using the ReadTextFile keyword: