Automatic testing method, device and equipment based on power SOAP interface and medium

By acquiring the structural information of the power SOAP interface and generating and parsing test requests, the cumbersome and resource-intensive problems of power SOAP interface testing in the prior art are solved. This achieves an efficient and easy-to-use automated testing method and device, supporting multiple execution strategies and result verification.

CN120973678APending Publication Date: 2025-11-18CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511098186.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-06
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Existing technologies for power SOAP interface testing suffer from problems such as cumbersome script writing, high resource utilization, poor usability, low simulation accuracy, high learning cost, and low automation rate. In particular, the tools rely on the local environment and cannot support batch testing and automation.

Method used

An automated testing method and apparatus based on the power SOAP interface is provided. It obtains the SOAP interface structure information by accessing the Initial WSDL address, parses the DOM tree using an XML parsing library, generates SOAP requests and receives response content, supports batch testing and scheduled execution, uses HTTPclient to simulate real calls, and provides a user-friendly graphical interface and assertion library to verify the response results.

Benefits of technology

It simplifies test script writing, reduces resource consumption, improves ease of use and simulation accuracy, lowers learning costs, supports batch and automated testing, and improves testing efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120973678A_ABST
    Figure CN120973678A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of interface testing, and discloses an automatic testing method and device based on an electric power SOAP interface, equipment and a medium. The method comprises the following steps: creating an SOAP test task; the SOAP test task comprises a plurality of test cases; accessing an InitialWSDL address of the to-be-tested power application software, obtaining an InitialWSDL file of the SOAP interface of the to-be-tested power application software through the InitialWSDL address, constructing an XML DOM tree, analyzing the XML DOM tree through an XML analysis library, and obtaining structure information of the SOAP interface; aiming at the SOAP test task, checking an initial message corresponding to the SOAP test task, and filling each test case in the initial message based on the obtained structure information of the SOAP interface to obtain a constructed SOAP request; sending the constructed SOAP request to an SOAP interface of the power application software to be tested; and receiving SOAP service response content returned by the SOAP interface of the target power application software, and analyzing and displaying the SOAP service response content. The method is easy to use, and tedious debugging steps of testers are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of interface testing technology, and specifically relates to an automated testing method, apparatus, equipment and medium based on power SOAP interface. Background Technology

[0002] With the rapid development of the Internet, power information technology has entered a new stage of high-quality leapfrog development, and my country's power information technology industry has entered an era of great transformation. Due to changes in the power industry's demands and the continuous growth of business volume, various information application systems are constantly emerging, and the number of application systems is increasing accordingly. In order to implement the State Grid Corporation of China's (hereinafter referred to as the Company) requirements for deepening the application of information technology, further strengthen the construction of technical support means for operation and application in various units, expand the scope of information monitoring, continuously improve the level of information operation and application, and effectively standardize operation and management, it is necessary to strengthen the supervision of business applications by I6000, expand the scope of supervision of business applications, and achieve real-time supervision of the entire process and all aspects. All business application development vendors are required to consider the SOAP interface requirements with I6000 from the initial system planning and design stage, incorporating the indicator access into the system development and making the SOAP interface with I6000 a unified module for system management. Each business application development unit is responsible for the stability, indicator rationality, logical correctness, and data accuracy of the SOAP interface programs between their developed business applications and the I6000 system. For any issues arising during the testing and operation of the SOAP interface module, the relevant business application development vendors must actively upgrade and improve it to ensure the stability of the SOAP interface and the accuracy of the indicators. To ensure the stability and excellent speed of the SOAP interface integrated with I6000 for various information systems, interface testing is required before deployment. This involves using self-developed testing tools to call the SOAP interface and combining it with actual business operations to evaluate the stability, timeliness, and reliability of the power SOAP interface.

[0003] Problems encountered: 1. Cumbersome script writing: POSTMAN and Jmeter require manually writing request messages in the request body, and the request messages need to be exported from the interface through technical means and then manually copied into POSTMAN or Jmeter.

[0004] 2. High utilization of client resources and poor performance: S0APUI needs to be installed locally on the client. With many test cases, the script files will become very large, and memory overflow will often occur. Therefore, it requires high client hardware resources. If the test volume is large, higher hardware configuration will be required.

