CN112988590A - Electromagnetic environment hybrid automatic testing method and system, storage medium and terminal equipment - Google Patents

Electromagnetic environment hybrid automatic testing method and system, storage medium and terminal equipment Download PDF

Info

Publication number
CN112988590A
CN112988590A CN202110355451.7A CN202110355451A CN112988590A CN 112988590 A CN112988590 A CN 112988590A CN 202110355451 A CN202110355451 A CN 202110355451A CN 112988590 A CN112988590 A CN 112988590A
Authority
CN
China
Prior art keywords
test
module
test case
electromagnetic environment
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110355451.7A
Other languages
Chinese (zh)
Inventor
李蒙
韩庆军
祖健
张宜涛
曹巍楠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CRRC Qingdao Sifang Co Ltd
Original Assignee
CRRC Qingdao Sifang Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CRRC Qingdao Sifang Co Ltd filed Critical CRRC Qingdao Sifang Co Ltd
Priority to CN202110355451.7A priority Critical patent/CN112988590A/en
Publication of CN112988590A publication Critical patent/CN112988590A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method, a system, a storage medium and a terminal device for hybrid automatic testing of an electromagnetic environment, which are used for acquiring a data file, reading function points in sequence and judging the execution state of the function points; acquiring a test case and test data corresponding to the executed function point; extracting keywords of the test case and the test data, determining the test case, and reading an operation execution object for testing; realizing corresponding element positioning through image matching, and executing the test case at a corresponding position according to the test steps; the invention can save manpower and material resources, improve testing efficiency and reduce time cost.

Description

