Add browser configuration
Local browers
By default, JOSF already has four brower types preconfigured for your installtion; Chrome, Chrome (Headless), Firefox and Edge. If you want to add another type of browser, perhaps with specific configuration or profiles, you can add and manage browsers from the Browsers panel in your JOSF Preferences.
Switching to another browser is easy, by toggling either the pre-configured Remote Firefox, Remote Internet Explorer or Remote Chrome options. If you’ve configured JOSF CLI, then Headless Chrome is also an available option to execute your tests in.
Download latest browser drivers
Each browser requires specific drivers that fit your system. This process is automated, but it could happen that your local browser drivers are outdated. When this happens, press the Download drivers button for each browser type to redownload the correct drivers and your testing can continue.
Remote browser platform
JOSF supports a number of cloud-hosted browser providers which you can add from the Browser configuration pane. You need to add your provider first, to add a specific browser/ operating system next.
BrowserStack
Add BrowserStack as a new configuration
To add Browser Stack as a platform provider, follow these steps:
- Log into BrowserStack and click the Access Key button
- Note the User Name and Acces Key (blurred in the image)
- Open JOSF and go to the browsers preferences
- Select ➕ Manage… Add BrowserStack
- Paste the username and access token in the fields below
- Enter hub.browserstack.com/wd/hub as the Data center
- Press Save to accept the settings.
Add new BrowserStack browsers
Now that BrowserStack is added, a new option from the ➕Manage… menu, is added called “Add BrowserStack browser”. To add new browsers follow these steps;
- Open the BrowserStack Capability Generator: https://www.browserstack.com/automate/capabilities
- Make sure the W3C Protocol and NodeJS is selected and choose your preferred configuration. In this example we have selected an iOS/iPhone 14/Safari configuration.
- To let JOSF understand the configuration, we need to adjust the generated capabilities to an accepted format:
- Remove
var capabilites =
- Replace all single quotes
'
with double quotes"
- remove any trailing comma’s
,
before any closing curly bracket}
- Remove
Note that there are many more settings that can be applied. The same rules mentioned here applies to those settings aswell.
Review the below before/after comparison
- Open JOSf and go to the browser preferences
- Select ➕Manage… Add BrowserStack browser
- Give the browser a meaningful name and select the correct browser type from the list
- Paste the adjusted capabilities into the capabilities section and press Save.
- Set the newly added browser as the active one and start testing!
Sauce Labs
Add Sauce Labs as a new configuration
To add Sauce Labs as a platform provider, follow these steps:
- Log into Sauce Labs and open your User Settings
- Copy the Ondemand URL
- Open JOSF and go to the browsers preferences
- Select ➕ Manage… Add Sauce Labs configuration
- Paste the Ondemand URL in the Connection string field
- Press Save to accept the settings
Add new Sauce Labs browsers
Now that Sauce Labs is added, a new option from the ➕Manage… menu, is added called “Add Sauce Labs browser”. To add new browsers follow these steps;
- Open the Sauce Labs Platform Configurator on the Sauce Labs platform
- Make sure W3C and node.js are selected and choose your preffered configuration. In this example we have selected MacOS 12 with the Safari browser
- To let JOSF understand the configuration, we need to adjust the generated capabilities to an accepted format:
- Remove
const capabilites =
- Replace all single quotes
'
with double quotes"
- remove any trailing comma’s
,
before any closing curly bracket}
- Replace <your build id> and <your test name> with something meaningful
- Ignore the
const browser
part. This is not necessary in JOSF
- Remove
Note that there are many more settings that can be applied. The same rules mentioned here applies to those settings aswell.
Review the below before/after comparison
- Open JOSf and go to the browser preferences
- Select ➕Manage… Add Sauce Labs browser
- Give the browser a meaningful name and select the correct browser type from the list
- Paste the adjusted capabilities into the capabilities section and press Save.
- Set the newly added browser as the active one and start testing!