[0005] 3. Poor usability: Most testing tools on the market are C / S programs, which heavily rely on the local environment and there are no universal B / S testing tools. If the interface content changes, such as adding request headers, and there are many test cases, it is necessary to adjust and modify them one by one in a large number of test cases, resulting in low script reusability. It does not support batch testing of multiple interfaces and can only support testing of a single interface.

[0006] 4. Low simulation accuracy: SOAPUI uses its own web service client, and the test messages it creates are different from the working process of a typical JAX-based or other web service client. SOAPUI does not generate Java classes from WSDL, nor does it handle the serialization and deserialization of Java objects. As a result, the client does not call the SOAP interface like a real web service consumer.

[0007] 5. High learning curve: It may not be very user-friendly for non-technical personnel. A certain technical background is required to use it, and some SOAP interface development experience is needed. Otherwise, some difficulties may be encountered in configuration and use.

[0008] 6. Low automation rate: Because C / S programs on the market are relatively closed, they cannot support automated testing and can only be tested manually. Summary of the Invention The purpose of this invention is to provide an automated testing method, device, equipment, and medium based on the power SOAP interface, which solves at least one of the following problems in the existing technology: cumbersome script writing, high utilization of client resources, poor performance, poor usability, low simulation degree, high learning cost, and low automation rate.

[0009] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides an automated testing method based on a power SOAP interface, comprising: Create a SOAP test task; the SOAP test task includes several test cases. Access the InitialWSDL address of the power application software under test, obtain the Initial WSDL file of the SOAP interface of the power application software under test through the InitialWSDL address and construct an XML DOM tree. Parse the XML DOM tree through an XML parsing library to obtain the structural information of the SOAP interface. For the SOAP test task, view the initial message corresponding to the SOAP test task, and fill in each test case in the initial message based on the obtained SOAP interface structural information to obtain the constructed SOAP request. Send the constructed SOAP request to the SOAP interface of the power application software under test; Receive the SOAP service response content returned by the SOAP interface of the target power application software, and parse and display the SOAP service response content.

[0010] A further improvement of the present invention is that the step of parsing the XML DOM tree through the XML parsing library specifically includes: traversing, querying, and processing the namespace of the XML DOM tree through the XML parsing library to obtain the structural information of the SOAP interface.

[0011] A further improvement of the present invention is that the structure information of the SOAP interface specifically includes: RequestUrl, request method name, and request parameter name.

[0012] A further improvement of the present invention is that: in the step of receiving the SOAP service response content returned by the SOAP interface of the target power application software, the SOAP service response returned by the SOAP interface of the target power application software is specifically received through HTTPclient.

[0013] A further improvement of the present invention is that, in the step of parsing and displaying the SOAP service response content, an XML parsing library is used to parse the SOAP service response content, extract the response results from the SOAP service response content, and display the response results.

[0014] A further improvement of the present invention is that it also includes asserting based on the existence, value, and structure of the response result to verify whether the response result meets expectations.

[0015] Secondly, the present invention provides an automated testing device based on a power SOAP interface, comprising: The task management module is used to create SOAP test tasks; each SOAP test task includes several test cases. The data generation module is used to access the InitialWSDL address of the power application software under test, obtain the InitialWSDL file of the SOAP interface of the power application software under test through the InitialWSDL address, construct an XMLDOM tree, parse the XMLDOM tree through an XML parsing library to obtain the structural information of the SOAP interface; for the SOAP test task, view the initial message corresponding to the SOAP test task, and fill in each test case in the initial message based on the obtained SOAP interface structural information to obtain the constructed SOAP request; The SOAP request sending module is used to send the constructed SOAP request to the SOAP interface of the power application software to be tested. The response result parsing module is used to receive the SOAP service response content returned by the SOAP interface of the target power application software, and to parse and display the SOAP service response content.

[0016] A further improvement of the present invention is that the step of the data generation module parsing the XML DOM tree through the XML parsing library specifically includes: traversing, querying, and processing the namespace of the XML DOM tree through the XML parsing library to obtain the structural information of the SOAP interface.

[0017] A further improvement of the present invention is that the structure information of the SOAP interface specifically includes: RequestUrl, request method name, and request parameter name.

[0018] A further improvement of the present invention is that: in the step of the response result parsing module receiving the SOAP service response content returned by the SOAP interface of the target power application software, the SOAP service response returned by the SOAP interface of the target power application software is specifically received through HTTPclient.

