Test assistance system, test assistance method, and program
The information processing system addresses the challenge of identifying and operating on changed web application elements by using a similarity calculation and weight determination unit, ensuring successful automated testing by specifying similar elements, thus overcoming the limitations of traditional locator-based systems.
Patent Information
- Application Number
- PCT/JP2023/006305
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2024-08-29
AI Technical Summary
Existing systems fail to accurately identify and operate on web application elements when these elements change, as locators cannot adapt to such changes, leading to difficulties in automating web application testing.
An information processing system with a similarity calculation unit that compares the characteristics of elements on a web page, an element specifying unit that determines the target of operation based on similarity, and a weight determination unit to prioritize feature weights, allowing the system to specify and operate on elements even when the original target element is not found.
Enables the specification and operation of web application elements by calculating the similarity between original and changed elements, ensuring successful automated testing even when the target element has been modified.
Smart Images

Figure JP2023006305_29082024_PF_FP_ABST
Abstract
Description
Test support system, test support method and program
[0001] The present invention relates to a test support system, a test support method, and a program.
[0002] Locators are used to identify screen elements in web applications and the like (see Patent Document 1).
[0003] JP 2019-101538 A
[0004] If the element changes, the locator will no longer be able to identify the element.
[0005] The present invention has been made in view of the above background, and aims to provide a technique that can identify an element to be operated.
[0006] The main invention of the present invention for solving the above problem is an information processing system comprising a similarity calculation unit that calculates the similarity between two elements that may be included in a Web page, and an element identification unit that identifies the element in the Web page that is to be the target of the operation, wherein when the element identification unit cannot identify a given first element in the Web page that is to be the target of the operation, the similarity calculation unit calculates the similarity between the features of the first and second elements for each second element included in the Web page, and the element identification unit identifies the second element that is to be the target of the operation according to the similarity.
[0007] Other problems and solutions disclosed in this application will be made clear in the section on preferred embodiments of the invention and the drawings.
[0008] According to the present invention, it is possible to identify the element to be operated.
[0009] It is a diagram showing an example of the overall configuration of a test system according to the present embodiment. It is a diagram showing an example of the hardware configuration of a server device 2. It is a diagram showing an example of the software configuration of the server device 2. It is a diagram explaining the operation of the server device 2. It is a diagram explaining the process of specifying an operation target element.
[0010] <System Overview> A test system according to one embodiment of the present invention will be described below. The test system of this embodiment is intended to automate testing of web applications (hereinafter abbreviated as "apps"). Testing is performed by the system executing an auto-execution program (hereinafter referred to as a test program) that automatically performs operations on screens (web pages) output by the apps. Test programs can be created by recording operations performed by testers.
[0011] 1 is a diagram showing an example of the overall configuration of a test system according to this embodiment. The test system according to this embodiment includes a server device 2. The server device 2 is communicably connected to a user terminal 1 and a web server 3 via a communication network. The communication network is, for example, the Internet, and is constructed using a public telephone network, a mobile phone network, a wireless communication path, Ethernet (registered trademark), or the like.
[0012] The user terminal 1 is a computer such as a personal computer that is operated by a user who intends to perform a test. It is assumed that the user terminal 1 is operated by a test executor, a developer, or the like.
[0013] The web server 3 is a computer that executes web applications. The server device 2 may be a general-purpose computer such as a workstation or personal computer, or may be logically realized by cloud computing. The web server 3 runs a program to be tested and, as a web application, can respond to requests (HTTP requests) with content (various content such as web pages written in HTML and image data). In this embodiment, a test is mainly performed to operate screens (web pages) written in HTML.
[0014] The server device 2 is a computer that supports the execution of tests. The server device 2 may be a general-purpose computer such as a workstation or a personal computer, or may be logically realized using cloud computing. The user terminal 1 can access the web server 3 via the server device 2, and the server device 2 can acquire and record operations on the app from the user terminal 1 and transmit the operations to the web server 3. The server device 2 can create and store a test program for the app based on the operations acquired from the user terminal 1. Furthermore, the server device 2 can then automatically (without operations by the user terminal 1) reproduce operations on the app executed on the web server 3.
[0015] <Server Device 2> FIG. 2 is a diagram illustrating an example of the hardware configuration of the server device 2. Note that the illustrated configuration is merely an example, and other configurations may also be used. The server device 2 includes a CPU 201, a memory 202, a storage device 203, a communication interface 204, an input device 205, and an output device 206. The storage device 203 stores various data and programs, and is, for example, a hard disk drive, a solid-state drive, or a flash memory. The communication interface 204 is an interface for connecting to a communication network, and is, for example, an adapter for connecting to Ethernet (registered trademark), a modem for connecting to a public telephone network, a wireless communication device for wireless communication, a USB (Universal Serial Bus) connector, or an RS232C connector for serial communication. The input device 205 is, for example, a keyboard, a mouse, a touch panel, buttons, a microphone, or the like for inputting data. The output device 206 is, for example, a display, a printer, a speaker, or the like for outputting data. Each functional unit of the server device 2 described below is realized by the CPU 201 reading a program stored in the storage device 203 into the memory 202 and executing it, and each storage unit of the server device 2 is realized as part of the storage area provided by the memory 202 and the storage device 203.
[0016] 3 is a diagram illustrating an example of the software configuration of the server device 2. The server device 2 includes an operation history storage unit 231, a test program storage unit 232, an application information storage unit 234, a feature storage unit 235, a weight storage unit 236, a screen acquisition unit 212, an operation acquisition unit 213, an element identification unit 214, a test program creation unit 215, an automatic test execution unit 216, a similarity calculation unit 217, and a weight determination unit 218. The server device 2 may be configured with multiple information processing devices, and the multiple information processing devices may include some of the functional units and / or storage units of the server device 2. For example, the weight storage unit 236, the feature storage unit 235, and the like may be implemented in a database server separate from the server device 2, and the server device 2 may access the database server to read and write data stored in these storage units.
[0017] The operation history storage unit 231 stores an operation history including user operations on the execution screen of the web application. The operations can be expressed as event information including the type and position of an operation such as touching or swiping the screen, inputting a character string, inputting voice, or pressing a button on the mobile device (a virtual button during a test), as well as data such as input text and voice. The operation history can include the date and time (timestamp) when the operation occurred, and event information, in association with a test ID for identifying the test and an application ID for identifying the web application.
[0018] The test program storage unit 232 stores test programs. Test programs are programs for reproducing operations on elements in web pages previously output by a web application. In this embodiment, the test program storage unit 232 stores information (test program information) including test programs. The test program information can store test programs and test results in association with a test ID that identifies a test and an app ID that identifies an app. The test program can be a script that defines steps such as tapping a specific element on the app's execution screen or typing specific text into a specific element on the app's execution screen. The script can be one or more combinations of steps including, for example, an operation (tap, swipe, type, etc.), an element to be operated (which does not need to be specified), and a value (for example, text for typing, or a position on the screen for tapping or swiping). The test result is the execution result of the test program and can be, for example, success or failure. Note that test results may not be set in the test program information for test programs that are not automatically executed. The test program storage unit 232 can also store test programs that have been executed in the past.
[0019] The application information storage unit 234 stores information about applications (hereinafter referred to as application information). The application information can include a URL and authentication information for accessing a web application, in association with an application ID that identifies the application.
[0020] The feature storage unit 235 stores features of elements included in a web page that are used to calculate similarity. Features can include, for example, that an element attribute has a specific name, that an element class includes a specific class, or that an element text includes a specific character string. Features can also include nested features of other elements related to the element, such as the element's parent element, child element, or sibling element. Features can also include conditions for areas within a web page. For example, a feature can be set to be the third child element of a side panel of a web page (which can be the element in the leftmost column when the web page is divided horizontally or vertically, or an element having an ID or class indicating a side panel).
[0021] The weight storage unit 236 stores a weight for each type of element feature. Feature types can include, for example, tag name, attribute name, class name, element text, being a child of a parent element, and order among the children of a parent element. For each type of feature, a resistance to change when a web application is modified or changed can be set. For example, for a tag that is a button, it is empirically known that the tag name being a button is unlikely to change, while the tag text is likely to change. Accordingly, a weight for resistance to change can be set in advance.
[0022] The screen acquisition unit 212 acquires an execution screen output by the application. It is assumed that the execution screen is written in HTML. The screen acquisition unit 212 can transmit the execution screen (which may include a web page for displaying the screen and subsequent images) to the user terminal 1.
[0023] The operation acquisition unit 213 acquires operations performed on the execution screen by the test executor. The operation acquisition unit 213 executes, for example, a program that realizes a web browser and can receive operation information from the user terminal 1 using a mouse (including a touch panel) or a keyboard for the web browser. The operation information can include, for example, information such as the clicked position on the screen and text entered from the keyboard. The operation acquisition unit 213 can acquire event information generated by the web browser by providing the acquired operation information to the web browser. The event information can include the element where the event occurred and the value assigned to the element. The operation acquisition unit 213 can create an operation history including the acquired event information, a test ID, an application ID, and the current date and time, and register the operation history in the operation history storage unit 231.
[0024] The element identification unit 214 identifies an element to be operated on in the execution screen (web page) of the application. The element identification unit 214 can search the web page for an element to be operated that is included in the event information. The element identification unit 214 can search for the element from, for example, a Document Object Model (DOM) tree of the web page.
[0025] The test program creation unit 215 creates a test program based on the operation history. For example, the test program creation unit 215 can create a test program by converting event information included in the operation history into a script format. The test program includes one or more steps that generate events (e.g., clicks or text input) for elements to be operated in the order of the operation history.
[0026] The automatic test execution unit 216 executes a test program. By executing the test program, it is possible to automatically execute a test of the application. The automatic test execution unit 216 can execute the test program in response to an instruction from the user terminal 1.
[0027] As described above, first, the operations performed by the test executor on the application execution screen are recorded, and a test program is created from the operation history. After that, the test program creation unit 215 executes the test program without any operations by the test executor, thereby automating the test.
[0028] The similarity calculation unit 217 can calculate the similarity between two elements.
[0029] When the automatic test execution unit 216 executes each step of the test program, if the element identification unit 214 cannot find the element to be operated on from the execution screen (web page), the element identification unit 214 searches for an element similar to the element to be operated on that is recorded in the test program.
[0030] Here, the similarity calculation unit 217 calculates the similarity between the features of a first element included in the web page when the test program was created and a second element included in the web page when the test program was executed. The similarity calculation unit 217 reads features to be used for calculating the similarity from the feature storage unit 235 and identifies features that apply to the first and second elements. The similarity calculation unit 217 can calculate, for example, the number of matching features between the first and second elements as the similarity.
[0031] The element specifying unit 214 can specify an element to be operated according to the degree of similarity (for example, by selecting the element with the highest degree of similarity).
[0032] Furthermore, the similarity calculation unit 217 can calculate the similarity between the first and second features according to the weights. For example, the similarity calculation unit 217 can read, from the weight storage unit 236, weights for the types of features read from the feature storage unit 235, and calculate the similarity as the sum of the weights of matching features.
[0033] The weight determination unit 218 can determine the weights. The weight determination unit 218 can accept input of feature types and weights corresponding to those types from a developer or a test executor and register them in the weight storage unit 236. The weight determination unit 218 can also identify previously successful test programs from the test program storage unit 232 and determine weights so that the identified test programs will succeed. For example, the weight determination unit 218 can accept designation of feature types that are unlikely to change, and add weights (an upper limit may be set) for the specified feature types as long as previously successful test programs continue to succeed.
[0034] <Operation> FIG. 4 is a diagram illustrating the operation of the server device 2.
[0035] The server device 2 executes the test program instructed by the user (S401).
[0036] The server device 2 executes the following process for each step defined in the test program.
[0037] The server device 2 acquires screen information (HTML data) from the Web application (S402), searches the screen information for an operation target element (operation target element) set in the step, and if the operation target element is not found (S403: NO), acquires features to be used from the feature storage unit 235 (S404), extracts features of the operation target element (S405), and extracts matching features for each element included in the acquired screen information (S406). The server device 2 calculates the number of matching features (similarity) and identifies the operation target element from the elements included in the screen information according to the similarity (S407).
[0038] FIG. 5 is a diagram illustrating the process of specifying an element to be operated.
[0039] 5, web page 51 is the screen information when a test program is created, and web page 54 is the screen information when the test program is executed. Web page 51 displays a button 511 with the text "Buy," and this button 511 was the target of operations such as clicking in the test program. However, on web page 54 when an automatic test is executed, the button with the text "Buy" does not exist, and instead a button 521 with the text "Add to wish list" and a button 522 with the text "Buy now" are displayed.
[0040] In HTML data 52 of web page 51, BUTTON tag 521 is HTML corresponding to button 511, and when features are extracted from this BUTTON tag 521, feature list 53 is obtained. In the example of FIG. 5, the features of BUTTON tag 521 include: (1) the tag name is "BUTTON" (the feature type is "hasTagName" and its parameter is "BUTTON"), (2) the class name contains "btn" (the feature type is "containsClassName" and its parameter is "btn"), (3) the class name contains "btn-action" (the feature type is "containsClassName" and its parameter is "btn-action"), and (4) the text matches "Buy" ("matchTex"). The following have been extracted: (5) the tag is a child of a tag with a specific feature (the feature type is "directChildOf" and the parameter is a list of features), and the specific feature is (5-1) a DIV tag (the feature type is "hasTagName" and the parameter is "DIV"), and (5-2) the class name contains "button_container" (the feature type is "containsClassName" and the parameter is "button_container").
[0041] In contrast, HTML data 55 of web page 54 includes two button tags: a button tag 551 and a button tag 552. Here, the server device 2 extracts matching features from the feature list 53 for the button tags 551 and 552, regarding the two buttons as "first button" and "second button."
[0042] For the BUTTON tag 551 (firstButton), the following are extracted: (1) the tag name is "BUTTON", (2) the class name contains "btn", and (5) it is a child of a tag with specific characteristics, where the specific characteristics are (5-1) a DIV tag and (5-2) the class name contains "button_container".
[0043] For the BUTTON tag 552 (secondButton), the following has been extracted: (1) the tag name is "BUTTON", (2) the class name contains "btn", (3) the class name contains "btn-action", and (5) it is a child of a tag with specific characteristics, where the specific characteristics are (5-1) a DIV tag and (5-2) the class name contains "button_container".
[0044] Therefore, the BUTTON tag 551 has five features that match the feature list 53 of the element to be operated, and the BUTTON tag 552 has six features that match the feature list 53 of the element to be operated, so the BUTTON tag 552 is identified as the element to be operated.
[0045] Returning to FIG. 4, if there is an element to be operated in the screen information (S403: YES), an event is generated for the element to be operated that is identified based on the similarity of its features (S408) if there is no element to be operated in the screen information (S403: NO).
[0046] After repeating the above process, the server device 2 sets the test results of the test program as the test results of the test program information (S409).
[0047] In this way, even if an element to be operated on cannot be found when the test program is executed, an element with similar characteristics can be identified as the operation target and the program can be executed.
[0048] Although the present embodiment has been described above, the above embodiment is intended to facilitate understanding of the present invention and is not intended to limit the present invention. The present invention may be modified or improved without departing from the spirit thereof, and equivalents thereof are also included in the present invention.
[0049] For example, in this embodiment, when creating a test program, the user terminal 1 accesses the web server 3 via the server device 2, but the user terminal 1 can be equipped with a screen acquisition unit 212, an operation acquisition unit 213, a test program creation unit 215, etc., so that the user terminal 1 can record the operations of the test executor to create a test program, and the created test program can be registered in the server device 2.
[0050] Furthermore, the user terminal 1 may be provided with the functions of the server device 2, and the user terminal 1 may execute the test program.
[0051] Furthermore, in this embodiment, when the test program is executed, the features of the elements to be operated specified in the test program are extracted (S405 in FIG. 4). However, S405 may be omitted, and the features may be extracted when the test program is created. The feature list 53 shown in FIG. 5 may be set as a parameter in the test program, or may be associated with a step in the test program and included in the test program information. When the test program is executed (S406 in FIG. 4), elements that match the elements included in the screen information obtained from the Web application may be extracted from the feature list set as a parameter or the feature list set in the test program information.
[0052] <Disclosure> The present disclosure also includes the following configurations. [Item 1] An information processing system comprising: a similarity calculation unit that calculates a similarity between two elements that may be included in a web page; and an element identification unit that identifies the element in the web page that is to be the target of the operation, wherein when the element identification unit cannot identify a given first element in the web page that is to be the target of the operation, the similarity calculation unit calculates a similarity between features of the first and second elements for each second element included in the web page, and the element identification unit identifies the second element that is to be the target of the operation according to the similarity. [Item 2] The information processing system according to item 1, further comprising: a weight storage unit that stores a weight for each type of the feature, and the similarity calculation unit calculates the similarity between the features of the first and second elements according to the weight. [Item 3] The information processing system according to Item 2, comprising: a test program storage unit that stores a test program for reproducing operations on the web page and past successes or failures of execution of the test program; and a weight determination unit that determines the weight so that the program that has previously been successful will be successful. [Item 4] The information processing system according to Item 1, wherein the feature types include areas within the web page. [Item 5] An information processing method, wherein a computer executes the following steps when a given first element to be operated on cannot be identified in the web page: calculating a similarity between features of the first and second elements for each second element included in the web page; and identifying the second element to be operated on based on the similarity. [Item 6] A program for causing a computer to execute the steps of: calculating a similarity between features of first and second elements for each second element included in a web page when a given first element to be operated cannot be identified in the web page; and identifying the second element to be operated according to the similarity.
[0053] 1 User terminal 2 Server device 3 Web server
Claims
1. An information processing system comprising: a similarity calculation unit that calculates the similarity between two elements that may be included in a Web page; and an element identification unit that identifies the element in the Web page that is to be the target of the operation, wherein when the element identification unit is unable to identify a given first element in the Web page that is to be the target of the operation, the similarity calculation unit calculates the similarity between characteristics of the first and second elements for each second element included in the Web page, and the element identification unit identifies the second element that is to be the target of the operation according to the similarity.
2. An information processing system as described in claim 1, further comprising a weight memory unit that stores a weight for each type of feature, and the similarity calculation unit calculates the similarity between the features of the first and second elements according to the weight.
3. An information processing system as described in claim 2, comprising: a test program for reproducing operations on the Web page; a test program storage unit for storing past successes or failures of execution of the test program; and a weight determination unit for determining the weight so that the program that has been successful in the past will be successful.
4. An information processing system according to claim 1, wherein the type of feature includes an area within the web page.
5. An information processing method characterized by the steps of: when a given first element to be operated on cannot be identified in a web page, calculating the similarity between characteristics of the first and second elements for each second element included in the web page; and identifying the second element to be operated on based on the similarity.
6. A program for causing a computer to execute the steps of: when a given first element to be operated on cannot be identified in a web page, calculating the similarity between characteristics of each of the first and second elements included in the web page; and identifying the second element to be operated on based on the similarity.
Citation Information
Patent Citations
Information processing device, information processing system, computer program, and method
JP2018037052A
Test script correction device and program
JP2019101538A
