Agile development methods are ubiquitous today. Stand-ups apart what makes agile agile is being able to embrace and deliver changes . The hard part is to deliver the changes without breaking existing functionalities. To be confident that a change doesn’t break existing functionalities thorough testing is the best practical solution.
Testing is what makes the difference. Problem is that testing takes time and effort especially if it is done manually. Manual testing is error-prone and slow. A complete regression test done manually for an average application can take several days. A natural solution to the problem is automating the tests.
Web based startups and companies have already realised this problem and invested heavily into devops. Techniques such as automated testing, enabled them to achieve extremely short release cycles.
Pegasystems is a leading BPM / Case Management platform provider. As leaders they are at the forefront in offering automated testing capabilities in the BPM space. Testing Pega BPM based applications from the UI is still a challenge however.
At Saltech Consulting we faced the problem at a client to automate the browser based UI tests. Before starting we asked ourselves why should we do it. The benefits were clear:
We decided to apply best practices from the industry. A popular choice to implement automated UI tests is to use Business Driven Development (BDD) – see Gherkin language – with Selenium. There are many options for the intermediary layer between the Gherkin features and the Selenium scripts. We picked a Python implementation, Behave.
After several iterations we realised that there are a lots of patterns. Hence, we decided to create a framework.
One of the first thing that we realised was that it’s useful to replicate Pega’s UI model. We created an interface for each UI rule. Harnesses, Sections and different Controls (Autocomplete, Dropdown, etc) were all abstracted. This interface allowed us to apply our testing solution even on applications that weren’t built with automated UI tests in mind (no Test IDs for UI elements).
The other important challenge was more technical in nature. Static web applications are relatively easy to test, but most web applications today are interactive. The elements can change even after the page finished loading. Our solution was to re-bind the elements when the dreaded Stale Element Reference Exception appeared. It works transparently.
The end result is a framework that can be set up and configured within minutes. Simplicity was achieved without a compromise in richness of features or scalability. The solution scales well for production-like applications. It is version controlled (Git) and compatible with devops tools. We’re running our test regularly on a Jenkins server.
Additionally, we’ve integrated a Rest API interface to the Pega BPM engine. That made possible to combine testing with data from the UI and the back end.
Agile best practices can be applied to web applications built on the Pega BPM platform. There’s no need to compromise in automated testing capabilities.
If you’re interested in our automated testing framework solution, please reach out to us via email: contact@saltech-consulting.com