Identification of elements of currently-executing component script

An apparatus (100) in an example comprises a test-script generator (704) and selection logic (114). The test-script generator (704) serves to create a test script (116) through identification of currently-available elements (604, 606, 608, 610, 612, 614, 616, 618) of an application (106) under test. The test script (116) is employable to exercise the application (106). The selection logic (114) serves to identify elements (406, 408) of a currently-executing component script (402) within the test script (116), contemporaneous with execution of the test script (116), that may be affected by graphical user interface changes made to the application (106). The identification of the elements (406, 408) of the currently-executing component script within the test script (116), contemporaneous with execution of the test script (116), that may be affected by the graphical user interface changes by the selection logic is contemporaneous with the exercise of the application (106) by the test script (116).

BACKGROUND

Test automation software seeks to ensure that an application under test performs correctly. A defect or functional change introduced into the system may cause a test to fail. A system failure because of a functional change would result from the test software being outdated. Upon knowledge a change has occurred in the application under test, all tests may be run to try to avoid problems in the system from the change to the application.

DETAILED DESCRIPTION

Referring to the BACKGROUND section above, it may be desirable to automatically update the test to keep up with changes made to the software application. It may be desirable to have information on the potential impact of a known change and run only a subset of tests which could potentially be affected by the change. Human and computing time and resources may be saved.

An embodiment creates a subset of tests to be run based on an analysis of change impact. An embodiment automatically decomposes the application to be tested into discrete, auto-parameterized test components, and generates an ordered sequence of components to form a set of logical flows of activity within the application that are subsequently used to test the application. Both benign and critical changes to the application are automatically detected, and the component can be automatically updated to reflect the change in the behavior of the application.

An embodiment allows the user to navigate the application, or a part of the application, while the embodiment records the actions performed during the navigation. For example, a user with knowledge about navigation of the application may employ such an embodiment without knowledge directed to software testing. The actions are broken down into self-contained components, and any data entered by the user is also captured. The data is automatically parameterized, to allow different data sets to be used without having to make any changes to the components. A test having these components is created and can be run to accurately, faithfully, and/or correctly reproduce the actions taken when the navigation was originally performed.

Automatic creation of components allows the user to reuse them with reduced, low, and/or minimal effort to create new flows and use different data that exercises different parts of the application under test. A system automatically identifies the changes that have been made to the system, and automatically makes corresponding and/or appropriate changes and/or updates to the relevant component for the test to succeed and/or pass. Time and effort may be saved in analysis, application, and/or debugging of changes needed to pass the test. In the event of a defect in the application under test, the system automatically raises a defect into a defect management system for tracking.

An embodiment quickly and efficiently creates a suite of tests that run against target software such as offered by SAP AG, headquartered in Walldorf, Germany (World Wide Web SAP dot COM). The tests serve to validate software customizations and provide simple and efficient updating of the tests.

A Flow object comprises a series of self-contained Business Components. The Business Components can be chained together with other Flows and Business Components to form a Test. The Flow can be recorded automatically. The Business Components can be automatically parameterized.

An object of type Flow is created to represent a logical flow of operation through the application under test. Pressing a Learn Flow button may prompt the user to open up the application under test at the point at which the Flow is to begin. From that point on, all actions performed on the application under test are recorded by the system. The recording may be accompanied by a relatively small, unobtrusive toolbar which can be used to control the recording, providing options such as stopping the recording, pausing it and resuming it.

When the recording is complete, the system analyzes the recording, and breaks it down into an ordered list of discrete components. Each user-interface element which accepts data may be represented in the component by a piece of script that enters data into the element using a variable to represent the relevant data item, rather than directly specifying the data within the script. The variable is automatically assigned as a parameter to the component, and its default value is the data item entered by the user. If the user does not enter data into that element, an embodiment can choose not to represent that element in the script, or alternatively to represent that element in the script with a variable representing the data, assigned as a parameter to the Business Component, with its default value being the current value of the element. Output parameters are also automatically detected and created by the system. A record is kept of which user-interface elements are present for each component, including such user-interface elements that were not touched by the user in the course of recording the Flow. The user determines where these components will be stored, for example in a Quality Management system such as a product under the trade identifier QUALITY CENTER by Hewlett-Packard Company, headquartered in Palo Alto, Calif., United States (World Wide Web HP dot COM). The Flow object is updated with references to the Business Components that were stored in Quality Center. The Flow can then be used as a building block within Business Process Tests in Quality Center. The Flow can be configured to have input parameters, which are passed into its constituent Business Components.