[0019] A further improvement of the present invention is that: in the step of parsing and displaying the SOAP service response content by the response result parsing module, an XML parsing library is used to parse the SOAP service response content, extract the response results from the SOAP service response content, and display the response results.

[0020] A further improvement of the present invention is that the response result parsing module is also used to make assertions based on the existence, value, and structure of the response result to verify whether the response result meets expectations.

[0021] Thirdly, the present invention provides an electronic device including a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the aforementioned automated testing method based on a power SOAP interface.

[0022] Fourthly, the present invention provides a computer-readable storage medium storing at least one instruction that, when executed by a processor, implements the automated testing method based on a power SOAP interface.

[0023] Compared with the prior art, the present invention has the following beneficial effects: Compared to existing technologies, this invention provides an automated testing method based on a power SOAP interface, comprising: creating a SOAP test task; the SOAP test task including several test cases; accessing the InitialWSDL address of the power application software under test, obtaining the InitialWSDL file of the SOAP interface of the power application software under test through the InitialWSDL address and constructing an XML DOM tree, parsing the XML DOM tree through an XML parsing library to obtain the structural information of the SOAP interface; for the SOAP test task, viewing the initial message corresponding to the SOAP test task, filling in each test case in the initial message based on the obtained SOAP interface structural information to obtain a constructed SOAP request; sending the constructed SOAP request to the SOAP interface of the power application software under test; receiving the SOAP service response content returned by the SOAP interface of the target power application software, and parsing and displaying the SOAP service response content. This invention moves SOAP testing from offline to online. Through a B / S service, it obtains the SOAP interface's structural information (RequestUrl, request method name, and request parameter names) from the SOAP interface's Initial WSDL (Web Service Description Language) file. This allows for the maintenance of a test script, which supports various execution strategies, including single execution, multiple executions, and scheduled execution. The invention is simple to use, with clear script design, reducing tedious debugging steps for testers. Furthermore, a single script file can meet the needs of running all SOAP test scenarios.

[0024] Addressing the technical problem of cumbersome script writing: This invention can automatically obtain SOAP interface message formats online, fix the messages in the clipboard, and copy them at any time, reducing the work of manual import and copying.

[0025] To address the technical issues of high resource utilization and poor performance: This invention is a B / S program that does not rely on client resources, runs in a one-to-many mode, has its own complete hardware architecture, such as processor, stack, registers, etc., and also has a corresponding instruction system to manage memory, resulting in lower program resource utilization and better stability.

[0026] To address the technical issue of poor usability: This invention is a B / S program that can be accessed through a browser. The interface is clear and concise, and if the interface content changes, it can be modified in batches. It also supports batch automated execution.

[0027] To address the issue of low simulation fidelity: This invention uses the HTTPCLIENT framework to call SOAP interfaces at the underlying level, based on the standard and clean Java language. It implements HTTP / 1.0 and HTTP / 1.1; and implements all HTTP methods (GET, POST, PUT, DELETE, HEAD, OPTIONS, and TRACE) in an extensible, object-oriented structure; it establishes transparent connections through an HTTP proxy and uses the CONNECT method to establish a tunneled HTTPS connection through the HTTP proxy, completely simulating real business system call requests. The result is that the client calls SOAP interfaces like a true web service consumer.

[0028] Addressing the issue of high learning costs in technical aspects: This invention does not require development experience; anyone who can understand SOAP interface documentation can perform SOAP interface testing. To address the technical issue of low automation rates: This invention supports batch testing and scheduled task execution of SOAP interfaces. Attached Figure Description

[0029] The accompanying drawings, which form part of this specification, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a flowchart illustrating an automated testing method for power application software based on a power SOAP interface, according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the structure of an automated testing device for power application software based on a power SOAP interface, according to an embodiment of the present invention. Figure 3 This is a schematic diagram of the structure of an electronic device according to the present invention. Detailed Implementation

[0030] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0031] The following detailed description is exemplary and intended to provide further detailed explanation of the invention. Unless otherwise specified, all technical terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this invention is for describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention.

