Automated Testing of OpenFin Applications with TestComplete
Learn how to get started with test automation for CEF and Electron-based OpenFin applications.
As organizations in the banking and financial services industries aim to keep up with evolving technologies, one specific development framework is gaining popularity quickly – OpenFin.
Two aspects of the OpenFin framework strike out to me: First, you can build really powerful applications with just HTML5 and still have all the capabilities of native WPF or Java applications. Consider the benefits: Fast development, easy deployment, optimal user experience not constrained by the browser, and maximum scalability. And second is OpenFin’s ability to seamlessly integrate into your existing infrastructure. Language adapters for .NET, Java and Adobe Air allow you to maintain your existing infrastructure and share contextual data between these applications, which is great from a development point of view.
As development environments for modern applications evolve, so should your test automation toolset. As a test automation engineer you should expect one tool to work seamlessly with a variety of different technologies, enabling you to build and maintain one test framework, leverage one scripting language for all your tests, and ultimately simulate a true end-to-end user flow. Great open source alternatives are available, but you need to stitch together multiple tools to perform a full test, leading to steep learning curves and maintenance headaches down the line.
In order to perform automated testing, the tool you decide to use must give you access to properties of objects in some form. These objects include labels, buttons, input fields, grid tables, and any other control that is rendered in the UI. In version 14.0, TestComplete provides you access to these objects in OpenFin applications. To test this out, I downloaded the ‘Reactive Trader Cloud’ demo from the OpenFin website and created a quick tutorial for you.
Get Started with Testing OpenFin Applications
1. Create a new project in TestComplete, and check Tested Applications box.
2. Select Reactive Trader Cloud from the list and enter the command line arguments to launch the application from TestComplete successfully.
Note: You will need to launch your application from TestComplete in order to recognize the object’s properties.
a. Specify the application under test
b. Add the required command line parameters
(If you’ve used TestComplete before, you will notice that we’ve enhanced the New Project wizard 😊)
3. Run the application in TestComplete by using the ‘Run TestedApp’ operation
4. Next, make sure that TestComplete can actually “see” the objects in the application. Navigate to the object browser and notice a bunch of panels under the “openfin” process.
5. Great! Now that the objects are visible, you can use TestComplete’s Record and Playback, Keyword-Driven Testing or scripting methods to create your test cases. I personally like to use the keyword-driven framework.
6. My simple test case is as follows - Launch the application, verify if the EUR/USD panel exists, enter text into the EUR input box, click on the BUY button, open a pop-out window, validate data and close the application.
7. After the test is run, I can view a detailed log of all the test actions.
As you can see, there was no additional setup or third-party installations required. TestComplete can work with OpenFin applications out-of-the-box.