📜 ⬆️ ⬇️

Oracle OpenScript: automated functional testing system

Good day habr. I want to start with a small introduction, as to my first post on the resource. I read Habr for a long time and thought about registration from time to time visited, but broke about iron "and why?". The simple desire to respond to this and that, thank God, was not enough. Apparently I squeezed out a troll from myself. And then one day I realized that I had some knowledge that I should share with others. At least in order to always know where I can find it, if I forget myself. True, and this was not enough. The last straw was the article of one person to whom I wanted to say thank you, not for the article, but for the way of thinking and the fact that he generally is. Here I realized that without registration I could not do this in any way.

Now I come directly to the topic.

How it all began


About a year ago I changed jobs and at the new place I was offered to sort out an interesting question, namely the organization of automated functional testing of Oracle Siebel CRM using Oracle OpenScript. “Why not?” I thought. By that time, I knew almost nothing about functional testing, about test automation, I had a very superficial idea about Siebel, which I learned about to exist for about a month as soon as I completed basic training on it and, of course, I did not know anything about OpenScript. That is absolutely no prerequisites to think that may not work. I love such tasks and usually know how to cope with them.
')
There was no doubt that I chose a tool for testing, since I knew almost nothing from the field of testing or about the system itself and did not pretend to evaluate this or that solution. I briefly googled what else happens, found references to some tool from Microsoft, another one that I had already forgotten, read reviews, charged with positive - what got me exactly the same and went to the barricades.

The barricades were from Oracle. As for OpenScript and testing in general. Functional, automation, everything. It was a fun pastime, fortunately, unlike many experts, I prefer to read the instructions before the first application, and not when everything is broken. I will not lie that I read everything at all and, all the more so that everything I read immediately understood. But a certain vision has taken shape.

So, what is Oracle OpenScript


First, a summary for those who may not know about Siebel and how it works. Of course, it’s better to search for details in Google, in this case one important feature: Siebel how the system works on its servers and communicates with the user via the web interface. That is, the Siebel user always deals with the system only through a browser, there are no other options. And until recently it was only IE or FireFox 3.0 due to the fact that everything works on ActiveX. The theme of how exactly it works on IE and how the browser version affects this work - a separate opus for weeping Yaroslavna. But the point that I want to convey: our functional testing is testing the user experience through the browser. Even if it is more correct to say - emulation of the user through the browser. And this means that OpenScript is essentially a tool for interacting with the browser in automatic mode.

Running far ahead for those who are in the know of the Sibelean affairs, I will say that I did not check the work of OpenScript with OpenUI. Although I do not see the problems of their interaction, there has been no practical verification yet.

Briefly, how it works

image
That is, we have Siebel which generates web pages for the user. In this Siebel there is a certain option, the inclusion of which activates a special mode for compatibility with automated testing. After enabling this option, Siebel, in addition to regular web pages, can generate externally indistinguishable, but containing something inside that is supported by the so-called Siebel API (well, or it is). This option is needed to support Siebel automated testing in general, with any automation tool. And so, our OpenScript can fully (almost) work with ActiveX controls representing CRM objects. The pale rectangle with the library is me and another guy, then it will be clearer.

A little bit about OpenScript as a solution

image
So, Oracle OpenSctipt is part of Oracle Application Testing Suite. I had to say it, because by itself it does not apply (I did not find it). This suite also includes: OATS Administrator, Oracle Test Manager and Oracle Load Testing. The first is for managing users and rights, the second is a solution for managing bugs and fixes, the third is a solution for load testing. All of them can work with each other, and they can separately, except for the administrator, since he himself will have nothing to administer.

OpenScript is a tool with a variety of modules.
It's not just for testing Sibel, oh no! He can do a lot. I will give a list of all modules from the documentation, I do not know most of these names, but maybe someone will find out what he needs and will be interested in:

From what I know, I can say that yes, he can test ordinary web pages (well, of course), Siebel, as well as load testing, based on the HTTP protocol. Its Fuctional Test Module is a module with common functions — mouse clicks, button presses, and other common functions.

What is the application itself?
Essentially this is Eclipse with additional modules. And that means, it's all right that the test scripts are written in Java. Version 1.6 is being used, and I’m not sure if it will work out another manually Oracle has not yet implemented a new version out of the box.
By the way, presenting this tool inside the company and to some clients, I mentioned Java in the last place, first talking about other possibilities. But I think it’s important for people here to know that there is a fully functional Java. Really full-featured - I connected third-party libraries; in one place, even creating a GUI window using Java tools is used. So with detailed deepening you can do almost anything with this OpenScript.