A Business Component may be edited prior the Business Component being stored, for example, or at any time after the Business Component is stored. Steps may be added, removed, or modified in the Business Component and/or parameters may be added, removed, or modified in the Business Component, without preventing, harming, and/or negatively impacting the function of the Business Component.

Business Components and Flows can also be configured to have output parameters, which are passed on to subsequent Flows and Business Components in the Business Process Test. If the execution of a Business Component within a Flow depends on the value of a parameter, a Run Condition (which may be referred to as “branching”) can be configured for that Business Component. The value of a parameter at the current point of execution can be compared to a particular value. If the condition is satisfied, the Business Component is executed. Otherwise, the Business Component is not executed. The system can be configured to fail if the Run Condition is not satisfied, or to ignore it and move on to the next Business Component in the Flow.

A Business Process Test can be configured to run in a mode that may be called “Change Detection Mode”. In addition to executing the Business Process Test to check the application under test, this has the effect of recording all of the user-interface elements encountered during playback. These user-interface elements are compared with the user-interface elements noted when the Business Component was created, and a note is made of any changes. This detects changes such as significant user-interface elements that have been added or removed, thus causing the test to fail, and also benign changes, such as a non-significant field that has been added. A report of the test is generated after the test is run. Each change that was detected is presented to the user, who can decide whether to update the relevant Business Component to reflect the change, or whether to enter a defect into the defect management system. There is also an option to ignore the change and do nothing. For example, the user might choose such an option if the user wishes to manually update the Business Component.

A list of Business Process Tests that should be run in Change Detection Mode can be created manually by the user, or automatically generated by Change Impact Testing software that determines the subset of tests that may be affected by a change in the application under test, and automatically creates a Test Set as a list of tests which are to be run in Change Detection Mode. It can also automatically set the system to run the relevant Business Process Tests in Change Detection Mode.

An exemplary embodiment automatically performs a breakdown of a flow of activity through the application under test into components. Exemplary automation occurs non-contemporaneously with previous user input and without active contemporaneous user input. An exemplary embodiment also parameterizes the components. An exemplary implementation provides a speedy and accurate way of creating both flows and components, and allows the extension and reuse of components without having to rerecord them or delve into the underlying script. The Run Condition provides a simple way to control a Flow and extend it beyond its original capabilities without having to even see the underlying script.

The integration with Change Impact Testing software can reduce the number of tests that need to be executed if a change has been made to the system. This can offer a saving in the time to find out the real effect of a change. When a change has been detected, the component can be automatically updated without the user having to understand how the component works. This saves time which may otherwise be spent on test and component maintenance. Since the system hides all of the technical details behind the tests, the system is made more accessible to less technical users.

Change Impact Testing determines the list of tests that may be affected by a change that was introduced into the system. The Change Impact Testing mechanism creates a set of tests which is automatically configured to run in Change Detection Mode.

Turning toFIG. 1, an embodiment of an apparatus100comprises a test management system102that is initiated by a process initiator104to test a target application106. The process initiator104comprises a human or computer software agent. The target application106comprises an application under test. The target application106is to have its behavior tested and comprises a user interface such as a graphical user interface (GUI)118.

An embodiment of the test management system102manages a lifecycle of tests on the target application106and comprises a test execution agent108, an analyzer110, an updater112, selection logic114, and a test script116. A user119may operate and/or interact with the GUI118, for example, to provide additional data to the target application106such as may assist the test execution agent108to proceed with execution. As described herein, a further embodiment of the test management system102comprises the analyzer110, the test script116, a test recording agent702(FIG. 7), and a test script generator704(FIG. 7).

Referring toFIGS. 1 and 4, the test execution agent108executes a test on the target application106through employment of a component script402within the test script116. The component404comprises a component script402that comprise one or more steps406,408. Steps406,408comprise an exemplary implementation of an algorithm, procedure, program, process, mechanism, engine, model, coordinator, module, element, application, software, code, and/or logic. The analyzer110comprises a target interface analyzer and/or user interface analyzer directed to the GUI118of the target application106. The test script116comprises a collection of component scripts402arranged in a specific order for employment in testing by the test execution agent108to exercise the target application106. The order of the component scripts402determines the sequence in which steps406,408are executed against the target application106. The order of steps406,408may be fixed. The order of execution of steps406,408may be sequential and/or follow an arrangement such as may be implemented in the test script116.

