# CLI Browser Override

When running locally via the CLI, you can specify a different browser than the default (Chrome). This guide walks through how to configure each of the available browsers. Note that you must have the appropriate operating system for any browser that is OS-specific.

# Firefox

To run tests via the CLI on Firefox. You must install the desired version of Firefox and the matching Geckodriver(.exe).

Geckodriver must be executable and locatable in your PATH.

Now, using the Bionic Metrics CLI run the following command with --browser to override the browser

bionic start --browser firefox

From your dashboard, you should now be able to run a test suite via the overriding browser with the run local button:

Run Local

# Safari

When using the Bionic Metrics CLI, you can override the browser to run tests from a different browser such as Safari.

To do so, Safari requires some setup to work with Selenium Webdriver.

First, due to a number of issues introduced with Safari 13, you will need to install the Safari Technology Preview release 97 or greater.

Note: this guide was written for MacOS Catalina (10.15).

Next, from a terminal, enable safaridriver with:

safaridriver --enable

Now open Safari Technology Preview

Note: this is different from regular Safari which comes pre-installed on your Mac and has a purple icon:

Safari Technology Preview

Once opened, enable Allow Remote Automation via the Develop menu:

Allow Remote Automation

Next, if you plan on downloading any files automatically, set the download directory for Safari Technology Preview to /private/tmp. From the general preferences tab, select the File download location

Safari File Download Location Then use the command [Shift][Apple][g] to open a path editor and type /private/tmp. Hit Select and confirm that the file download location now shows as tmp.

Under Preferences > Website > Download set the default for When visiting other websites to Allow Allow Downloads

Now, using the Bionic Metrics CLI run the following command with --browser to override the browser

bionic start --browser safari

From your dashboard, you should now be able to run a test suite on your mac with safari using the run local button:

Run Local

# Edge

To run tests via the CLI on Windows and Microsoft Edge. You must install correct version of MicrosoftWebDriver.msi for your machine.

Now, using the Bionic Metrics CLI run the following command with --browser to override the browser

bionic start --browser edge

From your dashboard, you should now be able to run a test suite via the overriding browser with the run local button:

Run Local

Note If you are downloading files via any tests and using macros such as fileExists you must do the following: Set the default download directory for Edge to be the Windows Temporary directory (equivalent to /tmp on Unix). One way to find the correct path is to use the NodeJS os.tmpdir() method:

$> node
const os = require('os');
console.log(os.tmpdir());

This will usually result in a path like: C:\Users\user\AppData\Local\Temp Now set that as the default download directory via Settings:

Edge Download Location

Also disable "Ask me what to do with each download":

Edge Download Prompt Disable

# Internet Explorer

To run tests via the CLI on Windows and Internet Explorer. You must install correct version of IEDriverServer.exe for your machine.

Make sure IEDriverServer.exe is in your PATH.

Also, make sure to follow all the steps here to ensure IEDriverServer.exe does not crash after starting:

Internet Explorer Webdriver Configuration

Now, using the Bionic Metrics CLI run the following command with --browser to override the browser

bionic start --browser edge

From your dashboard, you should now be able to run a test suite via the overriding browser with the run local button:

Run Local

Note If you are downloading files via any tests and using macros such as fileExists you must do the following: Set the default download directory for Edge to be the Windows Temporary directory (equivalent to /tmp on Unix). One way to find the correct path is to use the NodeJS os.tmpdir() method:

$> node
const os = require('os');
console.log(os.tmpdir());

This will usually result in a path like: C:\Users\user\AppData\Local\Temp Now set that as the default download directory via Settings.

You may also need to disable prompts for downloads.

If you have any questions, please contact us on Slack or support@bionicmetrics.com