Electromagnetic environment hybrid automatic testing method and system, storage medium and terminal equipment
Technical Field
The invention belongs to the technical field of software automated testing, and particularly relates to a hybrid automated testing method and system for an electromagnetic environment, a storage medium and terminal equipment.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
The electromagnetic environment which experiences complex dynamic changes during the operation of the rail vehicle faces the emission from various electromagnetic disturbance sources inside and outside the system, and strong disturbance transmission paths such as coupling, radiation, conduction and crosstalk exist among various emission sources and are mixed and coexisted, so that the complexity of the electromagnetic compatibility research of the system level is increased.
Aiming at the complication of the electromagnetic environment of the rail transit system, some of the existing test methods still need personnel to participate, some test contents are fixed, and cannot be simply added or updated, new electromagnetic test projects cannot be realized, or codes of a test frame need to be changed due to frequent change of requirements, and the problem that the existing functions are influenced by the addition of new functions also exists.
Disclosure of Invention
In order to solve the problems, the invention provides a method, a system, a storage medium and a terminal device for hybrid automatic testing of an electromagnetic environment.
According to some embodiments, the invention adopts the following technical scheme:
an electromagnetic environment hybrid automatic test method comprises the following steps:
acquiring a data file;
reading the function points according to the sequence and judging the execution state of the function points;
acquiring a test case and test data corresponding to the executed function point;
extracting keywords of the test case and the test data, determining the test case, and reading an operation execution object for testing;
realizing corresponding element positioning through image matching, and executing the test case at a corresponding position according to the test steps;
and recording the parameters related to the execution condition of the test case, and generating a test report.
As an alternative embodiment, the specific process of extracting the keywords of the test case and the test data and determining the test case step includes: and encapsulating actions to be executed into corresponding keywords in advance, and corresponding the corresponding keywords to the testing step.
As a further limited embodiment, when the actions to be executed are packaged into corresponding keywords in advance, the keywords corresponding to different actions to be executed are fixed, different testing steps are determined by combining different keywords, and different test cases are formed by combining different data.
As an alternative implementation, if the test case needs to be modified, the definition of the corresponding operation method is added in the pre-packaged keyword, the method to be called when the keyword is executed is added, and the corresponding step is added in the test step.
As an alternative embodiment, the specific process of implementing the positioning of the corresponding element by image matching includes: and preprocessing the control screenshot and the current page screenshot, extracting features, and matching the two images to obtain the position coordinate value of the element on the page, so that the element is executed.
As a further limited embodiment, the process of preprocessing the control screenshot and the current page screenshot includes: the image is grayed, the RGB values of each pixel point of the image are unified into a value, and three channels are changed into a single channel.
As a further limited implementation, the process of feature extraction for the control screenshot and the current page screenshot includes: and establishing a Gaussian scale space by using an SIFT algorithm, detecting local extreme points, calculating the direction of key points, and generating a feature vector to extract feature points to obtain feature point sets of the two images.
As an alternative embodiment, the specific process of image matching includes:
judging whether the positioning mode of the element is image matching or not, if so, acquiring a corresponding control screenshot from an image library, simultaneously performing screenshot operation on the current page and storing the screenshot, matching the two images to obtain the position coordinate of the control screenshot in the page, and storing the coordinate as a variable to be used; and realizing the execution of the corresponding operation at the coordinate of the page by matching the obtained coordinate information.
As an alternative embodiment, the parameters related to the test case execution condition include, but are not limited to: the name and the test execution state of the test case, the log record of the process when the test case fails to execute, the position and the reason of the problem, the time point when the test case starts to execute and the time required by the execution of the test case.
An electromagnetic environment hybrid automated test system, comprising:
a receiving module configured to receive an input data file;
the reading module is configured to read the function points in sequence, judge the execution state of the function points and acquire the test cases and the test data corresponding to the executed function points;
the driving module is configured to extract keywords of a test case and test data, determine a test case step and read an operation execution object for testing;
the image matching module is configured to realize corresponding element positioning through image matching;
the execution module is configured to execute the test case according to the determined test steps at the corresponding positions;
the report generation module is configured to record the relevant parameters of the test case execution condition and generate a test report;
and the packaging module is configured to package the algorithm involved in the test execution process.
As an alternative embodiment, the driving module includes a data driving module, a keyword driving module, and a WebUI driving module, where the data driving module is configured to separate test data and test scripts in a test case, the keyword driving module is configured to determine a corresponding test step according to a preset definition of a keyword and the test data, and the WebUI driving module is configured to provide a function of positioning Web page elements and executing operations in the test step.
As an alternative embodiment, the packaging module is configured to implement storage of data and reading of cell data, generating picture names, acquiring current time of the system, and performing screenshot on the page.
As an alternative embodiment, the execution module is configured to invoke the keyword extraction result of the driver module and the related algorithm of the encapsulation module to implement the execution of the test case.
As an alternative embodiment, the image matching module includes a preprocessing module, a feature extraction module and a matching module, the preprocessing module is configured to perform graying processing on the image, unify RGB values of each pixel point of the image into one value, and change three channels into a single channel;
the feature extraction module is configured to establish a Gaussian scale space, detect local extreme points, calculate key point directions and generate feature vectors by using an SIFT algorithm so as to extract feature points and obtain feature point sets of two images;
and the matching module is configured to acquire the corresponding control screenshot from the image library, perform screenshot operation on the current page and store the screenshot, and match the two images to obtain the position coordinate of the control screenshot in the page.
As an alternative embodiment, the report generating module is configured to filter different running states of the test case according to the test result, and display a name of the test case, a test execution state, a process log record when the test case fails to execute, a position and a reason of a problem, a time point when the test case starts to execute, and time required for executing the test case.
A computer readable storage medium having stored therein a plurality of instructions adapted to be loaded by a processor of a terminal device and to perform the steps of the method for electromagnetic environment hybrid automated testing.
A terminal device comprising a processor and a computer readable storage medium, the processor being configured to implement instructions; the computer readable storage medium is for storing a plurality of instructions adapted to be loaded by a processor and to perform the steps of the electromagnetic environment hybrid automated testing method.
Compared with the prior art, the invention has the beneficial effects that:
the invention combines the advantages of the data driving test framework and the keyword driving test framework, aims at the problem of non-Web elements which can not be identified, utilizes the SIFT algorithm to carry out image matching, reduces the influence of colors on the later image matching in the image matching process, increases the definition and the contrast of the image, can improve the image matching effect in the image matching process, realizes the positioning of the non-Web elements and is beneficial to the execution of the test step.
The invention utilizes the package of the general algorithm and the operation package used in the test step in advance to become the keywords, when the test content is increased or changed, only the keywords are needed to be increased or changed, and the corresponding test step is needed, thereby solving the trouble that the code of the test frame needs to be changed due to frequent change of the requirement of the system to be tested, solving the problem that the regression test repeatedly executes the test case under the condition that the overall function of the system to be tested is more complex, simultaneously improving the code reuse rate, and facilitating the modification and maintenance of the test data by the tester.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the invention and together with the description serve to explain the invention and not to limit the invention.
FIG. 1 is a flow chart of test case execution according to the first embodiment;
FIG. 2 is a flow chart of image matching according to the first embodiment;
fig. 3 is an overall architecture of the automated test system according to the second embodiment.
The specific implementation mode is as follows:
the invention is further described with reference to the following figures and examples.
It is to be understood that the following detailed description is exemplary and is intended to provide further explanation of the invention as claimed. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the invention. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
In the present invention, terms such as "upper", "lower", "left", "right", "front", "rear", "vertical", "horizontal", "side", "bottom", and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only terms of relationships determined for convenience of describing structural relationships of the parts or elements of the present invention, and are not intended to refer to any parts or elements of the present invention, and are not to be construed as limiting the present invention.
In the present invention, terms such as "fixedly connected", "connected", and the like are to be understood in a broad sense, and mean either a fixed connection or an integrally connected or detachable connection; may be directly connected or indirectly connected through an intermediate. The specific meanings of the above terms in the present invention can be determined according to specific situations by persons skilled in the relevant scientific or technical field, and are not to be construed as limiting the present invention.
The first embodiment is as follows:
as shown in fig. 1, an electromagnetic environment hybrid automatic testing method includes the following steps:
s01 obtaining a data file, which is xls data in this embodiment;
s02 reading the function points in sequence, judging the execution state of the function points, if the judgment result is that the function points are needed or are being executed, or the execution state is Y, carrying out the next step, otherwise, returning to the step S01;
s03, obtaining a test case and test data corresponding to the function point;
s04 extracting key words of test cases and test data, determining the steps of the test cases, and reading operation execution objects for testing;
s05, realizing corresponding element positioning through image matching, and executing the test case at the corresponding position according to the test steps;
and S06 recording the parameters related to the execution condition of the test case and generating a test report.
In step S04, the actions to be executed need to be packaged into corresponding keywords in advance, and the corresponding keywords are associated with the testing step.
In this embodiment, when the actions to be executed are packaged into corresponding keywords in advance, the keywords corresponding to different actions to be executed are fixed, different testing steps are determined by combining different keywords, and different test cases are formed by combining different data. If the test case needs to be modified, the definition of the corresponding operation method is added in the pre-packaged key word, the method to be called when the key word is executed is added, and the corresponding step is added in the test step.
As shown in fig. 2, the specific process of step S05 includes:
s0501, judging whether the element positioning mode is image matching, if so, obtaining a corresponding control screenshot from an image library, and simultaneously performing screenshot operation on the current Web page and storing the screenshot;
in this step, if the image matching method is not used for positioning, xpath positioning is used.
S0502, preprocessing the control screenshot and the current page screenshot;
s0503, extracting features of the preprocessed picture;
s0504 matches the two images to obtain the position coordinate value of the element on the page, thereby realizing the execution operation of the element.
In this embodiment, the preprocessing of step S0502 is mainly to perform graying processing on the image, unify RGB values of each pixel of the image into one value, and change three channels into a single channel.
In step S0503, a SIFT algorithm is used to establish a gaussian scale space, detect local extreme points, calculate key point directions, generate feature vectors, and extract feature points to obtain feature point sets of two images.
In step S0504, matching the two images to obtain a position coordinate of the control screenshot in the page, and storing the coordinate as a variable to be used; and realizing the execution of the corresponding operation at the coordinate of the page by matching the obtained coordinate information.
If the match is not successful, an exception is displayed and the test case fails.
In step S06, according to the test result, the test case name and the test execution state, the process log record when the test case fails to execute, the location and reason of the problem, the time point when the test case starts to execute, the time required to execute the test case, and other information are embedded in the test report.
Of course, the above information may be deleted or added according to the test needs and the specific situation. The method of generating the report may be by using an existing report generation algorithm.
Example two
The system of the embodiment is implemented based on the Selenium, and mainly comprises a driving module, a BasePage module, an image matching module, an execution module and a report generation module, as shown in fig. 3; wherein, the BasePage module mainly realizes the encapsulation of a general method; the image matching module realizes non-Web element positioning by matching the control screenshot with the page screenshot; the execution module realizes the calling of the keywords and the execution of the test cases in the test step; and the report generation module realizes the generation of an automatic test report by importing the HTMLTestRunner module.
In some embodiments, the system further includes a Page-Object module, which mainly rewrites the self-contained method of the Selenium WebDriver, such as single element location, multiple element location, and the like, and adds a try. On the other hand, the module also packages the method and then facilitates the function library module to call the method.
As shown in fig. 3, the driver module performs information/data interaction with the execution module, the function library, and the Page-Object module.
The system adopts a modular design, and the design has the advantage that when the project requirements change or the requirements are increased, corresponding data only need to be modified or corresponding script codes only need to be added in corresponding modules.
The embodiment provides a hybrid drive automatic test system, and a drive module comprises a data drive, a keyword drive and a WebUI drive. The data driving is realized through test data and test scripts in the test cases, and the keyword driving is realized through the definition of keywords in the scripts and the test data. The WebUI driver, the Selenium automated testing tool, is primarily a function that provides scripts with the location of Web page elements and the execution of operations in the testing step.
In the hybrid drive automatic test system of this embodiment, Python is selected as a development language, Pycharm is selected as an integrated development environment, an xpath positioning method is used to position and package page elements, an xpath of the elements is obtained through an xpath helper plugin, and data such as test function points and test cases are stored in an xls file and read when a script is to be executed.
On the premise that the test case is built, the execution module uses a Unitest unit test frame with Python as a case organization execution frame, all test cases are added into a test suite by adopting Unittest.
Of course, test scripts and test data external to the system are provided to service the system. The test data comprises a plurality of tables such as test function points, test steps, test cases, data and page element positioning and the like, and the script to be tested is read and called.
Each of the important modules is described in detail below.
Firstly, a driving module, a data driving module in the driving module is configured to separate test data from a test script, and the test steps of data driving need to be embodied in the script in detail, so that the design is complex.
In the electromagnetic environment test platform, there are many repetitive operations, such as clicking, text box input, etc., so in this embodiment, a keyword module is designed, and a keyword-driven manner is adopted to achieve the purpose of separating the test steps.
In the keyword module, the action to be executed can be packaged into a keyword to increase the reusability of the action. Therefore, when a tester writes a test step, only different keywords need to be combined, then different data are input to design different test cases, the keywords can be corresponding to the form of the test step, and the function method corresponding to the keywords is called by reading the corresponding keywords when the test step is executed.
By introducing the keywords, the multiplexing rate of the codes can be improved on one hand, and modification and maintenance of the test data by the tester are facilitated on the other hand.
For example, explaining with a specific example, a new keyword needs to be added in a new requirement, only 3 places need to be modified at a time: 1) adding the definition of the corresponding operation method in the code of the key word module, 2) adding the method to be called when the key word is executed in the execution engine, and 3) adding the corresponding step in the test step.
If the method for executing the 'input' keyword is called, when the keyword in the test step is 'input', an 'input _ Text' method in an exeKeyword class is called to realize the input of the content of the Text box, wherein a 'loc' parameter in the 'input _ Text' method is a positioning mode of the Text box, a 'txt [ k ]' is data in a kth column in a table and is the content input in the Text box, and the parameters have corresponding data in each test case.
It can be seen that the processing of the code can be realized without special professional personnel through the design of the key words and the corresponding method thereof.
In this embodiment, the BasePage module mainly implements encapsulation of a method common to all pages. In the present system, its functions include: the relevant operations of the xls table, in this embodiment, include storing data, reading cell data, etc., generating a picture name, acquiring the current time of the system, and performing screenshot on a page.
If a WebDriver self-contained method is directly used in codes when test cases are executed, the whole test work can be stopped when one test case is abnormal. For example, find _ element _ by _ XXX, the syntax can implement element positioning in different modes, and if the statement is written directly in the code, the page element positioning can cause the exception exit of the whole program when not reaching the position, and the subsequent test case cannot be executed. Therefore, the method is packaged into a corresponding function in the design of the automatic test framework, and a mechanism of exception handling is added in the packaging process. The BasePage module implements the encapsulation of syntax functions such as find _ element _ by _ XXX into functions.
The execution module of the system takes python as a platform, calls a keyword method, a BasePage module function and the like to realize the execution of the test case, and comprises the following steps:
s101, after the test scene is successfully created, the script traverses the test function point document according to the sequence of the function points;
s102, judging whether the execution state of the function point is Y or not according to the sequence;
s103, if the execution state is Y, acquiring test case information and test step information corresponding to the functional point; if the execution state is 'N', jumping to the next function point to judge the execution state;
s104, after the test case information is obtained, reading test data, corresponding keywords in the test step and packaged elements according to the serial number of the test case, and calling a keyword method;
s105, executing a test case according to the test step;
and S106, after the execution of the test case is finished, generating an HTML test report.
In this embodiment, for the problem of non-Web elements that cannot be identified by the Selenium WebDriver, an image matching module is designed, which is configured to perform corresponding preprocessing and feature extraction on the control screenshot and the current page screenshot, then match the two images, and obtain a position coordinate value of the element on the page by matching the image to be matched with the page screenshot, thereby implementing the execution operation of the element.
The preprocessing module in the image matching module is connected with the image feature extraction module, when images are analyzed, the images are processed before the image feature extraction module, and because the quality of the images directly influences the success rate of image matching in the image matching process, two images need to be preprocessed before the image analysis.
The purpose of the preprocessing module is mainly to remove irrelevant information in the image, eliminate noise and interference, recover useful information and enhance the useful information, thereby improving the reliability in the feature extraction process.
In this embodiment, the preprocessing module adopts a graying processing algorithm, which can unify the RGB values of each pixel point of the image into one value, and change three channels into a single channel.
And the image feature extraction module is configured to extract the feature points by using an SIFT algorithm, and the feature point sets of the two images are obtained after extraction.
Certainly, the feature extraction process mainly comprises four steps of establishing a Gaussian scale space, detecting local extreme points, calculating the direction of key points and generating feature vectors. The steps and algorithms may be implemented using any conventional method.
The image matching module is mainly configured to execute the following steps when performing the image matching process:
s201, firstly, judging whether the positioning mode of the element is image matching or not, and if so, carrying out the next step.
S202, acquiring the corresponding control screenshot from the image library, and simultaneously performing screenshot operation on the current page and storing the screenshot.
S203, matching the two images in the previous step to obtain the position coordinates of the control screenshot in the page, and storing the coordinates as variables to be used.
S204, the execution of the corresponding operation at the coordinate of the page is realized by matching the obtained coordinate information.
The test can be completed through the functions of the driving module, the executing module, the Page-Object module and other modules, and in this embodiment, the test report is automatically generated by the report generating module. So that the tester can analyze the problems occurring in the test process according to the test report.
Certainly, to implement the above functions, the test report first needs to include the name and the running state of each test case, and for a test case that fails in the test, a specific step and a specific object where a problem occurs should be displayed in the test report. Secondly, the test report has the function of respectively counting the number of the passed test cases and the number of the failed test cases, and a tester can perform screening display according to different running states of the test cases, so that the execution result of the test cases is clear at a glance. And finally, the execution time of the test case needs to be displayed in the report, so that the comparison with the manual test time is convenient, and the efficiency of the automatic test is analyzed.
In view of the above conditions, the present embodiment selectively imports an HTMLTestRunner module to generate a test report, and the generated test report mainly includes the following information and functions: the name and the test execution state of the test case, the log record of the process when the test case fails to execute, the position and the reason of the problem, the time point when the test case starts to execute and the time required by the execution of the test case.
The tester can screen through the execution state of the test cases and count the number of the cases of different types. The title of the test report can be defined by the code, so that the test reports of the modules can be distinguished conveniently.
EXAMPLE III
A computer readable storage medium having stored therein a plurality of instructions adapted to be loaded by a processor of a terminal device and to perform the steps of a method for electromagnetic environment hybrid automated testing provided by a first embodiment.
Example four
A terminal device comprising a processor and a computer readable storage medium, the processor being configured to implement instructions; the computer readable storage medium is used for storing a plurality of instructions which are suitable for being loaded by a processor and executing the steps of the electromagnetic environment hybrid automatic test method provided by the first embodiment.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Although the embodiments of the present invention have been described with reference to the accompanying drawings, it is not intended to limit the scope of the present invention, and it should be understood by those skilled in the art that various modifications and variations can be made without inventive efforts by those skilled in the art based on the technical solution of the present invention.

