CN116467161A - Application testing method and device, electronic equipment and storage medium - Google Patents

Application testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116467161A
CN116467161A CN202310133193.7A CN202310133193A CN116467161A CN 116467161 A CN116467161 A CN 116467161A CN 202310133193 A CN202310133193 A CN 202310133193A CN 116467161 A CN116467161 A CN 116467161A
Authority
CN
China
Prior art keywords
test case
test
environment
result
determining
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
CN202310133193.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.)
Haier Smart Home Co Ltd
Qingdao Economic and Technological Development Zone Haier Water Heater Co Ltd
Original Assignee
Haier Smart Home Co Ltd
Qingdao Economic and Technological Development Zone Haier Water Heater 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 Haier Smart Home Co Ltd, Qingdao Economic and Technological Development Zone Haier Water Heater Co Ltd filed Critical Haier Smart Home Co Ltd
Priority to CN202310133193.7A priority Critical patent/CN116467161A/en
Publication of CN116467161A publication Critical patent/CN116467161A/en
Pending legal-status Critical Current

Links

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/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The invention discloses an application testing method and device, electronic equipment and a storage medium. The method comprises the following steps: determining a configuration file corresponding to the application based on an automatic test framework, wherein the configuration file comprises at least one test case, and each test case comprises an element identifier; determining the environmental information of each test case according to the element identification of each test case; and testing each test case according to the environmental information of each test case, the positioning element of each test case and the expected result of each test case. According to the technical scheme, the environment information of the test case can be determined according to the element identification of the test case, the test case is tested in the environment corresponding to the test case according to the positioning element and the expected result of the test case, and the development language and the test environment corresponding to the development language can be determined based on the element identification, so that the application of mixed development of multiple languages can be tested.

Description

