Automating UI tests for Pega BPM applications

Automating UI tests for Pega BPM applications

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:

  • Shorter release cycles (i.e. time to market)
  • Less resources needed for manual testing
  • More productive time for developers
  • Low number of defects
  • Decreased maintenance costs

Technology stack

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.

The 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.


Summary

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: [email protected]


Could you expand on this "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." in a new post maybe?

回复
Sajitha Radhakrishnan

Program Management, Product Development, Agile Champion, Devops/SRE Specialist

6 年

Thanks for sharing this.. very informative

Benjamin Harper

Head of Intelligent Automation / Principal System Architect

7 年
回复
wid gnext

Software Engineer at E*TRADE

7 年

Pretty good article Ervin. Regarding the point you mentioned "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)", yes Pega doesn't come with built in UI test cases but it has Test IDs for all UI elements. At least the provision is there, it is upto the developer to generate them as best practice or not. PEGA has Ninja for Unit testing, which is just perfect for unit testing. For UI, we need to use Selenium or RSpec based automation test frameworks. As mentioned, the only tough part with UI automation testing is finding unique and reliable XPaths for each UI element. Recently, there is a chrome extension developed, which leverages PEGA provided test attributes like data-test-id, data-node-id etc. for XPath generation. You might be interested to try : Link: PEGA XPath Builder. https://chrome.google.com/webstore/detail/pega-xpath-builder/egkbiiglhcgopbejlhmekoopkjcgbgoj

Susmit Bhattacharya

Deep Tech Enthusiast | Delivering Outcome@Speed | Technology Sales Executive| MBA | AAICD

7 年

Ervin its good to see someone doing the stuffs that I was so passionate about 3 yrs back. Industry has change from then and DevOps has made a grand entry. You need to deliver Test Automation fast and should not be dependent on development avtivities. Selenium+ Cucumber is awesome if you know it and its good for developers. But there is scarcity of good resources available in the market. Hence its not scalable. I would suggest you to try TOSCA...you will achieve the same things...along with ease of scalability to Manual Testers and Business Users... If interested, I can introduce to the correct person from your location to help you out. Cheers!!!!

要查看或添加评论,请登录

社区洞察