CN118377722A - Page test method, device, equipment, medium and program product - Google Patents

Page test method, device, equipment, medium and program product Download PDF

Info

Publication number
CN118377722A
CN118377722A CN202410784493.6A CN202410784493A CN118377722A CN 118377722 A CN118377722 A CN 118377722A CN 202410784493 A CN202410784493 A CN 202410784493A CN 118377722 A CN118377722 A CN 118377722A
Authority
CN
China
Prior art keywords
target
page
test data
test
tested
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
CN202410784493.6A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202410784493.6A priority Critical patent/CN118377722A/en
Publication of CN118377722A publication Critical patent/CN118377722A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The present disclosure provides a page testing method, apparatus, device, medium, and program product, which may be applied to the testing technical field, the financial technology technical field, or other related technical fields. The method comprises the following steps: responding to a received selection operation of a target object for a target page control in a page to be tested, and acquiring information of the target page control; according to the identification information of the target page control, a test script template and a target test data table corresponding to the identification information of the target page control are obtained from a database; generating a target test script according to the position information of the target page control and the test script template; inputting target test data corresponding to the target page control into a text box corresponding to the target page control by calling the target test script, and obtaining an output result; and comparing the output result with an expected test result corresponding to the target test data to obtain a target test result corresponding to the page to be tested.

Description