Application testing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of automation technologies, and in particular, to an application testing method, an application testing device, an electronic device, and a storage medium.
Background
With the development of science and technology, more and more applications are developed and popularized, and the testing efficiency and testing method of the applications are also one of the concerns.
At present, when testing an application, the programming language of the application needs to be determined first, then the testing method of the application is determined according to the programming language of the application, and the testing method aims at a single scene and can only test the application developed by using one programming language. However, more and more applications are developed from a mix of programming languages, and this approach does not allow for automated testing of complex applications.
Disclosure of Invention
The invention provides a testing method and device for an application, electronic equipment and a storage medium, and aims to test the application developed by mixing multiple languages.
According to an aspect of the present invention, there is provided a test method for an application, the method comprising:
determining a configuration file corresponding to the application based on an automatic test framework, wherein the configuration file comprises at least one test case, and each test case comprises an element identifier;
determining the environmental information of each test case according to the element identification of each test case;
and testing each test case according to the environmental information of each test case, the positioning element of each test case and the expected result of each test case.
Optionally, for any test case, determining the environmental information of the test case includes: determining an identification type corresponding to the element identification of the test case; and determining the environment information of the test case according to the identification type.
Optionally, determining the environmental information of the test case according to the identification type includes: when the identification type is a native identification, determining that the environment information of the test case is a native environment; when the identification type is not the native identification, determining that the environment information of the test case is a hypertext environment.
Optionally, after determining that the environment information of the test case is a native environment, the method further includes: the current test environment is adjusted to be a native environment.
Optionally, adjusting the current test environment to be a native environment includes: if the current test case is the first test case, the current test environment is adjusted to be a primary environment; if the current test case is not the first test case and the test environment corresponding to the last test case is not the original environment, the current test environment is adjusted to be the original environment; if the current test case is not the first test case and the test environment corresponding to the last test case is the original environment, the current test environment is not adjusted.
Optionally, for any test case, testing the test case according to the environmental information of the test case, the positioning element of the test case and the expected result of the test case, including: determining a positioning result of the test case according to the environment information and the positioning element; and generating a test result of the test case according to the positioning result and the expected result.
Optionally, generating the test result of the test case according to the positioning result and the expected result includes: determining whether the positioning result is consistent with the expected result; if the positioning result is consistent with the expected result, generating a first test result, wherein the first test result is used for indicating that the test case is successfully executed; if the positioning result is inconsistent with the expected result, a second test result is generated, the second test result is used for indicating the execution failure of the test case, and the second test result comprises abnormal positioning information and abnormal analysis information.
According to another aspect of the present invention, there is provided a test apparatus for an application, the apparatus comprising:
the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for determining a configuration file corresponding to an application based on an automatic test framework, the configuration file comprises at least one test case, and each test case comprises an element identifier;
the determining module is used for determining the environment information of each test case according to the element identification of each test case;
and the execution module is used for testing each test case according to the environment information of each test case, the positioning element of each test case and the expected result of each test case.
According to another aspect of the present invention, there is provided an electronic device including:
at least one processor; and a memory communicatively coupled to the at least one processor;
the memory stores a computer program executable by the at least one processor, so that the at least one processor can execute the test method of the application according to any embodiment of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a test method for an application according to any one of the embodiments of the present invention.
According to the technical scheme, the configuration file corresponding to the application is determined based on the automatic test framework, the configuration file comprises at least one test case, and each test case comprises an element identifier; determining the environmental information of each test case according to the element identification of each test case; and testing each test case according to the environmental information of each test case, the positioning element of each test case and the expected result of each test case. The environment information of the test case can be determined according to the element identification of the test case, the test case is tested in the environment corresponding to the test case according to the positioning element and the expected result of the test case, and the development language and the test environment corresponding to the development language can be determined based on the element identification, so that the application of the mixed development of multiple languages can be tested. The method solves the problems that the testing method aims at single scene, can only test the application developed by using one programming language, and cannot automatically test the complex application.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a testing method of an application according to a first embodiment;
FIG. 2 is a flow chart of a testing method of an application according to a second embodiment;
FIG. 3 is a schematic structural diagram of a test device for an application according to a third embodiment;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment.
Detailed Description
In order that the manner in which the invention may be better understood, a more particular description of the invention will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flow chart of a testing method for an application provided in an embodiment, which is applicable to testing applications developed in a mixed language, and the method may be performed by a testing device for an application provided in the present invention, where the device may be implemented in hardware and/or software, and in a specific embodiment, the device may be integrated in an electronic device. The following embodiment will be described taking the example of the integration of the apparatus in an electronic device, and referring to fig. 1, the method specifically includes the following steps:
s101, determining a configuration file corresponding to an application based on an automatic test framework, wherein the configuration file comprises at least one test case, and each test case comprises an element identifier.
Applications can implement a variety of functions, such as searching, viewing details, and the like. The application may be tested by verifying its search, view details, etc.
The configuration file may be understood as a test file of an application, and includes various functions that the application needs to test, where each function that needs to test is a test case, and the test case includes a specific test method and an expected test result of each function. The expected test result can be understood as a basis for determining whether the test case is successfully executed, specifically, when the test result of the test case is the same as the expected result, the test case is determined to be successfully executed, and when the test result of the test case is not the same as the expected result, the test case execution failure is determined.
An automation test framework may be understood as a tool (an automation test framework) Selenium WebDriver that allows a user to perform tests for various different browsers, for example, world Wide Web (Web).
Further, the application may be developed by a hybrid of Java, kotlin, dart, H (a language description mode for constructing Web content) and other different programming languages, so that the programming languages corresponding to the test cases in the configuration file of the application may be different, the programming languages have corresponding identifier elements, and the element identifier may be understood as attribute information of the identifier elements of the programming languages, and may be used to identify and distinguish the programming languages corresponding to the test cases.
It should be noted that the programming language in one test case is singular, i.e., the same test case does not contain multiple programming languages.
The test file may be an excel table, after the test file is determined, a test driver may be started through Selenium WebDriver, a test case in the excel table is read, and an element identifier contained in the test case is determined.
The advantage of this arrangement is that the programming language of each test case can be precisely determined.
S102, determining the environment information of each test case according to the element identification of each test case.
The element identifier may be understood as attribute information of an identifying element of a programming language, and can determine the programming language of the test case under test, so as to determine the test environment of the test case. Specifically, the application of the hybrid development has nesting of a native container and an H5 container, the test case comprises the native container or the H5 container, the test case comprising the native container has a native element, the environment information of the test case is a native environment, the test case comprising the H5 container has an H5 element, the environment information of the test case is an H5 environment, different types of elements have different element identifications, and the test environment of the test case can be determined according to the element identifications contained in the test case.
For example, when the test case contains the element identifier of the native element, determining that the environment information of the test case is the native environment, otherwise, determining that the environment information of the test case is the H5 environment.
The method has the advantage that the test environment corresponding to each test case can be accurately determined.
S103, testing each test case according to the environment information of each test case, the positioning element of each test case and the expected result of each test case.
The positioning element of the test case can be understood as a parameter for determining the test result, and the test result of the test case can be locked according to the positioning element of the test case. The expected test result can be understood as a basis for whether the test case is successfully executed or not, when the test result of the test case is the same as the expected result, the test case is determined to be successfully executed, and when the test result of the test case is different from the expected result, the test case is determined to be failed to be executed.
Specifically, the positioning elements of the test case include a unique code (Identity document, ID), a class name (class attribute in an html tag), a text (memory area storing program execution code), and the like, in a test environment corresponding to the test case, the positioning elements such as ID, className, text of the test case are determined by WebDriver, so that a test result of the test case can be determined, and the test result and an expected result can be compared to detect the test case.
For example, if the test case is information of the key 1 in the interface a in the reading application, the expected result is that the key 1 is a confirmation key, if the test result of the test case determined according to the positioning elements such as ID, className, text of the test case is that the key 1 is a confirmation key, the test case is considered to be successfully executed, otherwise, the test case is considered to be failed to be executed.
The benefit of this arrangement is that the hybrid developed application can be tested.
According to the technical scheme, the configuration file corresponding to the application is determined based on the automatic test framework, the configuration file comprises at least one test case, and each test case comprises an element identifier; determining the environmental information of each test case according to the element identification of each test case; and testing each test case according to the environmental information of each test case, the positioning element of each test case and the expected result of each test case. The environment information of the test case can be determined according to the element identification of the test case, the test case is tested in the environment corresponding to the test case according to the positioning element and the expected result of the test case, and the development language and the test environment corresponding to the development language can be determined based on the element identification, so that the application of the mixed development of multiple languages can be tested. The method solves the problems that the testing method aims at single scene, can only test the application developed by using one programming language, and cannot automatically test the complex application.
Example two
Fig. 2 is a flow chart of a testing method for an application provided in the second embodiment, where the present embodiment is applicable to testing an application developed in a mixed language, and the method may be performed by a testing device for an application provided in the present invention, where the device may be implemented in a form of hardware and/or software, and in a specific embodiment, the device may be integrated into an electronic device. The following embodiment will be described taking the example of the integration of the device in an electronic apparatus, and referring to fig. 2, the method specifically includes the following steps:
s201, determining the test cases to be detected based on the serial numbers of the test cases in the configuration file.
Specifically, the configuration file includes a plurality of test cases, the test cases need to be tested one by one, the test cases to be detected can be understood as test cases to be tested, the serial numbers of the test cases can be understood as serial numbers of the test cases, and the serial numbers are used for representing the sequence of the test cases.
Specifically, test cases can be tested sequentially from small to large in sequence. The method includes the steps that an automatic test framework can determine a configuration file corresponding to an application, the configuration file comprises a plurality of test cases, the serial numbers of the test cases are different, if the test cases in the configuration file are not tested, the test case with the smallest serial number is determined to be the test case to be detected, if the configuration file comprises the test case which is tested and also comprises the test case which is not tested, the test case with the smallest serial number in the test case which is not tested is determined to be the test case to be detected.
The advantage of this arrangement is that the test cases to be tested can be determined quickly, and the test time of the application is saved.
S202, according to element identification of the test case to be detected, environment information of the test case to be detected is determined.
The element identifier may be understood as attribute information of an identifier element included in the test case, and may be used to determine a programming language of the test case, so as to determine a test environment of the test case.
Specifically, the elements comprise a native element and an H5 element, different types of elements have different element identifications, and the test environment of the test case can be determined according to the element identifications contained in the test case. For example, when the test case contains the element identifier of the native element, the environment information of the test case is determined to be the native environment, and when the test case does not contain the element identifier of the native element, the environment information of the test case is determined to be the H5 environment.
Elements in the test case can be divided into two main types, namely a native element and a non-native element, and identifiers of the elements can be divided into a native type identifier and a non-native type identifier. Specifically, according to the element identifier of the test case to be detected, determining the environmental information of the test case to be detected may include: determining an identification type corresponding to the element identification of the test case to be detected; and determining the environmental information of the test case to be detected according to the identification type.
For example, when the test case contains the protoclass identifier, the environment information of the test case is determined to be a proto-environment, and when the test case does not contain the proto-class identifier, the environment information of the test case is determined to be a non-proto-environment.
Wherein the non-native environment is essentially an H5 environment (hypertext environment). Determining the environmental information of the test case to be detected according to the identification type can be understood as specifically determining the environmental information of the test case to be detected as a primary environment when the identification type included in the test case to be detected is a primary identification; when the identification type contained in the test case to be detected is not the original identification, determining that the environment information of the test case to be detected is a hypertext environment.
S203, determining whether the test environment of the test case to be detected is a native environment.
Specifically, when the test environment of the test case to be detected is a native environment, step S204 is executed, and when the test environment of the test case to be detected is not a native environment, it is determined whether the current test environment can be adjusted to a hypertext environment.
In one particular example, determining whether the current test environment can be tuned to a hypertext environment includes: and reading a context list (a context list) of the WebDriver, checking whether the context list of the WebDriver has a context list with the beginning of WEBVIEW, switching the context list with the beginning of WEBVIEW when the context list of the WebDriver has the context list with the beginning of WEBVIEW, executing step S205, and if the context list of the WebDriver does not have the context list with the beginning of WEBVIEW, judging that the test case fails to execute.
Specifically, the context list with the beginning of the webiew_may be understood as a hypertext environment, and switching the context list with the beginning of the webiew_may be understood as adjusting the current test environment to the hypertext environment, and if the test environment of the test case to be detected is not a native environment and the context list with the beginning of the webiew_is not available in the context list of the WebDriver, it is considered that the hypertext environment cannot be switched, and the test case cannot be tested.
S204, adjusting the current test environment to be a native environment.
Adjusting the current test environment to be a native environment may be understood as switching the current test environment to be a native environment in order to test the test cases to be detected. Illustratively, the NATIVE environment may be a context of NATIVE_APP.
Before the current test environment is adjusted, whether the current test environment needs to be adjusted is judged, if the current test environment needs to be adjusted, the current test environment is adjusted, and if the current test environment does not need to be adjusted, the adjustment of the test environment is not performed. The advantage of setting up like this is that can save the test resource, promotes test efficiency.
The method for adjusting the current testing environment to be the original environment specifically comprises the following steps: determining whether the test case to be detected is the first test case; when the test case to be detected is the first test case, the current test environment is adjusted to be a primary environment; when the test case to be detected is not the first test case, determining whether the test environment corresponding to the last test case is a native environment, if the test environment corresponding to the last test case is not the native environment, adjusting the current test environment to be the native environment, and if the test environment corresponding to the last test case is the native environment, considering the current test environment to be the native environment, and not needing to be adjusted.
S205, determining a positioning result of the test case to be detected according to the environment information and the positioning element.
Wherein, the positioning element of the test case can be understood as a parameter for determining the test result, including ID, className, text; the positioning result of the test case to be detected can be understood as the test result of the test case locked according to the positioning element of the test case.
S206, generating a test result of the test case to be detected according to the positioning result and the expected result of the test case to be detected.
The expected test result can be understood as a basis for determining whether the test case is successfully executed or not, when the test result of the test case is the same as the expected result, the test case is determined to be successfully executed, and when the test result of the test case is different from the expected result, the test case is determined to be failed to be executed.
Specifically, generating a test result of the test case to be detected according to the positioning result and an expected result of the test case to be detected includes: determining whether the positioning result is consistent with the expected result; if the positioning result is consistent with the expected result, a first test result is generated, and the first test result is used for indicating that the test case to be detected is successfully executed; if the positioning result is inconsistent with the expected result, a second test result is generated, the second test result is used for indicating that the test case to be detected fails to be executed, and the second test result comprises abnormal positioning information and abnormal analysis information.
The first test result can be understood as a successful identifier of the test case, and is used for indicating that the test case passes the test; the second test result can be understood as failure information of the test case, including an identifier that the test case fails to pass the test, a position where the test case fails to execute, a reason why the test case fails to execute, etc., so that the set benefit is that the test staff can conveniently know the failure position and failure reason of the test case, and timely adjust writing logic and configuration parameters of the application.
S207, determining whether the test case to be detected is a last-bit test case.
The last test case can be understood as the last test case in the configuration file, and is the measurement basis for ending the test. Specifically, when the test case to be detected is the last test case, the test cases in the configuration file are considered to have all completed the test, and step S208 is executed; when the test case to be detected is not the last test case, the test case which is not detected is considered to exist in the configuration file, and the step S201 is executed in a return mode, and the test case in the configuration file is tested continuously.
S208, generating a detection report corresponding to the application.
The detection report can be understood as a text containing all test information of the application, including implementation conditions and detailed information of each function in the application.
Specifically, the detection report includes feedback information corresponding to each function to be tested. For example, if the execution of the a function is successful, the feedback information corresponding to the a function includes an execution success identifier, and if the execution of the a function is failed, the feedback information corresponding to the a function includes a position and an anomaly analysis of the execution failure.
The advantage of this arrangement is that the test personnel can quickly know the detection result of the application, so as to timely process the abnormality of the application.
According to the technical scheme, the test cases to be detected are determined based on the serial numbers of the test cases in the configuration file; determining environmental information of the test case to be detected according to the element identification of the test case to be detected; determining whether the test environment of the test case to be detected is a primary environment, and if the test environment to be detected is the primary environment, adjusting the current test environment to be the primary environment; determining a positioning result of the test case to be detected according to the environmental information and the positioning element; generating a test result of the test case to be detected according to the positioning result and the expected result of the test case to be detected; whether the test case to be detected is a last-bit test case or not is determined, if the test case to be detected is not the last-bit test case, the next test case to be detected is continuously tested, and if the test case to be detected is the last-bit test case, a detection report corresponding to the application is generated. The environment information of the test case can be determined according to the element identification of the test case, the test case is tested in the environment corresponding to the test case according to the positioning element and the expected result of the test case, and the development language and the test environment corresponding to the development language can be determined based on the element identification, so that the application of the mixed development of multiple languages can be tested. The method solves the problems that the testing method aims at single scene, can only test the application developed by using one programming language, and cannot automatically test the complex application. After the test case test of the application is completed, the embodiment generates a test report so that a tester can know the running condition of the application.
Example III
Fig. 3 is a schematic structural diagram of a testing device for an application according to a third embodiment. As shown in fig. 3, the apparatus includes: an acquisition module 301, a determination module 302 and an execution module 303.
The acquiring module 301 is configured to determine a configuration file corresponding to an application based on an automated test framework, where the configuration file includes at least one test case, and each test case includes an element identifier;
the determining module 302 is configured to determine environmental information of each test case according to the element identifier of each test case;
and the execution module 303 is configured to test each test case according to the environmental information of each test case, the positioning element of each test case, and the expected result of each test case.
Optionally, for any test case, the determining module 302 is specifically configured to determine an identifier type corresponding to an element identifier of the test case; and determining the environment information of the test case according to the identification type.
Optionally, the determining module 302 is specifically configured to determine that the environment information of the test case is a native environment when the identifier type is a native identifier; when the identification type is not the native identification, determining that the environment information of the test case is a hypertext environment.
Optionally, the apparatus further includes an environment adjustment module, configured to adjust the current test environment to be a native environment after determining that the environment information of the test case is the native environment.
Optionally, the environment adjustment module is specifically configured to adjust the current test environment to be a native environment if the current test case is a first test case; if the current test case is not the first test case and the test environment corresponding to the last test case is not the original environment, the current test environment is adjusted to be the original environment; if the current test case is not the first test case and the test environment corresponding to the last test case is the original environment, the current test environment is not adjusted.
Optionally, for any test case, the execution module 303 is specifically configured to determine a positioning result of the test case according to the environmental information and the positioning element; and generating a test result of the test case according to the positioning result and the expected result.
Optionally, the execution module 303 is specifically configured to determine whether the positioning result and the expected result are consistent; if the positioning result is consistent with the expected result, generating a first test result, wherein the first test result is used for indicating that the test case is successfully executed; if the positioning result is inconsistent with the expected result, a second test result is generated, the second test result is used for indicating the execution failure of the test case, and the second test result comprises abnormal positioning information and abnormal analysis information.
The application testing device provided by the embodiment can execute the application testing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the test method of the application.
In some embodiments, the applied test method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the test method of the application described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the test method of the application in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above can be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server) or that includes a middleware component (e.g., an application server) or that includes a front-end component through which a user can interact with an implementation of the systems and techniques described here, or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. An application testing method, comprising:
determining a configuration file corresponding to an application based on an automatic test framework, wherein the configuration file comprises at least one test case, and each test case comprises an element identifier;
determining the environment information of each test case according to the element identification of each test case;
and testing each test case according to the environment information of each test case, the positioning element of each test case and the expected result of each test case.
2. The method of claim 1, wherein for any one of the test cases, the determining the environmental information of the test case comprises:
determining an identification type corresponding to the element identification of the test case;
and determining the environment information of the test case according to the identification type.
3. The method of claim 2, wherein the determining environmental information of the test case according to the identification type comprises:
when the identification type is a native identification, determining that the environment information of the test case is a native environment;
and when the identification type is not the native identification, determining that the environment information of the test case is a hypertext environment.
4. The method of claim 3, further comprising, after determining that the environmental information of the test case is a native environment:
and adjusting the current testing environment to be the original environment.
5. The method of claim 4, wherein said adjusting the current test environment to be the native environment comprises:
if the current test case is the first test case, the current test environment is adjusted to be the original environment;
if the current test case is not the first test case and the test environment corresponding to the last test case is not the original environment, adjusting the current test environment to be the original environment;
if the current test case is not the first test case and the test environment corresponding to the last test case is the original environment, the current test environment is not adjusted.
6. The method of claim 1, wherein for any one of the test cases, testing the test case based on the environmental information of the test case, the locating element of the test case, and the expected result of the test case, comprises:
determining a positioning result of the test case according to the environment information and the positioning element;
and generating a test result of the test case according to the positioning result and the expected result.
7. The method of claim 6, wherein generating the test result of the test case based on the positioning result and the expected result comprises:
determining whether the positioning result and the expected result are consistent;
if the positioning result is consistent with the expected result, generating a first test result, wherein the first test result is used for indicating that the test case is successfully executed;
and if the positioning result is inconsistent with the expected result, generating a second test result, wherein the second test result is used for indicating the execution failure of the test case, and comprises abnormal positioning information and abnormal analysis information.
8. An apparatus for testing an application, comprising:
the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for determining a configuration file corresponding to an application based on an automatic test framework, the configuration file comprises at least one test case, and each test case comprises an element identifier;
the determining module is used for determining the environment information of each test case according to the element identification of each test case;
and the execution module is used for testing each test case according to the environment information of each test case, the positioning element of each test case and the expected result of each test case.
9. An electronic device, the electronic device comprising:
at least one processor; and a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the test method of the application of any one of claims 1 to 7.
10. A computer readable storage medium storing computer instructions for causing a processor to execute the test method of the application of any one of claims 1 to 7.
CN202310133193.7A 2023-02-17 2023-02-17 Application testing method and device, electronic equipment and storage medium Pending CN116467161A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310133193.7A CN116467161A (en) 2023-02-17 2023-02-17 Application testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310133193.7A CN116467161A (en) 2023-02-17 2023-02-17 Application testing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116467161A true CN116467161A (en) 2023-07-21