What it looks like

image
Of course, this is the result of the terrible mockery of the interface using Windows 7 scissors. But all the main elements are shown.

Button with a red circle at the top: the environment can record user actions. That is, we press the button and you can open the browser and do what you want there, “the office is writing.” Then the recorded can be played. What is good is that actions are recorded on the internal XPaths of the elements, and not on the coordinates of the clicks, so this automatically generated code is not entirely useless if even something has changed on the page or the script has been transferred to another machine.

The environment has a visual editor in the form of a tree. Theoretically, you can not write a test script, but click on it by over-generating the necessary functions and tests from the existing library. Theoretically, because even nine months after using this system, I do not see the practical possibility to create at least some useful script. Although writing plus this visual editor definitely allow you to do things.

And of course Java. You can write your own methods, your own classes, connect your own libraries. In this case, your methods can be added in a certain way to the library of visual editing, which allows you to make it not so useless. Basically, I and another guy did this - they wrote all sorts of things in Java, so that testers could then get by with creating a script and putting data in Excel files for functions. The pale rectangle in the first picture.

And one more thing - changing the script in the visual editor leads to a change in Java code. Changing Java code, if the code contains no errors, is immediately displayed in the visual editor. That is, these two views are fully synchronized by means of OpenScript. True, pure Java code is often portrayed as a single Java code element, which makes it very difficult to understand the logic of what is happening. But there are certain methods of dealing with this. The truth is that the code is not so beautiful, but the tree displays the structure of the program more clearly.

It is possible to run a written testing script (in fact, this is a Java program, but since we have the open script tool - let it be a script), you can either directly from the environment or from the command line. After that, the computer is better not to touch. Even in the documentation it is written this way - it is better not to touch it, otherwise the implementation may get lost. All the work goes with the browser, as if emulating the user. Naturally, I did not always adhere to this recommendation, and I must say that most actions work out normally, even when you do something in parallel. That is, the work is not tied to moving the mouse and pressing the keys on the keyboard, everything works somewhere in depth, at the level of codes. But some things still do not work. And the saddest thing is that some checks do not pass correctly, but the results show that everything is in order. This is due to the fact that sometimes different ActiveX must be really visible and activated to perform a test action. I think so, I have no more realistic version yet.

You cannot run two scripts at the same time on the same machine. This is if under one user. But you can put OpenScript on a computer, connect to it via RDP by several different users, and then everyone will be able to work with the environment on their own behalf and run the execution of scripts. He can work in this mode and even has automatic blocking of resources used by other users.

The result of the script are: a short record of the execution time and the number of errors (you can see in the picture at the bottom of the screen), as well as a detailed log that can be exported as an html file (you can hardly see it in the picture in the right half of the screen). In the detailed log, everything is beautiful: you can see all the steps of the script, their hierarchy is observed - what time is invested where each step is taken, whether it is passed, if not, an error message that is duplicated in all nodal steps to the very top of the hierarchy. In general, beauty. Unfortunately, the information content of this log is low when it comes to real checks. At least by default. And how to work with a lot of tests, and this is an automation system, when you end up with hundreds of such beautiful files, it’s not at all clear. However, it is clear - Oracle TestManager to help.
As a result, we wrote our log, first in a text file, and then in Excel, and testers look at the log as a last resort.

Short summary


Oracle OpenScript can definitely be used to automate testing. And even out of the box, his remarkable function of recording actions and a simple visual editor will help to create simple scripts for basic checks. Yes, the result of such checks will, as a rule, only come to the end of the script or fall somewhere, but this is not bad either. Moreover, the place where he fell will be clearly visible in the log, even with a screenshot. But the main thing that is in it is Java, which opens up huge opportunities for customization of the process. You can do anything. And if, when working with Siebel, there is still an additional restriction in the form of information that Siebel itself passes through its API in order to work with it somehow, it will not be a problem when testing regular web pages. My impression of working with this tool is positive, I would have time and knowledge, and a clear task, and a lot of money, and a couple of beautiful testers, and ... And, yes, in general, I think this is potentially a very good tool, but it requires Java and knowledge investing time for a really good result.

Afterword

If someone is interested in the topic, I can continue to share my experience in this area, some observations and results. I can’t share the most written library, because I’m very ashamed of my code (I started using Java for practice for the first time) and it’s like my employer's intellectual property (great excuse!).

Source: https://habr.com/ru/post/197436/


All Articles