Page test method, device, equipment, medium and program product
Technical Field
The present disclosure relates to the field of testing technology, financial technology, or other related technology, and more particularly to a page testing method, apparatus, device, medium, and program product.
Background
As the number of financial transactions grows, versions adapting to financial transactions iterate more and more frequently. In order to ensure proper use of each system and function, test verification of the system and function related to the financial service is a necessary procedure before the financial service is put into service. However, in the case of performing test verification on a system and a function using the related art, since the related art needs to consume a large amount of system resources, it is necessary to perform a test with a high-performance system.
In carrying out the above inventive concept, the inventors found that: in the related art, the existing test tool occupies large storage space of a system, so that the system resources consumed by the test are more, the professional requirement on programming of a tester is high, the test cost of the tester and the debugging cost of test failure are increased, and the technical problem of low test efficiency exists.
Disclosure of Invention
In view of the foregoing, the present disclosure provides page testing methods, apparatus, devices, media, and program products.
According to a first aspect of the present disclosure, there is provided a page testing method, which is characterized in that the method includes: responding to a received selection operation of a target object for a target page control in a page to be tested, and acquiring information of the target page control, wherein the information of the target page control comprises position information of the target page control and identification information of the target page control; according to the identification information of the target page control, a test script template and target test data corresponding to the identification information of the target page control are obtained from a database; generating a target test script according to the position information of the target page control and the test script template; inputting target test data corresponding to the target page control into a text box corresponding to the target page control by calling the target test script, and obtaining an output result; and comparing the output result with an expected test result corresponding to the target test data to obtain a target test result corresponding to the page to be tested.
According to an embodiment of the present disclosure, by calling a target test script, target test data corresponding to a target page control is input into a text box corresponding to the target page control, and an output result is obtained, including: invoking a target test script, and determining target test data corresponding to a target page control; changing a text box corresponding to the target page control into an editing state; and inputting the target test data into a text box corresponding to the target page control to obtain an output result.
According to an embodiment of the present disclosure, comparing an output result with an expected test result corresponding to target test data to obtain a target test result corresponding to a page to be tested, includes: comparing the output result with an expected test result corresponding to the target test data to obtain a first comparison result; marking the target test data to obtain abnormal test data under the condition that the first comparison result is characterized in that the output result is inconsistent with the expected test result corresponding to the target test data; based on the abnormal test data, determining an abnormal page control corresponding to the abnormal test data, and determining an abnormal code field corresponding to the abnormal page control in the target test script; adjusting the abnormal code field in the target test script to obtain a debugging test script; and testing the page to be tested according to the debugging test script and the target test data to obtain a target test result corresponding to the page to be tested.
According to an embodiment of the present disclosure, when the first comparison result is characterized in that the output result is inconsistent with an expected test result corresponding to the target test data, labeling the target test data in the test data table to obtain abnormal test data includes: acquiring historical test data from a database according to identification information of a page to be tested and a target page control; comparing the historical test data with the target test data to obtain a second comparison result; and marking the target test data according to the second comparison result to obtain abnormal test data.
In accordance with an embodiment of the present disclosure, with multiple target page controls; according to the identification information of the target page control, acquiring a test script template and target test data corresponding to the identification information of the target page control from a database, wherein the method comprises the following steps: acquiring a plurality of test data corresponding to the identification information of the plurality of target page controls from a database according to the identification information of the plurality of target page controls; based on test logic corresponding to the target page controls, sorting the test data to obtain sorted test data; and generating target test data according to the ordered plurality of test data and the expected test result.
According to an embodiment of the present disclosure, in the case of having a plurality of pages to be tested, further comprising: processing target test data according to a target test result corresponding to the first page to be tested to obtain target test data comprising the target test result corresponding to the first page to be tested, wherein the target test data comprises a plurality of test data corresponding to a plurality of pages to be tested; under the condition that the first test data comprise a target test result corresponding to the first page to be tested, calling a target test script, and testing the next page to be tested according to the next test data corresponding to the next page to be tested to obtain a target test result corresponding to the next page to be tested; processing the target test data according to the target test result corresponding to the next page to be tested to obtain target test data comprising the target test result corresponding to the next page to be tested; and under the condition that the target test data comprises target test results corresponding to each page to be tested, sending the target test data comprising the target test results corresponding to each page to be tested to a target object.
According to an embodiment of the present disclosure, obtaining information of a target page control in response to a received selection operation performed by a target object for the target page control in a page to be tested, includes: acquiring position area information of all page controls in a page to be tested; responding to the received selected operation of the target object to the page control in the page to be tested, and acquiring position information corresponding to the selected operation; determining a target page control according to the position information corresponding to the selected operation and the position area information of all page controls; and acquiring information of the target page control according to the target page control.
The second aspect of the present disclosure provides a page testing device, which is characterized by a first obtaining module, configured to obtain information of a target page control in response to a received selection operation performed by a target object for the target page control in a page to be tested, where the information of the target page control includes location information of the target page control and identification information of the target page control; the second acquisition module is used for acquiring a test script template and a target test data table corresponding to the identification information of the target page control from the database according to the identification information of the target page control; the generating module is used for generating a target test script according to the position information of the target page control and the test script template; the input module is used for inputting target test data corresponding to the target page control into a text box corresponding to the target page control by calling the target test script to obtain an output result; the obtaining module is used for comparing the output result with an expected test result corresponding to the target test data to obtain a target test result corresponding to the page to be tested.
A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method.
A fourth aspect of the present disclosure also provides a computer readable storage medium having stored thereon a computer program or instructions which, when executed by a processor, implement the steps of the above method.
A fifth aspect of the present disclosure also provides a computer program product comprising a computer program or instructions which, when executed by a processor, performs the steps of the method described above.
According to the embodiment of the disclosure, as the received selection operation of the target object on the target page control in the page to be tested is responded, the position information and the identification information of the target page control are obtained, then the test script template and the target test data corresponding to the target page control are obtained from the database according to the identification information of the target page control, then the target test script is generated according to the position information of the target page control and the test script template, the page to be tested is tested by utilizing the target test script, the obtained target test data are input into the text box corresponding to the target page control, the output result is obtained, and then the output result is compared with the expected test result, so that the target test result is obtained. The method and the device realize rapid automatic test of the page to be tested, so that the test result corresponding to the page to be tested is obtained, the page to be tested is conveniently adjusted according to the test result, the test cost is reduced, and the test efficiency is improved. Moreover, the target test script used for testing the page to be tested occupies small storage space, so that the consumption of system resources can be reduced and the running performance can be improved under the condition of testing.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be more apparent from the following description of embodiments of the disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an application scenario diagram of a page testing method according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a page testing method according to an embodiment of the disclosure;
FIG. 3 schematically illustrates a flow chart for obtaining a target test result corresponding to a page to be tested in accordance with the present disclosure;
FIG. 4 schematically illustrates a flow chart for testing a plurality of pages to be tested in accordance with the present disclosure;
FIG. 5 schematically illustrates a schematic diagram of login data according to an embodiment of the present disclosure;
FIG. 6 schematically illustrates a schematic diagram of scene data according to an embodiment of the disclosure;
FIG. 7 schematically illustrates a block diagram of a page testing apparatus according to an embodiment of the present disclosure; and
Fig. 8 schematically illustrates a block diagram of an electronic device adapted to implement a page testing method according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a convention should be interpreted in accordance with the meaning of one of skill in the art having generally understood the convention (e.g., "a system having at least one of A, B and C" would include, but not be limited to, systems having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In the technical solution of the present disclosure, the related user information (including, but not limited to, user personal information, user image information, user equipment information, such as location information, etc.) and data (including, but not limited to, data for analysis, stored data, displayed data, etc.) are information and data authorized by the user or sufficiently authorized by each party, and the related data is collected, stored, used, processed, transmitted, provided, disclosed, applied, etc. in compliance with relevant laws and regulations and standards, necessary security measures are taken, no prejudice to the public order colloquia is provided, and corresponding operation entries are provided for the user to select authorization or rejection.
In the scenario of using personal information to make an automated decision, the method, the device and the system provided by the embodiment of the disclosure provide corresponding operation inlets for users, so that the users can choose to agree or reject the automated decision result; if the user selects refusal, the expert decision flow is entered. The expression "automated decision" here refers to an activity of automatically analyzing, assessing the behavioral habits, hobbies or economic, health, credit status of an individual, etc. by means of a computer program, and making a decision. The expression "expert decision" here refers to an activity of making a decision by a person who is specializing in a certain field of work, has specialized experience, knowledge and skills and reaches a certain level of expertise.
It should be noted that, attribute information of the target object in the embodiment of the present disclosure is information and data authorized by the user or fully authorized by each party, and processes such as collection, storage, use, processing, transmission, provision, disclosure and application of related data all comply with related laws and regulations and standards of related countries and regions, and necessary security measures are adopted without violating the public order colloquial.
With the increase of the business volume of the financial business, the iteration times of the system version for collocating the financial business are more and more frequent, and repeated test verification is required before each new system version is put into use, so as to ensure the normal operation of the system version on line and the normal use of business functions.
However, testing of system versions related to financial services is a repetitive task, and a tester needs to perform repeated test verification on the same system version multiple times to ensure normal operation of the system version. Therefore, an automated test tool that is capable of automatically and conveniently testing pages and functions in pages is a current need for testers. In the process of research page test of research staff, the research staff find that the prior test tool occupies large storage space of a system in the related technology, so that the system resources consumed by the test are more, the professional requirement on programming of the test staff is high, and the technical problems of test cost of the test staff, debugging cost of test failure and low test efficiency are increased.
In view of this, an embodiment of the present disclosure provides a page testing method, including: responding to a received selection operation of a target object for a target page control in a page to be tested, and acquiring information of the target page control, wherein the information of the target page control comprises position information of the target page control and identification information of the target page control; according to the identification information of the target page control, a test script template and a target test data table corresponding to the identification information of the target page control are obtained from a database; generating a target test script according to the position information of the target page control and the test script template; inputting target test data corresponding to the target page control into a text box corresponding to the target page control by calling the target test script, and obtaining an output result; and comparing the output result with an expected test result corresponding to the target test data to obtain a target test result corresponding to the page to be tested.
Fig. 1 schematically illustrates an application scenario diagram of a page test method according to an embodiment of the present disclosure.
As shown in fig. 1, an application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is a medium used to provide a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the first terminal device 101, the second terminal device 102, the third terminal device 103, to receive or send messages etc. Various communication client applications, such as a shopping class application, a web browser application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only) may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103.
The first terminal device 101, the second terminal device 102, the third terminal device 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (by way of example only) providing support for websites browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the page testing method provided by the embodiments of the present disclosure may be generally performed by the server 105. Accordingly, the page testing apparatus provided by the embodiments of the present disclosure may be generally disposed in the server 105. The page testing method provided by the embodiments of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the page testing apparatus provided by the embodiments of the present disclosure may also be provided in a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The page test method of the disclosed embodiment will be described in detail with reference to fig. 2 to 6 based on the scenario described in fig. 1.
Fig. 2 schematically illustrates a flow chart of a page testing method according to an embodiment of the disclosure.
As shown in FIG. 2, the page testing method of the embodiment includes operations S210-S250.
In operation S210, in response to a selection operation performed by the received target object for the target page control in the page to be tested, information of the target page control is acquired.
According to an embodiment of the disclosure, the information of the target page control includes position information of the target page control and identification information of the target page control.
According to embodiments of the present disclosure, a target object may be characterized as a tester, and it is necessary to configure environmental elements of an automated test tool before the target object performs a selection operation for a target page control in a page to be tested.
For example, the automated test tool may write test scripts using a programming language, may operate with a browser and a spreadsheet during testing, in the case of writing test scripts, may reference corresponding components according to requirements of the automated test tool and the programming language, reference components that are set up so that the written test scripts may operate automatically on the browser, and file format types of the spreadsheet may be set by those skilled in the art according to requirements of the automated test tool and the writing language.
According to the embodiment of the disclosure, under the condition that the environment elements of the automatic testing tool are configured, the target object selects a target page control from pages to be tested, and obtains the position information and the identification information of the target page control, wherein the position information of the target page control can be characterized as the position coordinates of the target page control.
For example, the target object selects a page control for inputting a password from the loan pages to be tested, and obtains that the position area information of the page control for inputting the password is (6, 4) (6, 8) (8, 4) (8, 8), and the identification information of the page control for inputting the password is the input password.
According to the implementation of the method, the target test script for testing can be constructed by using the automatic test tool to test the page to be tested, the automatic test tool occupies small storage space, so that under the condition of testing, the consumption of system resources can be reduced, the running performance is improved, and the programming specialty of the automatic test tool on the target object is low, so that the learning cost of the target object is reduced.
In operation S220, according to the identification information of the target page control, a test script template and target test data corresponding to the identification information of the target page control are obtained from the database.
According to the embodiment of the disclosure, a plurality of test scripts corresponding to the identification information of different target page controls can be stored in the database, and under the condition that test script writing is required to be performed in a page to be tested, test script writing can be performed directly according to a test script template corresponding to the identification information of the target page controls and also by a target object according to the target page controls. In the case of a test script written by a target object using an automated test tool, the target object needs to create a login assistant edit in a programming page of the automated test tool, define a login table in the login assistant edit to facilitate reading login data in the electronic form, then define a browser object to facilitate opening and operating the browser, and then define a scenario table to facilitate reading target test data in the electronic form corresponding to the page to be tested.
According to the embodiment of the disclosure, a plurality of test data are also stored in the database, and target test data corresponding to the identification information of the target page control are determined from the database according to the identification information of the target page control.
For example, the target object selects the page control for inputting the password and the submitted page control, then obtains test data 'afgjaf' corresponding to the page control for inputting the password from the database according to the identification information of the first target page control, and obtains test data 'click to submit' corresponding to the submitted page control from the database according to the identification information of the second target page control.
According to the embodiment of the disclosure, the target test data can be obtained from historical test data corresponding to the target page control.
For example, if the historical test data corresponding to the page control for inputting the password is "afgjaf", the target test data corresponding to the page control for inputting the password in the test is "afgjaf" is obtained according to the historical test data.
In operation S230, a target test script is generated according to the location information of the target page control and the test script template.
According to the embodiment of the disclosure, a code program for filling the position information of the target page control is reserved in the test script template, after the position information of the target page control is obtained, the position information of the target page control is filled into the code program reserved in the test script template, and the target test script is obtained, so that the target test script can identify and operate the target page control in the process of testing the page to be tested according to the obtained position information of the target page control.
In operation S240, the target test script is invoked to input the target test data corresponding to the target page control into the text box corresponding to the target page control, thereby obtaining an output result.
According to the embodiment of the disclosure, the target test script is called to perform automatic test verification on the page to be tested, and in the test process, the target test script inputs target test data into a text box corresponding to the target page control according to the target test data and the target page control corresponding to the target test data, so that the input of the target test data is realized.
According to the embodiment of the disclosure, a drop-down box, a radio selection box, a check box, a submit button and a search control can be further included in the page to be tested, which can correspond to the target page control, and the drop-down box, the radio selection box, the check box, the submit button or the search control corresponding to the target page control is operated according to the target test data, so that the input of the target test data is realized.
According to an embodiment of the present disclosure, in the case where input of target test data has been made to a text box, a drop-down box, a radio box, a check box, a search control related to a target page control, a submit button is clicked in order to confirm that all target test data has been all input into elements corresponding to the target page control. In the case where the submit button has been clicked, the page to be tested may prompt an output result, which may include both the submitted success or the non-submitted success.
In operation S250, the output result is compared with the expected test result corresponding to the target test data, so as to obtain the target test result corresponding to the page to be tested.
According to embodiments of the present disclosure, the target test data may include an expected test result, which may be characterized as a predicted result of the target object pair, which is obtained by inputting the target test data into a target page control of the page to be tested. And under the condition that the output result is consistent with the expected test result, confirming that the test of the page to be tested is successful, and obtaining a target test result corresponding to the page to be tested under the test scene. Under the condition that the output result is inconsistent with the expected test result, the automatic test tool can automatically locate abnormal target test data in the target test data, so that the target object can conveniently debug the target test script.
According to the embodiment of the disclosure, as the received selection operation of the target object on the target page control in the page to be tested is responded, the position information and the identification information of the target page control are obtained, then the test script template and the target test data corresponding to the target page control are obtained from the database according to the identification information of the target page control, then the target test script is generated according to the position information of the target page control and the test script template, the page to be tested is tested by utilizing the target test script, the obtained target test data are input into the text box corresponding to the target page control, the output result is obtained, and then the output result is compared with the expected test result, so that the target test result is obtained. The method and the device realize rapid automatic test of the page to be tested, so that the test result corresponding to the page to be tested is obtained, the page to be tested is conveniently adjusted according to the test result, the test cost is reduced, and the test efficiency is improved. Moreover, the target test script for testing the page to be tested occupies small storage space, so that the consumption of system resources can be reduced and the running performance can be improved under the condition of testing.
According to an embodiment of the present disclosure, for operation S210 shown in fig. 2, in response to a selection operation performed by a received target object for a target page control in a page to be tested, obtaining information of the target page control includes:
according to the embodiment of the disclosure, position area information of all page controls in the page to be tested is obtained.
According to the embodiment of the disclosure, a plurality of page controls can be included in a page to be tested, only one page control can be included, and position area information of all page controls in the page to be tested is obtained.
For example, the credit scene includes 3 page controls in the page to be tested, the position area information of each page control is obtained, the position area information of the first page control is (5, 6), (5, 10), (8, 6), (8, 10), the position area information of the second page control is (26, 18), (26, 23), (30, 18), (30, 23), and the position area information of the third page control is (63, 120), (63, 130), (64, 120), (64, 130).
According to the embodiment of the disclosure, in response to a received selection operation of a target object to a page control in a page to be tested, position information corresponding to the selection operation is acquired.
For example, the target object performs a selection operation in the page to be tested, and the position corresponding to the selection operation is (5, 9).
According to the embodiment of the disclosure, the target page control is determined according to the position information corresponding to the selected operation and the position area information of all page controls.
According to the embodiment of the disclosure, comparing the position corresponding to the selected operation with the position area information of all the controls in the page to be tested, judging whether the position corresponding to the selected operation is in the position area of a certain page control, determining that the page control is a target page control if the position corresponding to the selected operation is determined to be in the position area of the certain page control, and prompting the target object of the unselected page control if the position corresponding to the selected operation is determined not to be in the position area of any page control.
According to implementations of the present disclosure, a plurality of page controls may be included in a page to be tested, and a target object may select a plurality of target page controls.
According to the embodiment of the disclosure, information of a target page control is obtained according to the target page control.
According to the embodiment of the disclosure, according to the determined target page control, the position information and the identification information of the target page control are obtained.
According to the embodiment of the disclosure, the position information corresponding to the selected operation at the moment is determined according to the selected operation of the target object in the page to be tested by acquiring the position area information of all page controls in the page to be tested, whether the target object selects a certain page control in the page to be tested or not is judged according to the position information corresponding to the selected operation and the position area information of the page control, in the case of selection, the page control corresponding to the selected operation is determined to be the target page control, the position information and the identification information corresponding to the target page control are acquired according to the target page control, the determination of the target page control from the page to be tested is realized, whether the page control is selected or not is judged according to the position information of the selected operation and the area information of the page control, and in the case of no page control is not selected, a prompt is sent to the target object so that the position of the selected operation is adjusted by the target object, and the target page control required by the target object is selected so that the target page control is conveniently tested.
In accordance with an embodiment of the present disclosure, for operation S220 as shown in fig. 2, in the case of having a plurality of target page controls; according to the identification information of the target page control, acquiring a test script template and target test data corresponding to the identification information of the target page control from a database, wherein the method comprises the following steps:
according to the embodiment of the disclosure, according to the identification information of the plurality of target page controls, a plurality of test data corresponding to the identification information of the plurality of target page controls are obtained from a database.
According to the embodiment of the disclosure, under the condition that a target object selects a plurality of target page controls from one page to be tested, target test data corresponding to the identification information of each target page control is obtained from a database according to the identification information of each target page control.
According to the embodiment of the disclosure, in the case of testing one page to be tested, according to the target test data corresponding to the identification information of each target page control, a plurality of target test data can be placed in one scene electronic table, and name labeling is carried out on the scene electronic table according to the page to be tested, so that a target object defines a scene table corresponding to the page to be tested in the test scene under the condition of writing a script by using an automatic test tool, and the target test data corresponding to a plurality of target page controls in the page to be tested in the scene is read according to the defined scene table.
According to embodiments of the present disclosure, the test data corresponding to the identification information of the target page control may include a plurality of branch test data. For example, the identification information of the target page control is in a credit card state, two branches are arranged on the test data corresponding to the credit card state information of the target page control, and the two branches are respectively activated and frozen, so that the test data corresponding to the credit card state information of the target page control is activated and frozen.
For example, the target test data corresponding to the target page control a is "credit business", the target test data corresponding to the target page control B is "fhakhfk", the target test data corresponding to the target page control C is "activated and frozen", and the target test data corresponding to the target page control a, the target test data corresponding to the target page control B and the target test data corresponding to the target page control C are stored in the loan scene electronic table.
According to the embodiment of the disclosure, under the condition that the target object selects a plurality of target page controls from one page to be tested, a plurality of test scripts corresponding to the identification information of the plurality of target page controls can be acquired from a database according to the identification information of the price control of each target page, and then the plurality of test scripts are combined to obtain the test script template.
According to the embodiment of the disclosure, based on the test logic corresponding to the plurality of target page controls, the plurality of test data are sequenced, and the sequenced plurality of test data are obtained.
According to embodiments of the present disclosure, the test logic may be characterized as a sequencing of execution of the target page controls.
According to the implementation of the disclosure, the test data corresponding to each target page control is ordered according to the test logic, and a plurality of ordered test data are obtained. After the plurality of test data are sequenced, the sequenced plurality of test data can be stored in the scene electronic table, so that the target test script can process each target page control from the scene electronic table according to the sequenced test data under the condition of testing the page to be tested.
For example, the test data corresponding to the user name target page control is "credit business", the test data corresponding to the password target page control is "fhakhfk", the test data corresponding to the status target page control is "activate, fail", and according to the test logic: firstly, inputting a user name, then inputting a password, finally, inputting a state, and sequencing test data to obtain a plurality of test data which are sequenced according to test logic, namely ' credit service ', fhakhfk ' and ' activation and failure '.
According to an embodiment of the present disclosure, target test data is generated from the ordered plurality of test data and the expected test result.
For example, the target object inputs the target test data into a target page control of a to-be-tested page in a credit business scene to obtain a prediction result of "success in submitting", and arranges the prediction result of "success in submitting" in a plurality of test data to obtain target test data of "credit business", test data of "fhakhfk", test data of "activation, failure" and "success in submitting".
According to the implementation of the disclosure, the target test data may further include login data related to the target object, where the login data may include information such as a user name, a login password, a system address of the target object, so as to verify whether the target object has a test authority on a page to be tested, and ensure information security in the page to be tested.
According to the embodiment of the disclosure, under the condition that a plurality of target page controls exist, a plurality of test data corresponding to the plurality of target page controls are obtained from a database according to identification information of the plurality of target page controls, the test data are ordered according to test logic corresponding to the target page controls, the ordered plurality of test data are obtained, and then expected test results are added to the ordered plurality of test data to obtain target test data.
According to an embodiment of the present disclosure, for operation S240 shown in fig. 2, by calling a target test script, target test data corresponding to a target page control is input into a text box corresponding to the target page control, to obtain an output result, including:
according to an embodiment of the disclosure, a target test script is invoked to determine target test data corresponding to a target page control.
According to the embodiment of the disclosure, the target test script is called, login data is read from target test data according to the defined login table, and user login is performed on the page to be tested, so that test safety is ensured, and an irrelevant person is prevented from operating the page to be tested, so that information is leaked.
According to the embodiment of the disclosure, in the case that the same target object tests the page to be tested, only one user login is needed.
According to the implementation of the disclosure, under the condition that the login operation of the page to be tested is completed, a target test script is called, and target test data corresponding to a target page control in the page to be tested in a scene is read from the target test data according to a defined scene table.
According to an embodiment of the present disclosure, a text box corresponding to a target page control is changed to an edit state.
According to the embodiment of the disclosure, elements corresponding to the target page control can include a text box, a drop-down box, a radio box, a check box, a submit button, a search control and the like, and the state of the element corresponding to the target page control is changed into an editable state so as to facilitate input operation or selection operation on the element corresponding to the target page control.
According to the embodiment of the disclosure, target test data are input into a text box corresponding to a target page control, and an output result is obtained.
According to the embodiment of the disclosure, according to elements which correspond to the target page control and can include a text box, a drop-down box, a radio box, a check box, a submit button, a search control and the like, target test data is input into the text box, or the elements which correspond to the target test data are selected from the drop-down box, and an output result is obtained when the input of the target test data is completed.
According to the embodiment of the disclosure, when the target test script is called to test under the condition that the test data corresponding to the same target page control has a plurality of branches, the target test script can automatically execute the plurality of branches of test data. For example, when the test data corresponding to the credit card number of the target page control is "5452 x 6459", the test data corresponding to the credit card password of the target page control is "ahk x 654", the test data corresponding to the credit card state of the target page control is "activated and frozen", the target test script is invoked for testing, the target test script would first input test data "5452 x 6459", test data "ahk x 654", test data "activate" to the text box corresponding to the target page control or select text from the drop down boxes consistent with the test data for testing of the first branch test data, after the end of the test, the test piece, and inputting the test data of 5452 x 6459, the test data of ahk x 654 and the test data of freezing into a text box corresponding to the target page control or selecting a text consistent with the test data from the drop-down box to test the test data of another branch, thereby obtaining an output result.
According to an embodiment of the present disclosure, after inputting target test data into a text box corresponding to a target page control, a target test script performs a submitting operation, and a to-be-tested page tests the input target test data to obtain an output result, where the output result may include: either committed or uncommitted.
According to the embodiment of the disclosure, the target test script is called to determine the target test data corresponding to the target page control, then the text box corresponding to the target page control is changed into the editing state, and the determined target test data is input into the corresponding text box to obtain the output result, so that the target test script written by the automatic test tool is used for automatically testing the page to be tested and automatically outputting the test result, and according to the output test result, the target object can confirm the test condition, the test efficiency is improved, and the test cost is reduced.
For operation S250 shown in fig. 2, comparing the output result with the expected test result corresponding to the target test data to obtain the target test result corresponding to the page to be tested, including:
fig. 3 schematically illustrates a flow chart for obtaining a target test result corresponding to a page to be tested according to the present disclosure.
As shown in FIG. 3, the page testing method of the embodiment includes operations S310-S350.
In operation S310, the output result is compared with the expected test result corresponding to the target test data, so as to obtain a first comparison result.
According to the embodiment of the disclosure, the first comparison result may be that the output result is consistent with the expected test result corresponding to the target test data, or may be that the output result is inconsistent with the expected test result corresponding to the target test data. And under the condition that the first comparison result is characterized in that the output result is consistent with the expected test result corresponding to the target test data, confirming that the test of the page to be tested is successful, obtaining an execution result, and after filling the execution result in the expected test result in the target test data, sending the target test data containing the execution result to a target person so as to facilitate the target person to confirm the test result.
In operation S320, if the first comparison result is characterized in that the output result is inconsistent with the expected test result corresponding to the target test data, the target test data is marked, and abnormal test data is obtained.
According to embodiments of the present disclosure, abnormal test data may be characterized as target test data that results in a commit failure.
According to the embodiment of the disclosure, under the condition that a plurality of target page controls are provided, the target test data can comprise test data corresponding to each target page control, the target test data is checked according to the first comparison result, and rendering labeling is carried out on the test data with abnormality in the target test data. Under the condition that only one target page control is provided, rendering and labeling can be directly carried out on target test data corresponding to the target page control according to a first comparison result, so that a target object is prompted to debug and retest a page to be tested.
In operation S330, an abnormal page control corresponding to the abnormal test data is determined based on the abnormal test data, and an abnormal code field corresponding to the abnormal page control is determined in the target test script.
According to the embodiment of the disclosure, the target object can determine the abnormal page control from the target page control through the rendered abnormal test data, and then find the corresponding abnormal code field from the target test script according to the abnormal page control so as to conveniently check whether writing errors exist in the abnormal code field or judge data selection errors of the abnormal test data, so that adjustment is performed.
In operation S340, the abnormal code field in the target test script is adjusted to obtain the debug test script.
According to the embodiment of the disclosure, under the condition that the submission failure caused by the abnormal page control is confirmed, the abnormal code field in the target test script is adjusted, and the debug test script is obtained. And under the condition that the abnormal test data is confirmed to cause the submission failure, reselecting the test data corresponding to the target page control from the database to obtain the debugging test data.
In operation S350, the page to be tested is tested according to the debug test script and the target test data, and a target test result corresponding to the page to be tested is obtained.
According to the embodiment of the disclosure, under the condition that the submission failure caused by the abnormal page control is confirmed, a new test is carried out on the page to be tested by utilizing the debugged debugging test script and the target test data, and a target test result corresponding to the page to be tested is obtained.
According to the embodiment of the disclosure, under the condition that the submission failure caused by the abnormal test data is confirmed, a new test is carried out on the page to be tested by utilizing the target test script and the debugged target test data, and a target test result corresponding to the page to be tested is obtained.
According to the embodiment of the disclosure, the output result is compared with the expected test result to obtain the first comparison result, the target test data is marked under the condition that the output result is inconsistent with the expected test result to obtain the abnormal test data, the abnormal page control is determined according to the abnormal test data, the abnormal code field in the target test script is determined according to the abnormal page control, the abnormal code field in the target test script is adjusted and modified to obtain the debugging test script, the debugging test foot and the target test data are used for testing the page to be tested to obtain the target test result, the abnormal control corresponding to the abnormal data is automatically positioned, the test script corresponding to the abnormal control is debugged to obtain the new test script, and therefore the problem of manual positioning errors is not needed, the automatic positioning of the abnormal state is reduced, the debugging cost is reduced, and the test efficiency is improved.
According to an embodiment of the present disclosure, for operation S320 shown in fig. 3, in a case where the first comparison result is characterized in that the output result is inconsistent with an expected test result corresponding to the target test data, labeling the target test data in the test data table to obtain abnormal test data includes:
According to the embodiment of the disclosure, historical test data is obtained from a database according to identification information of a page to be tested and a target page control.
According to the embodiment of the disclosure, the database stores historical test data corresponding to the page to be tested and the target page control, and the historical test data is acquired from the database so as to confirm abnormal test data.
For example, according to the page of the credit service to be tested and the credit card number target page control, the credit card password target page control and the credit card state target page control in the page of the credit service, the latest historical test data is obtained from the database, wherein the historical test data is "credit card number: 1357××8539"," credit card password: gkaa ×× quro "," credit card status: activating and freezing.
According to the embodiment of the disclosure, the historical test data and the target test data are compared to obtain a second comparison result.
For example, the historical test data is "credit card number: 1357××8539"," credit card password: gkaa ×× quro "," credit card status: activating, freezing ", the target test data is" credit card number: 1357××8539"," credit card password: gkaa ×× quro "," credit card status: activating, freezing and suspending, and comparing the historical test data with the target test data to obtain a second comparison result which is a credit card state: pause).
According to the embodiment of the disclosure, the target test data is marked according to the second comparison result, and the abnormal test data is obtained.
For example, the target test data is "credit card number: 1357××8539"," credit card password: gkaa ×× quro "," credit card status: activating, freezing and suspending, wherein the second comparison result is "credit card state: and (3) pausing, namely rendering and marking all the test data in the credit card state column in the target test data, and marking the paused data in the credit card state column with red so as to further prompt the abnormal test data.
According to the embodiment of the disclosure, historical test data is obtained from a database according to identification information of a to-be-tested page and a target page control, then the historical test data and the target test data are compared, different test data of the target test data and the historical test data are determined to be second comparison results, the target test data are marked according to the second comparison results, abnormal test data are obtained, automatic positioning of the abnormal test data and marking of the abnormal test data in the target test data are achieved, and therefore the target object can conveniently determine the abnormal test data in the target test data after receiving the test.
According to an embodiment of the present disclosure, for all operations as shown in fig. 2, in the case of having a plurality of pages to be tested, further including:
Fig. 4 schematically illustrates a flow chart for testing a plurality of pages to be tested according to the present disclosure.
As shown in FIG. 4, the page testing method of this embodiment includes operations S410-S440.
In operation S410, the target test data is processed according to the target test result corresponding to the first page to be tested, to obtain target test data including the target test result corresponding to the first page to be tested.
According to an embodiment of the present disclosure, the target test data includes a plurality of test data corresponding to a plurality of pages to be tested.
According to an embodiment of the disclosure, in a scenario table defined in a target test script, target test data may include a plurality of test data, each of the test data corresponds to a page to be tested in a different scenario, and when the target test script is called to complete the test on the page to be tested in the first scenario, a target test result corresponding to the page to be tested in the first scenario is written into the test data corresponding to the page to be tested in the first scenario.
In operation S420, under the condition that the first test data includes the target test result corresponding to the first page to be tested, the target test script is invoked, and according to the next test data corresponding to the next page to be tested, the next page to be tested is tested, so as to obtain the target test result corresponding to the next page to be tested.
According to the embodiment of the disclosure, under the condition that the first test data comprises a target test result corresponding to the first page to be tested, the test data corresponding to the page to be tested in the second scene is utilized to test the page to be tested in the second scene, and under the condition that the test is completed, the pages to be tested in the subsequent scenes are tested in sequence.
According to the implementation of the disclosure, under the condition that the first test data does not include the target test result corresponding to the first page to be tested, the test of the page to be tested in the subsequent scene is not performed, and under the condition that the first test data includes the target test result corresponding to the first page to be tested, the test of the page to be tested in the subsequent scene is not performed sequentially.
In operation S430, the target test data is processed according to the target test result corresponding to the next page to be tested, to obtain target test data including the target test result corresponding to the next page to be tested.
According to the embodiment of the disclosure, under the condition that the target test result corresponding to the page to be tested in the second scene is obtained, the target test result corresponding to the page to be tested in the second scene is written into the test data corresponding to the page to be tested in the second scene.
In operation S440, in case that the target test result corresponding to each page to be tested is included in the target test data, the target test data including the target test result corresponding to each page to be tested is transmitted to the target object.
According to the embodiment of the disclosure, a target test script is called, test data corresponding to each scene are sequentially utilized to test a page to be tested in the target test data corresponding to each scene, a target test result corresponding to each page to be tested is sequentially obtained, each target test result is written into each test data in the target test data, and then the target test data are sent to a target object, so that the target object can perform other processing according to the target test data.
According to the embodiment of the disclosure, under the condition that the pages to be tested in a plurality of different scenes are contained, the pages to be tested in all scenes are required to be tested, after the testing of the pages to be tested in the first scene is completed, the target test results corresponding to the pages to be tested are obtained, the target test results are written into the corresponding test data, then the pages to be tested in the next scene are tested, the test is sequentially executed until the testing of the pages to be tested in all scenes is completed, and the obtained target test data comprise the target test results corresponding to the pages to be tested in each scene, so that the batch testing of the pages to be tested by utilizing the test data in the plurality of different scenes is realized, the test efficiency is improved, and the test cost is reduced.
Fig. 5 schematically shows a schematic diagram of login data according to an embodiment of the present disclosure.
As shown in fig. 5, fig. 5 illustrates login data, in which identification information of a target page control and login test data corresponding to the identification information of the target page control may be included, and the identification information of the target page control may include a system address, a user name, and a password.
Fig. 6 schematically shows a schematic diagram of scene data according to an embodiment of the present disclosure.
As shown in fig. 6, fig. 6 illustrates scene data, where the scene data may include identification information of a target page control and target test data corresponding to the identification information of the target page control, where the identification information of the target page control may include a text box control and a drop-down box control, and the target test data further includes an expected test result and a final target test result.
Based on the data processing method, the disclosure also provides a page testing device. The device will be described in detail below in connection with fig. 7.
Fig. 7 schematically shows a block diagram of a structure of a page test apparatus according to an embodiment of the present disclosure.
As shown in fig. 7, the page testing apparatus 700 of this embodiment includes a first acquisition module 710, a second acquisition module 720, a generation module 730, an input module 740, and an obtaining module 750.
The first obtaining module 710 is configured to obtain information of a target page control in response to a selection operation performed by a received target object on the target page control in a page to be tested, where the information of the target page control includes location information of the target page control and identification information of the target page control. In an embodiment, the first obtaining module 710 may be configured to perform the operation S210 described above, which is not described herein.
The second obtaining module 720 is configured to obtain, from the database, a test script template and a target test data table corresponding to the identification information of the target page control according to the identification information of the target page control. In an embodiment, the second obtaining module 720 may be configured to perform the operation S220 described above, which is not described herein.
And the generating module 730 is configured to generate a target test script according to the location information of the target page control and the test script template. In an embodiment, the generating module 730 may be configured to perform the operation S230 described above, which is not described herein.
And the input module 740 is used for inputting the target test data corresponding to the target page control into the text box corresponding to the target page control by calling the target test script, so as to obtain an output result. In an embodiment, the input module 740 may be used to perform the operation S240 described above, which is not described herein.
The obtaining module 750 is configured to compare the output result with an expected test result corresponding to the target test data, so as to obtain a target test result corresponding to the page to be tested. In an embodiment, the obtaining module 750 may be used to perform the operation S250 described above, which is not described herein.
According to an embodiment of the present disclosure, the generating module 740 includes: the system comprises a first calling sub-module, a first changing sub-module and a first obtaining sub-module.
And the first calling sub-module is used for calling the target test script and determining target test data corresponding to the target page control.
And the first modification sub-module is used for modifying the text box corresponding to the target page control into an editing state.
And the second obtaining sub-module is used for inputting the target test data into the text box corresponding to the target page control to obtain an output result.
According to an embodiment of the present disclosure, the obtaining module 750 includes: the system comprises a first comparison sub-module, a first labeling sub-module, a first determination sub-module, a first adjustment sub-module and a second obtaining sub-module.
And the first comparison sub-module is used for comparing the output result with an expected test result corresponding to the target test data to obtain a first comparison result.
And the first labeling sub-module is used for labeling the target test data to obtain abnormal test data under the condition that the first comparison result is characterized in that the output result is inconsistent with the expected test result corresponding to the target test data.
The first determining submodule is used for determining an abnormal page control corresponding to the abnormal test data based on the abnormal test data and determining an abnormal code field corresponding to the abnormal page control in the target test script.
And the first adjusting sub-module is used for adjusting the abnormal code field in the target test script to obtain the debugging test script.
And the second obtaining submodule is used for testing the page to be tested according to the debugging test script and the target test data to obtain a target test result corresponding to the page to be tested.
According to an embodiment of the present disclosure, the first labeling submodule includes: the device comprises a first acquisition unit, a first comparison unit and a first labeling unit.
A first obtaining unit, configured to obtain historical test data from a database according to identification information of a to-be-tested page and a target page control
The first comparison unit is used for comparing the historical test data with the target test data to obtain a second comparison result
The first labeling unit is used for labeling the target test data according to the second comparison result to obtain abnormal test data.
According to an embodiment of the present disclosure, the second acquisition module 720 includes: the system comprises a first acquisition sub-module, a first processing sub-module and a first generation sub-module.
The first acquisition sub-module is used for acquiring a plurality of test data corresponding to the identification information of the plurality of target page controls from the database according to the identification information of the plurality of target page controls.
The first processing sub-module is used for sorting the plurality of test data based on the test logic corresponding to the plurality of target page controls to obtain the sorted plurality of test data.
The first generation sub-module is used for generating target test data according to the ordered plurality of test data and the expected test result.
According to an embodiment of the present disclosure, the page testing apparatus 700 further includes: the second obtaining module, the testing module, the processing module and the sending module.
The second obtaining module is used for processing the target test data according to the target test result corresponding to the first page to be tested to obtain target test data comprising the target test result corresponding to the first page to be tested, wherein the target test data comprises a plurality of test data corresponding to a plurality of pages to be tested.
And the test module is used for calling the target test script under the condition that the first test data comprise the target test result corresponding to the first page to be tested, and testing the next page to be tested according to the next test data corresponding to the next page to be tested to obtain the target test result corresponding to the next page to be tested.
And the processing module is used for processing the target test data according to the target test result corresponding to the next page to be tested to obtain target test data comprising the target test result corresponding to the next page to be tested.
And the sending module is used for sending the target test data comprising the target test result corresponding to each page to be tested to the target object under the condition that the target test data comprises the target test result corresponding to each page to be tested.
According to an embodiment of the present disclosure, the first acquisition module 710 includes: the system comprises a second acquisition sub-module, a third acquisition sub-module, a second determination sub-module and a fourth acquisition sub-module.
And the second acquisition sub-module is used for acquiring the position area information of all page controls in the page to be tested.
And the third acquisition sub-module is used for responding to the received selected operation of the page control in the page to be tested by the target object and acquiring the position information corresponding to the selected operation.
And the second determining submodule is used for determining the target page control according to the position information corresponding to the selected operation and the position area information of all page controls.
And the fourth acquisition sub-module is used for acquiring the information of the target page control according to the target page control.
According to an embodiment of the present disclosure, any of the first acquisition module 710, the second acquisition module 720, the generation module 730, the input module 740, and the obtaining module 750 may be combined in one module to be implemented, or any of the modules may be split into a plurality of modules. Or at least some of the functionality of one or more of the modules may be combined with, and implemented in, at least some of the functionality of other modules. At least one of the first acquisition module 710, the second acquisition module 720, the generation module 730, the input module 740, and the obtaining module 750 according to embodiments of the present disclosure may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or in hardware or firmware in any other reasonable manner of integrating or packaging the circuitry, or in any one of or a suitable combination of any of the three. Or at least one of the first acquisition module 710, the second acquisition module 720, the generation module 730, the input module 740, and the obtaining module 750 may be at least partially implemented as computer program modules, which when executed, may perform the respective functions.
Fig. 8 schematically illustrates a block diagram of an electronic device adapted to implement a data processing method according to an embodiment of the disclosure.
As shown in fig. 8, an electronic device 800 according to an embodiment of the present disclosure includes a processor 801 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. The processor 801 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. The processor 801 may also include on-board memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing the different actions of the method flows according to embodiments of the disclosure.
In the RAM 803, various programs and data required for the operation of the electronic device 800 are stored. The processor 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. The processor 801 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 802 and/or the RAM 803. Note that the program may be stored in one or more memories other than the ROM 802 and the RAM 803. The processor 801 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, the electronic device 800 may also include an input/output (I/O) interface 805, the input/output (I/O) interface 805 also being connected to the bus 804. The electronic device 800 may also include one or more of the following components connected to the I/O interface 805: an input portion 806 including a keyboard, mouse, etc.; an output portion 807 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 808 including a hard disk or the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. The drive 810 is also connected to the I/O interface 805 as needed. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as needed so that a computer program read out therefrom is mounted into the storage section 808 as needed.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example, but is not limited to: 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), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 802 and/or RAM 803 and/or one or more memories other than ROM 802 and RAM 803 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowcharts. The program code, when executed in a computer system, is configured to cause the computer system to implement the page testing method provided by the embodiments of the present disclosure.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 801. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed over a network medium, and downloaded and installed via a communication section 809, and/or installed from a removable medium 811. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 809, and/or installed from the removable media 811. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 801. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be provided in a variety of combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. These examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (11)