Claims (17)

1. An electromagnetic environment hybrid automatic test method is characterized in that: the method comprises the following steps:
acquiring a data file;
reading the function points according to the sequence and judging the execution state of the function points;
acquiring a test case and test data corresponding to the executed function point;
extracting keywords of the test case and the test data, determining the test case, and reading an operation execution object for testing;
realizing corresponding element positioning through image matching, and executing the test case at a corresponding position according to the test steps;
and recording the parameters related to the execution condition of the test case, and generating a test report.
2. The electromagnetic environment hybrid automatic test method of claim 1, characterized by: the specific process of extracting the keywords of the test case and the test data and determining the test case comprises the following steps: and encapsulating actions to be executed into corresponding keywords in advance, and corresponding the corresponding keywords to the testing step.
3. The electromagnetic environment hybrid automatic test method of claim 2, characterized by: when the actions to be executed are packaged into corresponding keywords in advance, the keywords corresponding to different actions to be executed are fixed, different testing steps are determined by combining different keywords, and different test cases are formed by combining different data.
4. The electromagnetic environment hybrid automatic test method of claim 1 or 3, characterized by: if the test case needs to be modified, the definition of the corresponding operation method is added in the pre-packaged key word, the method to be called when the key word is executed is added, and the corresponding step is added in the test step.
5. The electromagnetic environment hybrid automatic test method of claim 1, characterized by: the specific process of realizing the positioning of the corresponding elements through image matching comprises the following steps: and preprocessing the control screenshot and the current page screenshot, extracting features, and matching the two images to obtain the position coordinate value of the element on the page, so that the element is executed.
6. The electromagnetic environment hybrid automatic test method of claim 5, characterized by: the process of preprocessing the control screenshot and the current page screenshot comprises the following steps: the image is grayed, the RGB values of each pixel point of the image are unified into a value, and three channels are changed into a single channel.
7. The electromagnetic environment hybrid automatic test method of claim 5, characterized by: the process of extracting the features of the control screenshot and the current page screenshot comprises the following steps: and establishing a Gaussian scale space by using an SIFT algorithm, detecting local extreme points, calculating the direction of key points, and generating a feature vector to extract feature points to obtain feature point sets of the two images.
8. The electromagnetic environment hybrid automatic test method of claim 1 or 5, characterized by: the specific process of image matching comprises the following steps:
judging whether the positioning mode of the element is image matching or not, if so, acquiring a corresponding control screenshot from an image library, simultaneously performing screenshot operation on the current page and storing the screenshot, matching the two images to obtain the position coordinate of the control screenshot in the page, and storing the coordinate as a variable to be used; and realizing the execution of the corresponding operation at the coordinate of the page by matching the obtained coordinate information.
9. The electromagnetic environment hybrid automatic test method of claim 1, characterized by: the test case execution condition related parameters include but are not limited to: the name and the test execution state of the test case, the log record of the process when the test case fails to execute, the position and the reason of the problem, the time point when the test case starts to execute and the time required by the execution of the test case.
10. An electromagnetic environment hybrid automatic test system is characterized in that: the method comprises the following steps:
a receiving module configured to receive an input data file;
the reading module is configured to read the function points in sequence, judge the execution state of the function points and acquire the test cases and the test data corresponding to the executed function points;
the driving module is configured to extract keywords of a test case and test data, determine a test case step and read an operation execution object for testing;
the image matching module is configured to realize corresponding element positioning through image matching;
the execution module is configured to execute the test case according to the determined test steps at the corresponding positions;
the report generation module is configured to record the relevant parameters of the test case execution condition and generate a test report;
and the packaging module is configured to package the algorithm involved in the test execution process.
11. The electromagnetic environment hybrid automated test system of claim 10, wherein: the driving module comprises a data driving module, a keyword driving module and a WebUI driving module, wherein the data driving module is configured to separate test data and test scripts in a test case, the keyword driving module is configured to determine a corresponding test step according to preset definition and test data of keywords, and the WebUI driving module is configured to provide functions for positioning Web page elements and executing operations in the test step.
12. The electromagnetic environment hybrid automated test system of claim 10, wherein: the packaging module is configured to store data, read cell data, generate picture names, acquire the current time of the system and capture a screenshot of a page.
13. The electromagnetic environment hybrid automated test system of claim 10, wherein: the execution module is configured to call the keyword extraction result of the drive module and the related algorithm of the packaging module to realize the execution of the test case.
14. The electromagnetic environment hybrid automated test system of claim 10, wherein: the image matching module comprises a preprocessing module, a feature extraction module and a matching module, wherein the preprocessing module is configured to perform graying processing on the image, unify the RGB values of each pixel point of the image into one value, and change three channels into a single channel;
the feature extraction module is configured to establish a Gaussian scale space, detect local extreme points, calculate key point directions and generate feature vectors by using an SIFT algorithm so as to extract feature points and obtain feature point sets of two images;
and the matching module is configured to acquire the corresponding control screenshot from the image library, perform screenshot operation on the current page and store the screenshot, and match the two images to obtain the position coordinate of the control screenshot in the page.
15. The electromagnetic environment hybrid automated test system of claim 10, wherein: the report generation module is configured to screen different running states of the test cases according to the test results, and display the names of the test cases and the test execution states, process log records when the test cases are failed to execute, positions and reasons of problems, the time points when the test cases start to execute and the time required by the execution of the test cases.
16. A computer-readable storage medium characterized by: in which a plurality of instructions are stored, said instructions being adapted to be loaded by a processor of a terminal device and to carry out the steps of a method for electromagnetic environment hybrid automated testing according to any one of claims 1 to 9.
17. A terminal device is characterized in that: the system comprises a processor and a computer readable storage medium, wherein the processor is used for realizing instructions; a computer readable storage medium for storing a plurality of instructions adapted to be loaded by a processor and for performing the steps of a method for electromagnetic environment hybrid automated testing as claimed in any one of claims 1 to 9.
CN202110355451.7A 2021-04-01 2021-04-01 Electromagnetic environment hybrid automatic testing method and system, storage medium and terminal equipment Pending CN112988590A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110355451.7A CN112988590A (en) 2021-04-01 2021-04-01 Electromagnetic environment hybrid automatic testing method and system, storage medium and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110355451.7A CN112988590A (en) 2021-04-01 2021-04-01 Electromagnetic environment hybrid automatic testing method and system, storage medium and terminal equipment

