Smart Advice. Agile. Personalized. Transparent.

Much ado about testing OPA interviews

OPA interviews are designed to be:

  • Easy to develop, and
  • Easy to maintain

OPA includes built-in automated testing capabilities for ensuring your rules deliver expected results with every iteration.

Nevertheless, for extra guarantees of consistent behaviour between versions, some customers choose to build automated test cases for OPA interviews.

This can be particularly helpful if you have added JavaScript interview extensions or custom controls to your OPA interviews, and want to make sure the developers of those controls don’t introduce regressions in between releases.

Before you go down this path, the first question you should ask yourself is:

  • Does my team have the skills needed to do test automation?

OPA includes comprehensive tools for testing the rules that sit behind an interview, and these don’t require any particular testing expertise to use.

But web UI testing frameworks like Selenium require strong scripting and HTML knowledge. You should be sure you will have the ongoing skills in your team to design, develop and maintain that test suite.

Most large organizations already have strong quality assurance teams in place. They are the first people you should talk to before you go any further down the path of trying to automate interview testing yourself.

OK, so if you’re still reading, then either you don’t have an in-house team, or they’ve told you they are too busy and you need to work it out on your own.

Keep in mind that test automation is a skill that takes time to learn properly.  There are some good tutorials on the web for Selenium, which is a tool Oracle uses for testing our products between versions.

The basic steps to follow are:

  1. Define the OPA interview that you want to test
  2. Identify the test cases you want to automate
  3. Build your Selenium test cases
  4. Automate the process of deploying new OPA versions
  5. Automate the process of running the test cases against each OPA interview version

This is a pretty standard approach to continuous integration and delivery.

There are a few considerations to keep in mind when building Selenium test cases for OPA interviews:

  • It will be easier to build the tests if you have something that makes it easy for the test script to identify each control on the interview screen – for example, the question text associated to the control

Control on OPA interview screen:

Blank drop-down menu

Selenium test script snippet:

questionText = “What is the household’s location”;
webDriver.findElement(By.xpath("//label[contains(text(), \"" + 
		questionText + "\")]"));
  • Similarly, if your team has designed interview extensions, you can put in custom CSS classes to make it easy for the test scripts to find them, too

Interview extension JavaScript snippet:

    style: {
        nextButton: {
            className: "custom-next-button"

CSS snippet:

nextButton: {
	className: "custom-next-button"

Selenium test script snippet:


In summary – OPA interview test automation can be a useful addition to ensuring high quality advice over time when using OPA, particularly when using custom developed JavaScript interview extensions. But make sure you have the skills you need to develop and maintain them before you get started down this path.



Title photo credit: Mari Lezhava via Unsplash

Join the discussion

Comments ( 2 )
  • Richard Napier Wednesday, May 27, 2020
    Hi. Thanks for the article. Two questions for you : what's your view on the new (reborn) Selenium IDE browser addin as a low code way to get some automation for Interviews, and secondly, more importantly, the methods described here are fine for a single language interview but if we have multiple languages that will mean lots more complex XPath statements just to repeat something we have already done in another language. Is there any plan to provide a selenium integration (I'm thinking like the Oracle Siebel CRM integration, which lets developers add properties to HTML tags to facilitate recording with unique reliable ids) which would improve the multi-lingual situation greatly.
  • Fiona Guy Tuesday, June 16, 2020
    Hi Richard. Thanks for your comment. Different testing tools have different testing capabilities so the choice will often come down to the specific testing requirements of a project. We would certainly like to include more generic testing hooks in future versions of Intelligent Advisor. Happy to discuss details offline.
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.