[0032] Explanation of relevant key technologies: I6000: The Integrated Information and Communication Dispatch and Operation Support Platform is a crucial component of the company's "SG186" project, comprising six major support systems. Through a two-tier deployment model, the system achieves vertical integration and horizontal connectivity, covering the company headquarters, branches, provincial companies, and directly affiliated units. Its monitored objects encompass IT resources such as network equipment, security equipment, host equipment, databases, middleware, business systems, desktop terminals, data center environments, and maintenance processes. Through continuous improvement of system functions, it further meets the actual maintenance needs of various units and adapts to the development of the company's information and communication dispatch and operation system.

[0033] POSTMAN: Postman is an API testing tool. When performing API testing, Postman acts as a client, simulating various HTTP requests initiated by users, sending request data to the server, and obtaining the corresponding response results. This verifies whether the result data in the response matches the expected value and ensures that developers can handle bugs in the API in a timely manner, thereby guaranteeing the stability and security of the product after it goes live.

[0034] JMeter is a stress testing tool developed by the Apache Software Foundation based on Java, used for stress testing software.

[0035] S0APUI: SoapUI is an open-source testing tool that uses SOAP / HTTP to inspect, invoke, and implement functional / load / compliance tests of Web Services. This tool can be used as a standalone testing application or integrated into Eclipse, Maven 2.X, NetBeans, and IntelliJ using plugins. It organizes one or more test suites into a project. Each test suite contains one or more test cases, and each test case contains one or more test steps, including sending requests, receiving responses, analyzing results, and modifying the test execution flow.

[0036] Interface testing is a type of testing that examines the interfaces between system components. It primarily detects interaction points between external systems and the system itself, as well as between internal subsystems. The focus of this testing is to examine data exchange, transmission, and control management processes, as well as the logical dependencies between systems.

[0037] SOAP Interface: SOAP (Simple Object Access Protocol) is a simple protocol based on XML that allows applications to exchange information over HTTP. XML itself is a text file used for transmitting and storing data. SOAP can be understood as: HTTP + XML.

[0038] Automated testing: Automated testing is a process that transforms human-driven testing actions into machine execution. Typically, after test cases are designed and reviewed, testers execute the tests step-by-step according to the procedures described in the test cases, comparing the actual results with the expected results. To save manpower, time, or hardware resources and improve testing efficiency, the concept of automated testing was introduced.

[0039] This invention simplifies SOAP interface testing for power application software. It allows setting InitialWSDL, RequestUrl, request method name, request parameter name, and request message. The structure information of the SOAP interface (RequestUrl, request method name, and request parameter name) is obtained from the Initial WSDL (Web Services Description Language) file of the SOAP interface. Then, the request message is maintained for the method name to be tested. After maintenance, SOAP interface testing can be performed. Multiple SOAP interfaces can be selected for testing and executed on a schedule. After the test is completed, a test report is automatically generated.

[0040] This invention provides an automated testing device for power application software based on a power SOAP interface, comprising the following steps: 1. Task Management Module: This module is used to create SOAP test tasks, which include several test cases. It also manages test cases, including creation, editing, deletion, and storage. Test cases are specific testing methods, techniques, or technologies, expressing the testing process, requirements, and techniques in written form. Test cases can be written according to the business requirements of the power system and the SOAP interface specifications, supporting parameterized settings to cover different testing scenarios. In one specific implementation, a SOAP test task can contain multiple test cases; for example, a SOAP test task might need to test ten indicators, corresponding to ten test cases. Creating a SOAP test task involves configuring which test cases will be used for automated testing of the power application software.

[0041] 2. Data Generation Module: Used to access the InitialWSDL address of the power application software under test. This invention constructs an XML DOM (Document Object Model) tree based on the Initial WSDL (Web Services Description Language) file of the SOAP interface. The XML DOM tree is traversed, queried, and its namespaces are processed using an XML parsing library to obtain the SOAP interface's structural information: RequestUrl, request method name, and request parameter name. For the SOAP test task to be tested, the initial message corresponding to the SOAP test task is viewed. Based on the obtained SOAP interface structural information, the corresponding RequestUrl, request method name, and request parameter name in each test case of the initial message are filled in to obtain the constructed SOAP request. In one specific embodiment, the present invention acquires the WSDL file through the following steps: A request is sent to the target URL via the HTTP protocol (usually a GET request) to obtain file data. First, the request is ensured to be successful (HTTP status code 200), and the file type and size are verified through the response headers (Content-Type, Content-Length). To avoid memory overflow, the local file is opened in binary mode ('wb'), and the response data is read chunk by chunk using streaming (requests.get(url,stream=True)) (via iter_content(chunk_size=8192)), writing the data to the WSDL file in real time to complete the file acquisition. If WSDL file generation fails, network connectivity is checked or the validity of the Initial WSDL address is confirmed.

