Example of C#.NET test code with Chrome Driver on OpenFin Runtime
OpenFinAppTest.cs has sample code for testing HTML5 components and OpenFin javascript adapter in Hello OpenFin demo application.
Since all HTML5 applications in the OpenFin environment need to be started with OpenFin API, chromeDriver.get(URL) is not supported. Test code needs to start HTML5 app before connecting to Chromedriver.
Given there can be multiple applications/windows active in OpenFin Runtime, tests must begin by selecting the targeted window. Each test script has a function that selects the window by matching it's title.
Since the OpenFin Runtime is started by OpenFinRVM, Chromedriver does not have direct control of the OpenFin Runtime. OpenFin app needs to be started by the test code with SeleniumHelper.LaunchOpenFin(). Once a test is complete, it needs to shut down OpenFin Runtime by running javascript code "fin.desktop.System.exit();". driver.quit() does not shut down OpenFin Runtime since it does not have access.
If tests are run with OpenFin Runtime version 5.x.x.x, a patched version of ChromeDriver is needed. Execuable of the patched version is included in this repo as chromedriverOF.exe. It can be selected to run this example by changing ChromeDriverFileName in App.config to chromedriverOF.exe.
In Summary
- Tests must target specific windows
- OpenFin RunTime must be shut down after a test is completed
- Install Hello OpenFin app
- Clone this project and load and build it in VisualStudio 2015
- Run all tests in TEST->RUN->All Tests in VisualStudio 2015
MIT
The code in this repository is covered by the included license.
However, if you run this code, it may call on the OpenFin RVM or OpenFin Runtime, which are covered by OpenFin’s Developer, Community, and Enterprise licenses. You can learn more about OpenFin licensing at the links listed below or just email us at [email protected] with questions.
https://openfin.co/developer-agreement/
https://openfin.co/licensing/
Please enter an issue in the repo for any questions or problems.
Alternatively, please contact us at [email protected]