The component script402in an example comprises one or more steps406,408. The updater112serves to update the steps406,408for testing of the target application106. The selection logic114comprises a comparison engine120that reviews the steps406,408relative to the GUI118.

Turning toFIG. 5, the GUI118may comprise a screen502. The screen502comprises one or more screen areas504,506,508,510,512,514,516,518. An exemplary screen area504,506,508,510,512,514,516,518comprises one or more user interface (UI) controls such as edit fields, check boxes, and/or lists.

Referring toFIGS. 5 and 6, an exemplary screen area504,506,508,510,512,514,516,518comprises one or more user interface (UI) elements604,606,608,610,612,614,616,618. Referring toFIGS. 4 and 6, an exemplary step406,408corresponds to an input field such as a user interface (UI) element604,606,608,610,612,614,616,618. For example, a one-to-one relationship may exist between the steps406,408and the UI elements604,606,608,610,612,614,616,618. For example, the step406may correspond to the UI element604and the step408may correspond to the UI element606. The steps406,408may comprise an arrangement of input fields such the UI elements604,606,608,610,612,614,616,618. An example of a change to the UI is represented by an addition of UI element620.

In an exemplary implementation, a step406,408in the component script402corresponds to a UI element604,606,608,610,612,614,616,618in the screen area504of the screen502. A screen area504may be reused within a target application106, and different data may be entered each time the screen area504is encountered within the target application106. To allow a single instance of the component script402to be employable on each and all of these occasions, an exemplary approach may allow configurability in entry of the actual values into the UT elements604,606,608,610,612,614,616,618, in place of explicit determination within the step406,408. This may allow parameterization of a step406,408for the step406,408to comprise a reference to a variable, in place of explicit values of data. Prior to execution of a test by the test execution agent108on the target application106through employment of the component script402within the test script116, the test execution agent108may assign values to variables from parameterization of the step406,408, or may assign values of other variables whose values are determined during the execution of the component script402by the test execution agent108.

An order of the component scripts402may determine a sequence in which the test execution agent108executes the steps406,408against the target application106. The screen area504of the screen502of the GUI118may comprise a combobox such as a drop-down list that may be enabled and disabled as the UI element604, and an edit box that may be enabled and disabled as the UI element606. At a given time, the combobox as the UI element604in the screen area504is enabled and the edit box as the UI element606in the screen area504is disabled. A user119may select an option in the combobox as the UI element604in the screen area504and cause the edit box as the UI element606in the screen area504to be enabled. The user119selects the option in the combobox as the UI element604in the screen area504before attempting to insert text into the edit box as the UI element606in the screen area504.

The step406of the component script402of the test script116may correspond to the combobox as the UI element604in the screen area504. The step408of the component script402of the test script116may correspond to the edit box as the UI element606in the screen area504. The component script402of the test script116ensures that the step406is executed by the test execution agent108before the step408is executed by the test execution agent108, so the user119selects the option in the combobox as the UI element604in the screen area504to cause the edit box as the UI element606in the screen area504to be enabled, before attempting to insert text into the edit box as the UI element606in the screen area504.

The test execution agent108executes each step406,408of the component script402in order. The analyzer110reads the GUI118of the target application106. The selection logic114compares the currently executing step406,408with the GUI118of the target application106as read by the analyzer110.

The analyzer110reads the GUI118of the target application106. The selection logic114compares the GUI118of the target application106at any at any given moment in time with a component script402from the test script116. The updater112updates component scripts402from the test script116according to the results of the selection logic114. The process initiator104initiates management of the test.

An illustrative description of an exemplary operation of an embodiment of the apparatus100is presented, for explanatory purposes. Turning toFIG. 2, in an exemplary logic flow202at STEP204, test execution agent108receives a change event notice or trigger. If the test management system102determines a change occurred, the test management system can initiate the logic flow202such as by providing the notice or trigger. A human as the process initiator104can manually initiate the logic flow202. At STEP206the test execution agent108starts execution of a test of the target application106. At STEP208the test execution agent108makes a determination whether another executable step of the target application106is available. If NO, the test execution agent108stops execution of the test of the target application at STEP210. If YES, the test execution agent108continues the test and executes the next step of the target application at STEP212.

