Selenic: of or relating to Selenium.
That, in its most elemental definition, describes Parasoft’s new tool for UI testing. Called Selenic, the tool rounds out Parasoft’s test offerings, from unit testing to API testing up to the user interface.
Selenic monitors Selenium tests, discovering errors in the user interface, making remediation recommendations into a developers’s IDE and doing its own self-healing right in the integration pipeline. The tool is in beta testing now and Parasoft announced a pre-release today at the STARWEST testing conference in Anaheim, California.
RELATED CONTENT: Testing all the time
Parasoft created Selenic after asking customers how they test their UIs, to see what it could do to leverage customers’ existing UI test practices. According to Mark Lambert, vice president of product management at Parasoft, the company didn’t realize how big Selenium is, with 64 percent of organizations responding to their survey saying they use or are moving to Selenium. Another 7 percent use open-source frameworks or custom tools, and 14 percent are doing manual testing. The remaining 15 percent use commercial tools — Tricentis, SmartBear and Parasoft’s SOAtest with its UI testing capabilities.
The open-source Selenium project is 15 years old, and there are those who say it wasn’t built to solve the problems that today’s new architectures present. But, according to Max Saperstone, director of software test automation at consulting company Coveros, companies have been looking to replace Selenium with their own tools for years and have not seen significant traction to do so. “Yes, there are some problems [with Selenium], and there are some tools trying to fix some of them,” Saperstone said, “ but it’s more in the underlying way that people are trying to do automation than the tools themselves.” People, he has observed, are not using Selenium correctly for test automation.
“It really is a matter of, a mentality shift, from going from ‘Hey, I can’t just take my manual tests and automate them.’ That’s not the right way to be doing automation,” Saperstone said..” You need to put more thought into it. The reason that there’s all this maintenance time that I’ve seen in the field is because people take this one- or two- or sometimes 10-page long test case and they convert that directly into Selenium. And then they say, well I have 1,000 different steps I just went through and so I have to maintain all of those. But if the second one breaks, those other 998 I never even get to and so I have no idea if they actually work or not.”
Other challenges to doing UI test automation are creating reliable locators and wait conditions, maintaining tests after UI changes, discovering and debugging automation failures, the test suite execution time, and the knowledge and skills to create scripts. These are the issues Parasoft is looking to address with Selenic.
“A lot of these web applications have dynamic elements within them, with dynamic internal IDs, and it’s difficult to figure out how to correctly locate the element on the page,” Parasoft’s Lambert explained. Next, he added, “is handling the maintenance of your test suite when the UI changes. Changes to the UI — the move of a button, the change of label — can have significant roll-on impacts to the test suite, and to be able to update those tests in a short period of time was very challenging.”
Selenic is built using the Page Object Model, which is a design principle for creating Selenium tests. Chris Colosimo, product manager at Parasoft, explained: “You have your script, and as it traverses your application, it’ll click on buttons, inputting in the fields — each one of those elements represents on a page of your application. In the Page Object Model, the way you write your Selenium tests is you build these pages as objects and then on each individual object, you reference all your buttons. You can define where a button on a page is once and use it multiple times in your application. It just makes maintenance much easier.”
Saperstone said, “Developers are going to change their locators, and testers don’t find out until it dumps into the pipeline, or until it’s even handed over to them, and it’s kind of just blind guessing… why don’t my tests work anymore? What did they change? I spent weeks and months working with some organizations just trying to get the developers talking to testers so it doesn’t happen all the time. I still believe that’s the ideal solution — communication between the teams. [Selenic] does in fact make it so that when that does happen, it’s not this ‘we don’t know what’s broken; I have to do a lot of this analysis.’ It just kind of did this nice self-healing of the broken locators, which again is fairly cool, I would say some of the products I’ve worked on, I’ve literally spent half of the maintenance time to put in to keeping scripts up to date literally just updating locators, which is an awful and tedious thing to have to do”.
In a demo, Colosimo showed Selenic monitoring a Selenium test and found that a test failed due to a bad locator. Selenic captured a screen shot to show where the test failed; something was wrong with a field. Selenic’s Smart Selenium Testing feature, which uses AI for test stability and maintenance, makes a recommendation on how to fix the test. It turns out the test failed because a button could not be clicked upon, and the recommendation was to update the locataor in Selenium with another specific locator, that, Colosimo said, had “a 96 percent confidence factor that says these are the correct locators to use.”
He explained that the AI engine used analysis of previous test success to construct a new, smart locator, and prioritizes suggested fixes. Those recommendations, Colosimo added, can be imported directly into the IDE — Eclipse in this instance — and take you right to the line of code to make the change. Selenic, though, can self-heal the Selenium code in the JVM at runtime, selecting the best locator and swapping it out so the test doesn’t fail, allowing developers to validate the application without losing the time to make the fix.
Lambert said that Parasoft has enhanced its recorder to capture actions against the UI directly from the browser. “The self-healing stops the nightly build from breaking unnecessarily; the AI recommendations help you maintain and enhance the test case, cutting down your maintenance time by 20 percent,” he said. “These are two primary value propositions with Selenic.”
He went on to say that, “What’s important is, that object model is the way you create more maintainable tests. As we create additional recordings, we add that to the Page Object Model, so we’re not creating scripts to run in isolation. They’re actually reusing the same object contacts, and that’s really the value of the Page Object Model.”
Colosimo noted that Selenic enables users to get to the code when it’s needed, describing why Parasoft eschewed the scriptless approach. “The reality is, every UI is different… the widgets, the pulldowns. In 80 percent of the applications out there, at some point you’re going to have to do something complicated. By having direct access to code — Selenium code and a massive Selenium community — it almost becomes easier to use than the scriptless approach, because you can know what to do when you get stuck.”
Coveros’ Saperstone commended Parasoft’s positioning of Selenic as a complement — not a replacement — for Selenium. “ A lot of companies I work with, it’s all about, ‘Stop using Selenium, and migrate over to our tool. Use our stuff.’ And, if you don’t like it, it’s kind of too bad,” he said.” All of your code is now with us. That’s one of the really cool things about Selenic. You just add it as another command-line parameter to whatever you currently have going, as long as it’s Selenium and Java. If you want to stop using it, great. Your tests still work, you just no longer get that one piece of functionality, that’s providing locator healing, etcetera. So you don’t have to make this huge investment in order to get the benefits. That I think is one of the most unique things about it, because most tools are all about, well, let’s get you over to use our software, which is more retention-based than anything else. For me, as someone who loves using open-source tools, that’s a little bit frustrating.”
Selenic will be on a four-times-per-year release cycle, Lambert said, with a 2019.1 release due Oct. 31, and a 2019.2 release set for Dec. 19. In mid-Q1 next year, 2020.1 will be released.