[0042] In one specific implementation, the SOAP interface initialization message (taking the information transmission model of the SOAP interface in a power information system as an example); the SOAP interface initialization message adopts a hierarchical data structure and includes the following core elements: Basic information section: The CorporationCode field has a default value of "99" to identify the test subject. The timestamp field (Time) is reserved as an empty value and will be automatically filled with the current time by the system. Initial interface configuration section: It contains 9 pre-defined business monitoring interface declarations, each defined by the "api" element and specifying a unique name attribute (name): User registration number monitoring interface (BusinessUserRegNum); System online user monitoring interface (BusinessSystemOnlineNum); Daily login count monitoring interface (BusinessDayLoginNum); BusinessVisitCount API. System session count monitoring interface (BusinessSystemSessionNum). System response time monitoring interface (BusinessSystemResponseTime); System runtime monitoring interface (BusinessSystemRunningTime); Data tablespace monitoring interface (BusinessDataTableSpace); Database operation time monitoring interface (BusinessSystemDBTime).

[0043] The padded message (in the test scenario, the following monitoring interface configuration is added to the original message through a dynamic expansion mechanism): Add a new business metric interface (keeping the original basic information fields unchanged): Report generation quantity monitoring interface (ItemReportCount); Information notification quantity monitoring interface (ItemInformCount); Departmental statistics and quantity monitoring interface (ItemDeptCount); Power plant connection count monitoring interface (ItemPowerPlantCount); Data publication count monitoring interface (ItemPublishDatCountaCount); Report data submission volume monitoring interface (ItemReportDataCount); Submit the accuracy rating interface (ItemSubmissionAccuracyGrade). Submission timeliness rate monitoring interface (ItemSubmissionTimelinessRate); Complete report quantity monitoring interface (ItemCompleteReportCount); The interface for monitoring the number of planning reports (ItemPlanningReportCount).

[0044] 3. SOAP Request Sending Module: This module sends pre-built SOAP requests to the SOAP interface of the power application software under test. It supports multiple SOAP protocol versions and message formats to adapt to different power system business needs, and receives response content from SOAP services. 1) Automatic WSDL Parsing: Automatically generates a test environment, including service, endpoint, and operation lists, by parsing WSDL files. Its built-in XML parsing engine supports WSDL files of different versions of the SOAP protocol (such as SOAP 1.1 / 1.2), and can recognize and process the namespaces, message structures, and binding methods defined in each version. For example, when importing WSDL for power system information transmission, it can automatically extract the XML Schema definitions of equipment data such as transformers and circuit breakers, and generate corresponding test request templates.

[0045] 2) Dynamic Message Construction: Based on the message definitions in the WSDL, users can dynamically populate parameter values ​​and generate SOAP requests that conform to the target protocol version. For example, when testing the power system data query interface, users can directly modify parameters such as voltage level and device ID in the generated request template, and the system will automatically verify whether the parameter types and XML structure conform to the WSDL requirements.

[0046] 3) Multi-protocol transmission support: The underlying transmission module of this module isolates the coupling between the SOAP protocol and specific transmission protocols (such as HTTP, SMTP, JMS) through an abstraction layer. In the SOAP / HTTP communication mode commonly used in power systems, this module can configure custom HTTP headers (such as the SOAPAction field) to ensure that the request meets the requirements of a specific server; for asynchronous notification scenarios, SOAP messages can be sent via the SMTP protocol.

[0047] 4) Adaptive Message Format: In addition to the standard SOAP Envelope, this module supports processing extended formats commonly used in power system operations, such as MTOM / XOP encapsulation with binary attachments. By configuring the message encoding method, it can achieve mixed transmission of text XML and binary data, meeting the needs of scenarios such as equipment monitoring data reporting.

[0048] 5) Scalable Framework Design: This module incorporates a Groovy scripting engine, allowing users to extend test logic through code. For example, when testing power system fault simulation interfaces, random fault codes can be dynamically generated via scripts, and the fault handling results returned by the server can be verified to meet expectations. Simultaneously, Groovy can call external Java libraries to handle complex XML transformations, such as mapping XSD types in WSDL to Java objects for validation.