At STEP214the test execution agent108makes a determination whether execution of the last step of the target application106has succeeded. If NO, the test execution agent108stops execution of the test of the target application at STEP216and reports a defect in the target application106at STEP218. If YES, the test execution agent108instructs the analyzer110to scan the GUI118at STEP220and the selection logic114makes a determination whether another change has been detected at STEP222. The determination is made by comparing the output of the analyzer110to the relevant component in the test script116.

If NO, the test execution agent108returns from STEP222to STEP208and proceeds. If YES, the test execution agent108makes a determination whether the change is benign at STEP224. A benign change is one that neither changes the flow of execution nor causes an error to be generated if that change is not addressed in the test script116. If NO, so the change is identified as harmful or threatening, the test execution agent108proceeds to STEP216to stop execution and then STEP218to report a defect. If YES, the test execution agent108instructs the updater112to adjust the test of the target application106at STEP226.

In another example in place of STEP226, the test execution agent108may accumulate changes and store them in the test script116, while continuing to execute the test of the target application106. Upon completion of the test of the target application106, the changes would be available for review by the user such as the process initiator104. The user as the process initiator104can then decide to apply the appropriate changes to the test of the target application106.

An illustrative description of an exemplary operation of an embodiment of the apparatus100is presented, for explanatory purposes. Turning toFIG. 3, in an exemplary logic flow302at STEP304, test execution agent108applies a change event notice or trigger such as may have been received in at STEP204in logic flow202ofFIG. 2. Logic flow303represents the application of a change to a component404(FIG. 4). The test execution agent108at STEP306exposes parameters from the change. For example, the text of an edit box may be exposed as the parameter. The test execution agent108at STEP308locates an action step as an exemplary step406,408(FIG. 4) of the component404. The action step as an exemplary step406,408may cause the screen502(FIG. 5) to change. An exemplary component404comprises data steps as exemplary steps406,408that apply data to controls on the screen502. When all data steps as exemplary steps406,408are completed by the test execution agent108, the action step as an exemplary step406,408, for example, a submit button, may be executed by the test execution agent108.

The test execution agent108at STEP310makes a determination whether the change is a data change or an action change. If the determination is for a data change at STEP310, the test execution agent108proceeds to STEP312. The test execution agent108at STEP312inserts the change before the action step. The test execution agent108may assign a default value to the data step to represent the changed data. If the determination is for an action change at STEP310, the test execution agent108proceeds to STEP314. The test execution agent108at STEP314replaces the action step with the change.

Referring toFIG. 7, a further embodiment of the test management system102comprises the analyzer110, the test script116, the test recording agent702, and the test script generator704. The process initiator104begins a process of recording actions performed by the user119on the GUI118of the target application106, by initializing the test recording agent702. The test recording agent702manages the analysis of the GUI118of the target application106by utilizing the analyzer110. The analyzer110notes each action performed on the GUI118of the target application106, and notes any data that is entered into the GUI118of the target application106. When the analyzer110determines that the GUI118of the target application106has changed, the test recording agent702initiates the component script generator704which stores the actions and data that have been analyzed until that point as a component script402(FIG. 4).

Referring toFIGS. 4 and 7, the test recording agent702in an example may cause the component script generator704to store the component script402in the test script116. The test recording agent702then continues to record into a new instance of a component script402and the process is repeated until the recording process is stopped by the user119. In another example, test recording agent702may store in memory all component scripts402that have been recorded until the recording process is complete, and then store all component scripts402(FIG. 4) in the test script116. In an exemplary embodiment, before or after the test recording agent702or the component script generator704stores the component script402, the user119may be allowed to add, remove, or modify steps in the component script402, or to add, remove or change the parameters of the component404, without negatively impacting the functioning of the component404.

