OpenFin Test on Testable
Introduction
Check out the Getting Started with OpenFin guide for a quick introduction on how to run your test script. Also check out our Selenium overview guide to better understand how Selenium tests run on Testable in general.
This document goes into further detail on the various options provided for running OpenFin test scenarios.
OpenFin tests can be written with a variety of the Selenium bindings that Testable supports. We provide an example project: openfin-wdio-testable-example. It is adapted from openfin-wdio-testable-example for Testable.
The example shows a Webdriver.io example for testing your OpenFin application. For the most part this is no different than any other Webdriver.io test with a few notable exceptions in the RunOpenFin.bat
and wdio.conf.js
files as discussed in the README file for the example project.
In your scenario make sure to choose Advanced Settings => Runtime Requirements = Windows if you want to run in the default OpenFin supported OS: Windows.
Chromedriver | OpenFin Version Mapping
Each version of OpenFin wraps a different version of the Chromium runtime. As a result it is best practice to use the Chromedriver version that also aligns with that Chromium version.
Testable takes care of automatically launching the right version of Chromedriver by inspecting your OpenFin config file for the runtime version number. When running locally though, this mapping table can be helpful:
OpenFin | Chromedriver |
---|---|
v19 | v89.0.4389.23 |
v18 | v87.0.4280.88 |
v17 | v85.0.4183.87 |
v16 | v83.0.4103.39 |
v15 | v80.0.3987.106 |
v14 | v78.0.3904.105 |
v13 | v76.0.3809.126 |
v12 | v2.37 |
v11 | v2.37 |
v10 | v2.37 |
v9 | v2.34 |
v8 | v2.5 |
OpenFin v13+ vs Earlier Testing
Before OpenFin v13/Chromedriver v76, we could set an alternate “Chrome” binary for Chromedriver that would launch OpenFin. It uses the debugging port that Chromedriver normally passes to Chrome as an argument (–remote-debugging-port) to enable communication between Chromedriver and the OpenFin runtime.
Chromedriver v76 and later (OpenFin v13+) no longer assign a remote debugging port for Chrome in advance and instead Chrome chooses one itself. So intercepting this argument passed from Chromedriver to Chrome no longer works. Instead we must launch OpenFin BEFORE our test starts on a chosen debugging port and then let Chromedriver know that port via the debuggerAddress chrome option. This tells Chromedriver to connect to our already running OpenFin instance.
When running on Testable, we automatically detect that your application runtime is v13+ and allocate a port for you. This is accessible as the CHROME_PORT environment variable in your test.
See our example project for a setup that supports both v13+ as well as earlier versions of OpenFin.