0

I'm using Angular 9, webdriver-manager 12.1.7 and protractor 5.4.3. In our end to end tests, I'd like to be able to execute a shell script and pass the result into my test so that it can be used. The shell script requires an argument that is a result of some clicks from the test itself. Is it possible to invoke a shell script from protractor/selenium? As I discovered, this

import { ExpectedConditions as EC, browser, by, element } from 'protractor';
...
await browser.executeScript('./create_activities.sh', "arg1")

is for Javascript calls only, and results in the error

Failed: javascript error: Unexpected token '.'
Dave
  • 15,639
  • 133
  • 442
  • 830
  • Again that's outside the browser; as you note, the protractor executeScript method is to run a script *in the browser*. – jonrsharpe Dec 18 '20 at 22:04
  • This is definitely a no. executeScript and executeAsyncScript, runs a JavaScript function the runs in the browser session. – cnishina Dec 19 '20 at 01:41
  • You need to use other nodejs package to run shell script, like shelljs – yong Dec 19 '20 at 02:51

0 Answers0