An exemplary embodiment comprises a test-script generator704and selection logic114. The test-script generator704serves to create a test script116through identification of currently-available elements604,606,608,610,612,614,616,618of an application106under test. The test script116is employable to exercise the application106. The selection logic114serves to identify elements406,408of a currently-executing component script402within the test script116, contemporaneous with execution of the test script116, that may be affected by graphical user interface changes made to the application106. The identification of the elements406,408of the currently-executing component script within the test script116, contemporaneous with execution of the test script116, that may be affected by the graphical user interface changes by the selection logic is contemporaneous with the exercise of the application106by the test script116.

A test execution agent108executes a test on the application106through employment of the currently-executing component script402within the test script116. An updater112serves to update the elements406,408for the test on the application106. The graphical user interface changes are made to a graphical user interface118of the application106. A target interface analyzer110is directed to the graphical user interface118of the application106. The selection logic114comprises a comparison engine120that reviews the elements406,408relative to the graphical user interface118. The graphical user interface118comprises a series of input screens502that each comprises an arrangement of input fields604,606,608,610,612,614,616,618. Each input screen502corresponds to a respective element406,408of a set of elements406,408of the test script116that is employable to exercise the application106.

An exemplary approach creates test components404and a test script116, without active contemporaneous user input, for test of an application106. There is identifying of changed objects620on a graphical user interface118of the application106. The identifying is contemporaneous with the test of the application106. There is updating of the test script116without active contemporaneous user input when changes are identified in the user interface118.

There is employing of the identifying of the changed objects620to generate one or more components404based on performance of one or more actions on the user interface118while the application106is under test. There is identifying of changes that are applicable to an existing component script402as a result of one or more differences in a state of the graphical user interface118from a state of the graphical user interface118while the application106is under test and a state of the graphical user interface118when the component script402was created or previously updated. There is applying of one or more changes to a component script402to promote continued execution of the component script402against the graphical user interface118in view of one or more changes to the graphical user interface118after the component script402was created or previously updated.

An embodiment of the apparatus100comprises a plurality of components such as one or more of electronic components, chemical components, organic components, mechanical components, hardware components, optical components, and/or computer software components. A number of such components can be combined or divided in an embodiment of the apparatus100. In one or more exemplary embodiments, one or more features described herein in connection with one or more components and/or one or more parts thereof are applicable and/or extendible analogously to one or more other instances of the particular component and/or other components in the apparatus100. In one or more exemplary embodiments, one or more features described herein in connection with one or more components and/or one or more parts thereof may be omitted from or modified in one or more other instances of the particular component and/or other components in the apparatus100. An exemplary technical effect is one or more exemplary and/or desirable functions, approaches, and/or procedures. An exemplary component of an embodiment of the apparatus100employs and/or comprises a set and/or series of computer instructions written in or implemented with any of a number of programming languages, as will be appreciated by those skilled in the art. An embodiment of the apparatus100comprises any (e.g., horizontal, oblique, angled, or vertical) orientation, with the description and figures herein illustrating an exemplary orientation of an exemplary embodiment of the apparatus100, for explanatory purposes.

An embodiment of the apparatus100encompasses an article and/or an article of manufacture. The article comprises one or more computer-readable signal-bearing media. The article comprises means in the one or more media for one or more exemplary and/or desirable functions, approaches, and/or procedures.

An embodiment of the apparatus100employs one or more computer readable signal bearing media. A computer-readable signal-bearing medium stores software, firmware and/or assembly language for performing one or more portions of one or more embodiments. An example of a computer-readable signal bearing medium for an embodiment of the apparatus100comprises a memory and/or recordable data storage medium. A computer-readable signal-bearing medium for an embodiment of the apparatus100in an example comprises one or more of a magnetic, electrical, optical, biological, chemical, and/or atomic data storage medium. For example, an embodiment of the computer-readable signal-bearing medium comprises one or more floppy disks, magnetic tapes, CDs, DVDs, hard disk drives, and/or electronic memory. In another example, an embodiment of the computer-readable signal-bearing medium comprises a modulated carrier signal transmitted over a network comprising or coupled with an embodiment of the apparatus100, for instance, one or more of a telephone network, a local area network (“LAN”), a wide area network (“WAN”), the Internet, and/or a wireless network. A computer-readable signal-bearing medium comprises a physical computer medium and/or computer-readable signal-bearing tangible medium.

The steps or operations described herein are examples. There may be variations to these steps or operations without departing from the spirit of the invention. For example, the steps may be performed in a differing order, or steps may be added, deleted, or modified.