Publications (1)

Publication Number Publication Date
CN112988590A true CN112988590A (en) 2021-06-18

Family

ID=76338895

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110355451.7A Pending CN112988590A (en) 2021-04-01 2021-04-01 Electromagnetic environment hybrid automatic testing method and system, storage medium and terminal equipment

Country Status (1)

Country Link
CN (1) CN112988590A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113326211A (en) * 2021-08-04 2021-08-31 卡斯柯信号(北京)有限公司 Test case generation method and device
CN114670200A (en) * 2022-03-30 2022-06-28 上海擎朗智能科技有限公司 Automatic testing method applied to robot, computer storage medium and robot

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150324274A1 (en) * 2014-05-09 2015-11-12 Wipro Limited System and method for creating universal test script for testing variants of software application
US9280452B1 (en) * 2013-06-26 2016-03-08 Amazon Technologies, Inc. Systems and methods for generating test cases
CN107562626A (en) * 2017-08-31 2018-01-09 国家电网公司 A kind of method that encapsulation Selenium and Sikuli realizes Web automatic tests
CN107783902A (en) * 2017-09-26 2018-03-09 甘肃万维信息技术有限责任公司 A kind of Selenium automated testing methods and system from coding
CN108459957A (en) * 2017-11-29 2018-08-28 平安科技(深圳)有限公司 Test method, device, equipment and the storage medium of fund system test case
CN109117358A (en) * 2017-06-23 2019-01-01 百度在线网络技术(北京)有限公司 test method and test device for electronic equipment
CN110941546A (en) * 2019-10-12 2020-03-31 平安健康保险股份有限公司 Automatic test method, device, equipment and storage medium for WEB page case
CN112052154A (en) * 2019-06-05 2020-12-08 北京奇虎科技有限公司 Test case processing method and device
CN112256532A (en) * 2020-11-10 2021-01-22 深圳壹账通创配科技有限公司 Test interface generation method and device, computer equipment and readable storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9280452B1 (en) * 2013-06-26 2016-03-08 Amazon Technologies, Inc. Systems and methods for generating test cases
US20150324274A1 (en) * 2014-05-09 2015-11-12 Wipro Limited System and method for creating universal test script for testing variants of software application
CN109117358A (en) * 2017-06-23 2019-01-01 百度在线网络技术(北京)有限公司 test method and test device for electronic equipment
CN107562626A (en) * 2017-08-31 2018-01-09 国家电网公司 A kind of method that encapsulation Selenium and Sikuli realizes Web automatic tests
CN107783902A (en) * 2017-09-26 2018-03-09 甘肃万维信息技术有限责任公司 A kind of Selenium automated testing methods and system from coding
CN108459957A (en) * 2017-11-29 2018-08-28 平安科技(深圳)有限公司 Test method, device, equipment and the storage medium of fund system test case
CN112052154A (en) * 2019-06-05 2020-12-08 北京奇虎科技有限公司 Test case processing method and device
CN110941546A (en) * 2019-10-12 2020-03-31 平安健康保险股份有限公司 Automatic test method, device, equipment and storage medium for WEB page case
CN112256532A (en) * 2020-11-10 2021-01-22 深圳壹账通创配科技有限公司 Test interface generation method and device, computer equipment and readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113326211A (en) * 2021-08-04 2021-08-31 卡斯柯信号(北京)有限公司 Test case generation method and device
CN113326211B (en) * 2021-08-04 2022-05-13 卡斯柯信号(北京)有限公司 Test case generation method and device
CN114670200A (en) * 2022-03-30 2022-06-28 上海擎朗智能科技有限公司 Automatic testing method applied to robot, computer storage medium and robot
CN114670200B (en) * 2022-03-30 2024-04-26 上海擎朗智能科技有限公司 Automatic test method applied to robot, computer storage medium and robot