1. A method of testing a page, the method comprising:
Responding to a received selection operation of a target object for a target page control in a page to be tested, and acquiring information of the target page control, wherein the information of the target page control comprises position information of the target page control and identification information of the target page control;
according to the identification information of the target page control, a test script template and target test data corresponding to the identification information of the target page control are obtained from a database;
Generating a target test script according to the position information of the target page control and the test script template;
inputting target test data corresponding to the target page control into a text box corresponding to the target page control by calling the target test script to obtain an output result;
and comparing the output result with an expected test result corresponding to the target test data to obtain a target test result corresponding to the page to be tested.
2. The method according to claim 1, wherein the inputting the target test data corresponding to the target page control into the text box corresponding to the target page control by calling the target test script, to obtain the output result, includes:
invoking the target test script, and determining the target test data corresponding to the target page control;
changing a text box corresponding to the target page control into an editing state;
and inputting the target test data into a text box corresponding to the target page control to obtain an output result.
3. The method according to claim 1, wherein comparing the output result with the expected test result corresponding to the target test data to obtain the target test result corresponding to the page to be tested, includes:
Comparing the output result with an expected test result corresponding to the target test data to obtain a first comparison result;
Marking the target test data to obtain abnormal test data under the condition that the first comparison result is characterized in that the output result is inconsistent with the expected test result corresponding to the target test data;
Determining an abnormal page control corresponding to the abnormal test data based on the abnormal test data, and determining an abnormal code field corresponding to the abnormal page control in the target test script;
Adjusting an abnormal code field in the target test script to obtain a debugging test script;
and testing the page to be tested according to the debugging test script and the target test data to obtain a target test result corresponding to the page to be tested.
4. A method according to claim 3, wherein, in the case where the first comparison result is characterized in that the output result is inconsistent with the expected test result corresponding to the target test data, labeling the target test data in the test data table to obtain abnormal test data includes:
acquiring historical test data from a database according to the identification information of the page to be tested and the target page control;
Comparing the historical test data with the target test data to obtain a second comparison result;
And marking the target test data according to the second comparison result to obtain the abnormal test data.
5. The method of claim 1, wherein in the case of having a plurality of target page controls; the step of obtaining the test script template and the target test data corresponding to the identification information of the target page control from a database according to the identification information of the target page control comprises the following steps:
acquiring a plurality of test data corresponding to the identification information of the target page controls from the database according to the identification information of the target page controls;
based on the test logic corresponding to the target page controls, sequencing the test data to obtain sequenced test data;
And generating the target test data according to the sequenced plurality of test data and the expected test result.
6. The method of claim 1, further comprising, in the case of having a plurality of pages to be tested:
Processing the target test data according to a target test result corresponding to the first page to be tested to obtain target test data comprising the target test result corresponding to the first page to be tested, wherein the target test data comprises a plurality of test data corresponding to the plurality of pages to be tested;
under the condition that the first test data comprise the target test result corresponding to the first page to be tested, calling a target test script, and testing the next page to be tested according to the next test data corresponding to the next page to be tested to obtain the target test result corresponding to the next page to be tested;
processing the target test data according to the target test result corresponding to the next page to be tested to obtain target test data comprising the target test result corresponding to the next page to be tested;
And under the condition that the target test data comprises target test results corresponding to each page to be tested, sending the target test data comprising the target test results corresponding to each page to be tested to the target object.
7. The method according to claim 1, wherein the obtaining, in response to the received selection operation of the target object for the target page control in the page to be tested, information of the target page control includes:
acquiring position area information of all page controls in the page to be tested;
Responding to the received selection operation of the target object on the page control in the page to be tested, and acquiring position information corresponding to the selection operation;
Determining a target page control according to the position information corresponding to the selected operation and the position area information of all page controls;
And acquiring information of the target page control according to the target page control.
8. A page testing apparatus, the method comprising:
The first acquisition module is used for responding to the received selection operation of the target object for the target page control in the page to be tested, and acquiring the information of the target page control, wherein the information of the target page control comprises the position information of the target page control and the identification information of the target page control;
the second acquisition module is used for acquiring a test script template and a target test data table corresponding to the identification information of the target page control from a database according to the identification information of the target page control;
the generating module is used for generating a target test script according to the position information of the target page control and the test script template;
the input module is used for inputting target test data corresponding to the target page control into a text box corresponding to the target page control by calling the target test script to obtain an output result;
and the obtaining module is used for comparing the output result with an expected test result corresponding to the target test data to obtain a target test result corresponding to the page to be tested.
9. An electronic device, comprising:
One or more processors;
a memory for storing one or more computer programs,
Characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1-7.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any of claims 1-7.
11. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, realizes the steps of the method according to any one of claims 1-7.
CN202410784493.6A 2024-06-18 2024-06-18 Page test method, device, equipment, medium and program product Pending CN118377722A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410784493.6A CN118377722A (en) 2024-06-18 2024-06-18 Page test method, device, equipment, medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410784493.6A CN118377722A (en) 2024-06-18 2024-06-18 Page test method, device, equipment, medium and program product