Family

ID=87172391

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310133193.7A Pending CN116467161A (en) 2023-02-17 2023-02-17 Application testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116467161A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117806981A (en) * 2024-03-01 2024-04-02 中国空气动力研究与发展中心计算空气动力研究所 CFD software automatic testing method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117806981A (en) * 2024-03-01 2024-04-02 中国空气动力研究与发展中心计算空气动力研究所 CFD software automatic testing method and system
CN117806981B (en) * 2024-03-01 2024-05-07 中国空气动力研究与发展中心计算空气动力研究所 CFD software automatic testing method and system

Similar Documents

Publication Publication Date Title
CN115598505A (en) Chip detection method, device, equipment and storage medium
CN116467161A (en) Application testing method and device, electronic equipment and storage medium
CN115016321A (en) Hardware-in-loop automatic testing method, device and system
CN116089197A (en) Fault equipment switching exercise method, device, equipment and storage medium
CN115048352A (en) Log field extraction method, device, equipment and storage medium
CN114444087A (en) Unauthorized vulnerability detection method and device, electronic equipment and storage medium
CN114443493A (en) Test case generation method and device, electronic equipment and storage medium
CN116401113B (en) Environment verification method, device and medium for heterogeneous many-core architecture acceleration card
CN117492822B (en) Change contrast method, device, electronic equipment and storage medium
CN117573561B (en) Automatic test system, method, electronic equipment and storage medium
CN113836291B (en) Data processing method, device, equipment and storage medium
CN117271373B (en) Automatic construction method and device for test cases, electronic equipment and storage medium
CN115238212A (en) Page designated element detection and replacement method, device, equipment and storage medium
CN117648252A (en) Function test method and device for software application, electronic equipment and storage medium
CN117493203A (en) Method, device, equipment and storage medium for testing server software
CN117472751A (en) Vehicle system function analysis method, device, equipment and medium
CN117827637A (en) Automatic test method and device and electronic equipment
CN116303019A (en) Test tracing method, device, equipment and medium
CN116303071A (en) Interface testing method and device, electronic equipment and storage medium
CN115543712A (en) Automatic detection method and device for equipment configuration information, electronic equipment and medium
CN116955189A (en) Automatic testing method, device and equipment for user interface and storage medium
CN117609087A (en) Code processing method, device, equipment and medium
CN117632670A (en) Fault warning method and device for test environment, electronic equipment and storage medium
CN117609064A (en) Unit test method and device, electronic equipment and storage medium
CN116225390A (en) Warehouse-in method, device, equipment and medium for software development files

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