Similar Documents

Publication Publication Date Title
CN107908541B (en) Interface testing method and device, computer equipment and storage medium
CN112988590A (en) Electromagnetic environment hybrid automatic testing method and system, storage medium and terminal equipment
US6986125B2 (en) Method and apparatus for testing and evaluating a software component using an abstraction matrix
WO2017162210A1 (en) Test configuration method and device
US20120167054A1 (en) Collecting Program Runtime Information
CN106529304B (en) A kind of Android applies concurrent leakage location
CN109857663B (en) Keyword driving and image similarity combined automatic test platform
CN107957956A (en) Test method, device and the readable storage medium storing program for executing of software differences coverage rate
CN110543422B (en) Software package code defect data processing method, system and medium for FPR
CN102707712B (en) Electronic equipment fault diagnosis method and system
CN114816980A (en) Automatic testing device and method for embedded communication system
CN105677569B (en) Android automated test tools and method of testing based on event handler
CN101620563A (en) Method and system for automatically testing input playback mode of terminal system
CN107480048A (en) Testing tool generation method, device, storage medium and computer equipment
CN114817028A (en) Multi-target cross debugging system based on software development platform
CN110147313B (en) Log output method and device
CN111221728B (en) Self-adaptive test script system and method for rail transit automatic control software
CN114490337A (en) Debugging method, debugging platform, equipment and storage medium
CN110795338B (en) Front-end and back-end interaction-based automatic testing method and device and electronic equipment
CN110716849B (en) Method and device for recording test cases of application programs
US20090007068A1 (en) Accessing Non-Public Code
CN112181816A (en) Interface testing method and device based on scene, computer equipment and medium
CN114003484A (en) Log output method, device and equipment for interface test and storage medium
CN112035370A (en) Automatic generation system and generation method for unit test code
CN107145422B (en) Software fault alarm monitoring method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination