Run a local script on Post Processors > Custom Script
exec('powershell -File C:\location\stop_mysql.ps1', (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
console.log(`stdout: ${stdout}`);
console.error(`stderr: ${stderr}`);
});
Would this work or can’t custom script access local files?
Custom scripts in Apidog cannot directly access local files. Please try this method instead: Calling other programming languages - Apidog Docs
I’m getting
PostProcessor Script Error: The pyhton command cannot be found. Please check whether pyhton has been installed and whether the relevant directory has been added to the PATH environment variable of the operating system.
but python has been added to my system variables > path
Try running the script in the console and share a screenshot with us. Also, try restarting Apidog.
pm.executeAsync('./stop_mysql.py', { command: 'pyhton' }).then(res => {
console.log('Script output:', res);
}).catch(err => {
console.error('Error executing script:', err);
});
this is my script btw
wait
wait nvm
user error
Apidog utilizes environment variables to support scripts within the application. If the application has just been installed, you may need to restart Apidog. You can also provide your custom scripts and external scripts for further assistance.