I am trying to execute powershell script inside protractor test
Protractor spec.ts
it("Should Execute Powershell Script", async () => {
browser.get('http://mywebsite.com')
var spawn = require('child_process').spawn;
var child = spawn('powershell.exe', ['-noexit', './test.ps1']);
});
test.ps1
$wshell = New-Object -ComObject wscript.shell;
$wshell.AppActivate('Chrome')
$wshell.SendKeys('Ganesh Hegde')
$wshell.SendKeys("{ENTER}")
The powershell script is not getting executed could you please help me?
sendKeys. stackoverflow.com/questions/19914915/…async. I originally did not have that and it was working. When I added theasynckeyword and setSELENIUM_PROMISE_MANAGER: false,in my config it stopped working. I removed the config property andasynckeyword from the test and it started working again.