[0049] 6) Plug-in Architecture: This module supports extending the protocol parser or message generator through plug-ins. If the power system business adopts a customized SOAP extension protocol, developers can develop dedicated plug-ins based on the open API of this module to realize functions such as automatic protocol version recognition and message signature verification without modifying the core code.

[0050] 7) Data Source Binding: This module allows you to bind test data from Excel, CSV, or a database to SOAP request parameters. For example, when batch testing the load query interface of different substations, you can iterate through the list of substation IDs using the data source to automatically generate multiple sets of test requests and compare the real-time data returned by the server with the expected values.

[0051] 8) Test Step Reuse: By extracting common operations (such as authentication and logging) into independent test steps, this module supports the construction of modular test scenarios. In power system operations, steps such as user login and permission verification can be encapsulated into reusable components, reducing the maintenance cost of multi-interface test cases.

[0052] 4. Response Result Parsing Module: This module receives the SOAP service response content returned by the target power application software's SOAP interface via HTTPclient, parses the SOAP service response content again using an XML parsing library, extracts the response results from the SOAP service response content, and displays the response results. This invention provides an assertion library that can verify whether the response content meets expectations based on the existence, value, and structure of response elements.

[0053] 5. Test Report Viewing Module: Generates detailed test reports based on the response results, including information on test case execution, pass rate, and reasons for failure. Test reports can be output in various formats (such as HTML, PDF, etc.) for easy viewing and analysis by testers.

[0054] This invention moves SOAP testing from offline to online. Through a B / S service, it obtains the SOAP interface's structure information (RequestUrl, request method name, and request parameter names) from the SOAP interface's Initial WSDL (Web Service Description Language) file. This allows for the maintenance of a test script, which supports various execution strategies, including single execution, multiple executions, and scheduled execution. The invention is simple to use, with clear script design, reducing tedious debugging steps for testers. Furthermore, a single script file can meet the needs of running all SOAP test scenarios.

[0055] This invention provides a user-friendly graphical interface that is simple and convenient to operate, improving testing efficiency without requiring any learning curve. Test results are more accurate, effectively evaluating the reliability of SOAP interfaces. The underlying HTTPCLIENT framework is used to call SOAP interfaces, based on standard, clean Java, resulting in higher fidelity. Testers do not need specialized language skills, effectively reducing their learning curve. Furthermore, it is compatible with mainstream browsers (IE / Chrome / Firefox) and operating systems (Windows / All), offering better compatibility.

[0056] Please see Figure 1 As shown, this embodiment of the invention provides an automated testing method based on a power SOAP interface, including: S1. Create a SOAP test task; the SOAP test task includes several test cases; S2. Access the InitialWSDL address of the power application software under test, obtain the Initial WSDL file of the SOAP interface of the power application software under test through the InitialWSDL address and construct an XML DOM tree. Parse the XML DOM tree through an XML parsing library to obtain the structural information of the SOAP interface. For the SOAP test task, view the initial message corresponding to the SOAP test task, and fill in each test case in the initial message based on the obtained structural information of the SOAP interface to obtain the constructed SOAP request. S3. Send the constructed SOAP request to the SOAP interface of the power application software to be tested; S4. Receive the SOAP service response content returned by the SOAP interface of the target power application software, and parse and display the SOAP service response content.

[0057] In one specific implementation, the step of parsing the XML DOM tree using an XML parsing library specifically includes: traversing, querying, and processing the namespace of the XML DOM tree using an XML parsing library to obtain the structural information of the SOAP interface.

[0058] In one specific implementation, the structure information of the SOAP interface specifically includes: RequestUrl, request method name, and request parameter name.

[0059] In one specific implementation, the step of receiving the SOAP service response content returned by the SOAP interface of the target power application software is specifically implemented by receiving the SOAP service response returned by the SOAP interface of the target power application software through an HTTP client.

[0060] In one specific implementation, in the step of parsing and displaying the SOAP service response content, an XML parsing library is used to parse the SOAP service response content, extract the response results from the SOAP service response content, and display the response results.

[0061] In one specific implementation, it further includes: making assertions based on the existence, value, and structure of the response result to verify whether the response result meets expectations.

[0062] Please see Figure 2 As shown, this embodiment of the invention provides an automated testing device based on a power SOAP interface, comprising: The task management module is used to create SOAP test tasks; each SOAP test task includes several test cases. The data generation module is used to access the InitialWSDL address of the power application software under test, obtain the InitialWSDL file of the SOAP interface of the power application software under test through the InitialWSDL address, construct an XMLDOM tree, parse the XMLDOM tree through an XML parsing library to obtain the structural information of the SOAP interface; for the SOAP test task, view the initial message corresponding to the SOAP test task, and fill in each test case in the initial message based on the obtained SOAP interface structural information to obtain the constructed SOAP request; The SOAP request sending module is used to send the constructed SOAP request to the SOAP interface of the power application software to be tested. The response result parsing module is used to receive the SOAP service response content returned by the SOAP interface of the target power application software, and to parse and display the SOAP service response content.

[0063] This invention has been implemented and tested on an automated interface testing platform (CEPRI-APITester). This invention simplifies SOAP interface testing. Based on the SOAP interface's Initial WSDL (Web Services Description Language) file, it obtains the SOAP interface's structural information: RequestUrl, request method name, and request parameter names. After maintaining the interface information, SOAP interfaces can be tested online. A SOAP testing method simulating real user operations is implemented using Java and HttpClient. This simplifies the SOAP testing steps for testers and improves the efficiency of SOAP testing.

[0064] This invention can obtain the structural information of the SOAP interface from the Initial WSDL (Web Services Description Language) file of the SOAP interface: RequestUrl, request method name, and request parameter name; this invention can be executed in a script, with specific execution strategies: single execution, multiple execution, and scheduled execution; this invention has online debugging capabilities and can realize online testing of SOAP interfaces without relying on the local environment.

[0065] Please see Figure 2 As shown, the present invention provides an automated testing device based on a power SOAP interface, comprising: The task management module is used to create SOAP test tasks; each SOAP test task includes several test cases. The data generation module is used to access the InitialWSDL address of the power application software under test, obtain the InitialWSDL file of the SOAP interface of the power application software under test through the InitialWSDL address, construct an XMLDOM tree, parse the XMLDOM tree through an XML parsing library to obtain the structural information of the SOAP interface; for the SOAP test task, view the initial message corresponding to the SOAP test task, and fill in each test case in the initial message based on the obtained SOAP interface structural information to obtain the constructed SOAP request; The SOAP request sending module is used to send the constructed SOAP request to the SOAP interface of the power application software to be tested. The response result parsing module is used to receive the SOAP service response content returned by the SOAP interface of the target power application software, and to parse and display the SOAP service response content.

[0066] Please see Figure 3 As shown, this embodiment of the invention provides an electronic device 100 for implementing an automated testing method based on a power SOAP interface; the electronic device 100 includes a memory 101, at least one processor 102, a computer program 103 stored in the memory 101 and executable on the at least one processor 102, and at least one communication bus 104.

[0067] The memory 101 can be used to store the computer program 103. The processor 102 implements the steps of the automated testing method based on the power SOAP interface described in the embodiment by running or executing the computer program stored in the memory 101 and calling the data stored in the memory 101. The memory 101 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device 100 (such as audio data), etc. In addition, the memory 101 may include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other non-volatile solid-state storage device.

[0068] The at least one processor 102 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 102 may be a microprocessor or any conventional processor. The processor 102 is the control center of the electronic device 100, connecting various parts of the electronic device 100 via various interfaces and lines.

[0069] The memory 101 in the electronic device 100 stores multiple instructions to implement an automated testing method based on a power SOAP interface, and the processor 102 can execute the multiple instructions to achieve the following: Create a SOAP test task; the SOAP test task includes several test cases. Access the InitialWSDL address of the power application software under test, obtain the Initial WSDL file of the SOAP interface of the power application software under test through the InitialWSDL address and construct an XML DOM tree. Parse the XML DOM tree through an XML parsing library to obtain the structural information of the SOAP interface. For the SOAP test task, view the initial message corresponding to the SOAP test task, and fill in each test case in the initial message based on the obtained SOAP interface structural information to obtain the constructed SOAP request. Send the constructed SOAP request to the SOAP interface of the power application software under test; Receive the SOAP service response content returned by the SOAP interface of the target power application software, and parse and display the SOAP service response content.

[0070] If the modules / units integrated in the electronic device 100 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0071] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0072] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0073] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0074] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0075] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. An automated testing method based on the power SOAP interface, characterized in that, include: Create a SOAP test task; the SOAP test task includes several test cases. Access the InitialWSDL address of the power application software under test, obtain the Initial WSDL file of the SOAP interface of the power application software under test through the InitialWSDL address and construct an XML DOM tree. Parse the XML DOM tree through an XML parsing library to obtain the structural information of the SOAP interface. For the SOAP test task, view the initial message corresponding to the SOAP test task, and fill in each test case in the initial message based on the obtained SOAP interface structural information to obtain the constructed SOAP request. Send the constructed SOAP request to the SOAP interface of the power application software under test; Receive the SOAP service response content returned by the SOAP interface of the target power application software, and parse and display the SOAP service response content.

2. The automated testing method based on the power SOAP interface according to claim 1, characterized in that, The steps of parsing the XML DOM tree using an XML parsing library specifically include: traversing, querying, and processing the namespace of the XML DOM tree using the XML parsing library to obtain the structural information of the SOAP interface.

3. The automated testing method based on the power SOAP interface according to claim 1, characterized in that, The specific structure information of the SOAP interface includes: RequestUrl, request method name, and request parameter name.

4. The automated testing method based on the power SOAP interface according to claim 1, characterized in that, The step of receiving the SOAP service response content returned by the SOAP interface of the target power application software specifically involves receiving the SOAP service response returned by the SOAP interface of the target power application software through an HTTP client.

5. The automated testing method based on the power SOAP interface according to claim 1, characterized in that, In the step of parsing and displaying the SOAP service response content, an XML parsing library is used to parse the SOAP service response content, extract the response results from the SOAP service response content, and display the response results.

6. The automated testing method based on the power SOAP interface according to claim 5, characterized in that, Also includes: Assertions are made based on the existence, value, and structure of the response results to verify whether the results meet expectations.

7. An automated testing device based on a power SOAP interface, characterized in that, include: The task management module is used to create SOAP test tasks; each SOAP test task includes several test cases. The data generation module is used to access the InitialWSDL address of the power application software under test, obtain the InitialWSDL file of the SOAP interface of the power application software under test through the InitialWSDL address, construct an XML DOM tree, parse the XML DOM tree through an XML parsing library to obtain the structural information of the SOAP interface; for the SOAP test task, view the initial message corresponding to the SOAP test task, and fill in each test case in the initial message based on the obtained SOAP interface structural information to obtain the constructed SOAP request; The SOAP request sending module is used to send the constructed SOAP request to the SOAP interface of the power application software to be tested. The response result parsing module is used to receive the SOAP service response content returned by the SOAP interface of the target power application software, and to parse and display the SOAP service response content.

8. The automated testing device based on the power SOAP interface according to claim 7, characterized in that, The data generation module parses the XML DOM tree using an XML parsing library. Specifically, this includes traversing, querying, and processing the namespace of the XML DOM tree using the XML parsing library to obtain the structural information of the SOAP interface.

9. The automated testing device based on the power SOAP interface according to claim 7, characterized in that, The specific structure information of the SOAP interface includes: RequestUrl, request method name, and request parameter name.

10. The automated testing device based on the power SOAP interface according to claim 7, characterized in that, In the step of the response result parsing module receiving the SOAP service response content returned by the SOAP interface of the target power application software, the SOAP service response returned by the SOAP interface of the target power application software is specifically received through HTTPclient.

11. The automated testing device based on the power SOAP interface according to claim 7, characterized in that, In the step of parsing and displaying the SOAP service response content in the response result parsing module, an XML parsing library is used to parse the SOAP service response content, extract the response results from the SOAP service response content, and display the response results.

12. The automated testing device based on the power SOAP interface according to claim 11, characterized in that, The response result parsing module is also used to make assertions based on the existence, value, and structure of the response result to verify whether the response result meets expectations.

13. An electronic device, characterized in that, It includes a processor and a memory, the processor being used to execute a computer program stored in the memory to implement the automated testing method based on the power SOAP interface as described in any one of claims 1 to 6.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction, which, when executed by a processor, implements the automated testing method based on the power SOAP interface as described in any one of claims 1 to 6.