Publications (1)

Publication Number Publication Date
CN118377722A true CN118377722A (en) 2024-07-23

Family

ID=91908961

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410784493.6A Pending CN118377722A (en) 2024-06-18 2024-06-18 Page test method, device, equipment, medium and program product

Country Status (1)

Country Link
CN (1) CN118377722A (en)

Similar Documents

Publication Publication Date Title
CN107506300B (en) User interface testing method, device, server and storage medium
CN108628748B (en) Automatic test management method and automatic test management system
US11681511B2 (en) Systems and methods for building and deploying machine learning applications
CN113535577B (en) Application testing method and device based on knowledge graph, electronic equipment and medium
CN113918864A (en) Website page testing method, testing system, testing device, electronic equipment and medium
CN115827122A (en) Operation guiding method and device, electronic equipment and storage medium
CN115080433A (en) Testing method and device based on flow playback
CN115292187A (en) Method and device for automatically testing code-free page, electronic equipment and medium
CN114637689A (en) Application evaluation method, device, equipment and storage medium
CN118377722A (en) Page test method, device, equipment, medium and program product
CN115203178A (en) Data quality inspection method and device, electronic equipment and storage medium
CN113448822A (en) Test method, test device, computer readable medium and electronic equipment
CN113360380B (en) Method and device for generating data case based on flow chart
CN112631930B (en) Dynamic system testing method and related device
CN117435464A (en) Software testing method and device, electronic equipment and computer readable storage medium
CN117931673A (en) Test method, test device, test apparatus, test medium, and test program product
CN117493207A (en) Page processing method, device, electronic equipment and storage medium
CN118093288A (en) Terminal test method, device, equipment, storage medium and program product
CN114064484A (en) Interface testing method and device, electronic equipment and readable storage medium
CN115687093A (en) Test script generation method, device, equipment and storage medium
CN113742240A (en) User interface testing method and device, storage medium and electronic equipment
CN117194250A (en) Test case generation method, device, equipment, medium and program product
CN118174823A (en) Message processing method, device, equipment, medium and program product
CN117931668A (en) Interface test management method, device, equipment and medium
CN114911770A (en) Method, device, equipment and medium for evaluating database migration

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