Side Runner argument for 'binary' not working

Viewed 383

I am trying to specify the binary path to a specific browser location as described on this website https://www.selenium.dev/selenium-ide/docs/en/introduction/command-line-runner. However the example just does not work. Running the command (with the proper path)

selenium-side-runner -c "goog:chromeOptions.binary='/path/to/non-standard/Chrome/install'"

Generates an error:

TypeError: Target browser must be a string, but is <undefined>; did you forget to call forBrowser()?

Any ideas as to what is going on here?

2 Answers

I had this error too! That section of documentation may be outdated. I resolved the error by using additional params instead.

Here is the format:

selenium-side-runner --broswerName=chrome --chromeOptions="binary='/path/to/non-standard/Chrome/install'"

And here is my example:

selenium-side-runner --broswerName=chrome --chromeOptions="binary='C:\Program Files (x86)\Google\Chrome\Application'" sitegrammarstorevariable.side 

I have an Applications folder in my $HOMEdirectory on the Mac and this worked for me:

eval selenium-side-runner -c \"browserName=chrome goog:chromeOptions.binary=\'$HOME/Applications/Google/Google Chrome.app/Contents/MacOS/Google Chrome\'\" *.side

eval is used to generalize the command to any user's home directory.

You have to set both the browser name and the path to the binary this way to make it function properly.

Related