CN114328169A - Dynamic page testing method and system - Google Patents

Dynamic page testing method and system Download PDF

Info

Publication number
CN114328169A
CN114328169A CN202011071881.8A CN202011071881A CN114328169A CN 114328169 A CN114328169 A CN 114328169A CN 202011071881 A CN202011071881 A CN 202011071881A CN 114328169 A CN114328169 A CN 114328169A
Authority
CN
China
Prior art keywords
page
classification model
model
testing
element information
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
CN202011071881.8A
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.)
Fujian Tianquan Educational Technology Ltd
Original Assignee
Fujian Tianquan Educational Technology Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Tianquan Educational Technology Ltd filed Critical Fujian Tianquan Educational Technology Ltd
Priority to CN202011071881.8A priority Critical patent/CN114328169A/en
Publication of CN114328169A publication Critical patent/CN114328169A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention provides a method for testing a dynamic page, which comprises the following steps: s1, acquiring the dynamically generated page information each time to obtain interface element information; step S2, judging the type of the current page through the trained classification model, and giving corresponding predefined operation to each page control one by one through the classification model; step S3, adding corresponding verification content to the predefined operation through the classification model; step S4, testing the verification content of the page and outputting a test result; the invention is realized automatically, releases manpower and improves the testing efficiency.

Description

Dynamic page testing method and system
Technical Field
The invention relates to the field of website page testing, in particular to a method and a system for testing a dynamic page.
Background
Dynamic pages refer to pages that are assembled or spliced in real time based on some rule. For example, 1. the contact list page in the WeChat is assembled according to the historical chat state. 2. And recommending contents for the home page of the video software, wherein the appearing module is dynamically generated according to the user information.
The prior art has the following defects: the page is generated completely based on the rule, the generated interface may have resource mismatching, and the page display is abnormal. Due to the randomness of the page, automatic testing cannot be performed in a mode of writing or recording a script in advance in the testing process, manual testing can only be passed, and the efficiency is low.
Disclosure of Invention
In order to overcome the above problems, an object of the present invention is to provide a method for testing a dynamic page, which can dynamically execute operations in real time and check and accept the operation results, thereby improving the testing efficiency.
The invention is realized by adopting the following scheme: a method for testing a dynamic page, the method comprising the steps of:
s1, acquiring the dynamically generated page information each time to obtain interface element information;
step S2, judging the type of the current page through the trained classification model, and giving corresponding predefined operation to each page control one by one through the classification model;
step S3, adding corresponding verification content to the predefined operation through the classification model;
and step S4, testing the verification content of the page and outputting a test result.
Further, the interface element information includes layout, controls, text, pictures, stack, and hierarchy.
Further, the test method further comprises: after each round of test execution is finished, the script generated by each control is modified in a manual modification mode, so that the subsequently generated script is more suitable for the current tested product.
Further, the training mode of the trained classification model is as follows: acquiring all element information of a plurality of pages of the same type through an airtest automatic testing framework, and storing the element information into different one-dimensional arrays respectively as training data after binarization; taking the data of one page as a data reference, and taking the data of the rest pages of the plurality of pages of the same type as output data; creating two layers of forward neural networks by using a deep learning framework pytore, and carrying out model training, wherein a Loss function of the model training is Cross Entrophy; and training the model to enable the Loss value to approach zero, and reserving the model as a classification model of the corresponding page.
Further, the judging the type of the current page by the trained classification model specifically includes: the method comprises the steps of performing binarization on interface element information acquired by page information, storing the interface element information into a one-dimensional array as model input data, inputting the model input data into a classification model to generate a new one-dimensional array, performing subtraction difference value combination calculation on the one-dimensional array of the input data and the new one-dimensional array (namely performing subtraction and then performing combination calculation on the difference values), and judging that a current page belongs to a type page in the classification model if the value is less than 1; otherwise, the next classification model is circularly used for generating and combining the arrays.
The invention also provides a test system of the dynamic page, which comprises an acquisition module, an operation adding module, a verification content adding module and a test module;
the acquisition module is used for acquiring the page information dynamically generated each time to acquire interface element information;
the operation adding module is used for judging the type of the current page through the trained classification model and giving corresponding predefined operations to each page control one by one through the classification model;
the verification content adding module is used for adding corresponding verification content to the predefined operation through the classification model;
the test module is used for testing the verification content of the page and outputting a test result.
Further, the interface element information includes layout, controls, text, pictures, stack, and hierarchy.
Further, the test system further includes: after each round of test execution is finished, the script generated by each control is modified in a manual modification mode, so that the subsequently generated script is more suitable for the current tested product.
Further, the training mode of the trained classification model is as follows: acquiring all element information of a plurality of pages of the same type through an airtest automatic testing framework, and storing the element information into different one-dimensional arrays respectively as training data after binarization; taking the data of one page as a data reference, and taking the data of the rest pages of the plurality of pages of the same type as output data; creating two layers of forward neural networks by using a deep learning framework pytore, and carrying out model training, wherein a Loss function of the model training is Cross Entrophy; and training the model to enable the Loss value to approach zero, and reserving the model as a classification model of the corresponding page.
Further, the judging the type of the current page by the trained classification model specifically includes: the method comprises the steps of performing binarization on interface element information acquired by page information, storing the interface element information into a one-dimensional array as model input data, inputting the model input data into a classification model to generate a new one-dimensional array, performing subtraction difference value combination calculation on the one-dimensional array of the input data and the new one-dimensional array, and judging that a current page belongs to a type page in the classification model if the value is less than 1; otherwise, the next classification model is circularly used for generating and combining the arrays.
The invention has the beneficial effects that: 1. the testing method is realized automatically by time-consuming manual operation, releases manpower and improves testing efficiency.
2. The method has the advantages that an innovation is effectively made, the operation can be dynamically executed in real time, and the operation result can be checked and accepted without the need of recording the script in advance by a user.
3. The test system can be continuously adjusted and optimized without continuously modifying the script like the conventional automatic test, and the adjustment and optimization can be realized only by the feedback of the test result of each time.
Drawings
FIG. 1 is a schematic flow diagram of the process of the present invention.
FIG. 2 is a flowchart illustrating a classification model training method according to an embodiment of the present invention.
Fig. 3 is a schematic block diagram of the system of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
Referring to fig. 1, the method for testing a dynamic page of the present invention includes the following steps:
s1, acquiring the dynamically generated page information each time to obtain interface element information;
step S2, judging the type of the current page through the trained classification model, and giving corresponding predefined operation to each page control one by one through the classification model;
step S3, adding corresponding verification content to the predefined operation through the classification model;
and step S4, testing the verification content of the page and outputting a test result.
The training mode of the classification model is as follows: acquiring all element information of a plurality of pages of the same type through an airtest automatic testing framework, and storing the element information into different one-dimensional arrays respectively as training data after binarization; taking the data of one page as a data reference, and taking the data of the rest pages of the plurality of pages of the same type as output data; creating two layers of forward neural networks by using a deep learning framework pytore, and carrying out model training, wherein a Loss function of the model training is Cross Entrophy; and training the model to enable the Loss value to approach zero, and reserving the model as a classification model of the corresponding page.
Further, the judging the type of the current page by the trained classification model specifically includes: the method comprises the steps of performing binarization on interface element information acquired by page information, storing the interface element information into a one-dimensional array as model input data, inputting the model input data into a classification model to generate a new one-dimensional array, performing subtraction difference value combination calculation on the one-dimensional array of the input data and the new one-dimensional array, and judging that a current page belongs to a type page in the classification model if the value is less than 1; otherwise, the next classification model is circularly used for generating and combining the arrays.
The invention is further illustrated below with reference to a specific embodiment:
the invention relates to a test method of a dynamic page, which comprises the following steps:
1.1 acquiring all element information (layout, control name, text, picture information and the like) of the page through an airtest automated testing frame. And binarizing all element information and storing the element information into a one-dimensional array to be used as model input data.
And 1.2, inputting the one-dimensional array obtained in the step 1.1 into a classification model to generate a new one-dimensional array. And (4) performing subtraction difference value combination calculation on the new array and the old array (namely performing the difference value combination calculation after the subtraction), and if the value is less than 1, judging that the current page belongs to the page of the type. Otherwise, the next classification model is circularly used for generating the array and carrying out the combination calculation. (if the difference between the array information of one page element and the new number generated by the chat page classification model is less than 1, the page is judged to belong to the chat page); judging the type of the current page through the trained classification model, (the type of the page comprises a part prefabricated in a system such as an IM type, a microblog type, a video site type and the like, and a user can add new classification in an inheritance way after using the page for multiple times)
1.3 giving predefined optimal combination operation to the page controls one by one according to the page classification result (the predefined combination belongs to basic operation events manually defined in advance, the control types are classified in advance according to the page types and then stored in a database, namely the page controls all correspond to the corresponding combination operation). Such as: a sending button and a text input window of the IM page automatically give a script combination of 'inputting XXX chat content + clicking sending button' and a corresponding 'verification script of XXX information should appear in the chat window', and if the button gives a click and a sliding bar gives a slide. The classification model adds corresponding check content to the operation according to the control attribute and the page type judgment result (for example, whether the text appears on the page after the text box check input is finished, if the text appears on the page, the button type and the skip type are added, the page skip judgment is added, and the picture type is subjected to grammar association check with the context text through image content identification.)
1.4, testing the verification content of the page (namely, after the verification content is added in 1.3, judging whether the operation corresponding to each page type is the corresponding verification content when testing is carried out), and outputting a test result;
1.5 in addition, the invention can continuously adjust and make the test result fit the tested product by the expected modification mode of each control of the test result condition by the user after 1.5 links.
Fig. 2 is a schematic flow chart illustrating a classification model training method according to an embodiment of the present invention.
2.1 acquiring all element information (layout, control names, texts, picture information and the like) of a plurality of pages of the same type through an airtest automated testing framework. And storing the binary data into different one-dimensional arrays respectively to serve as training data (if a chat page model is adopted, page information of a 99u chat page, a QQ chat page and a WeChat chat page is collected).
And 2.2, taking the data of one page as data reference, such as WeChat page, as model input data, and taking the data of the rest pages as output data.
2.3, creating a two-layer forward neural network by using a pytorech (deep learning framework) to train a model, wherein a Loss function is Cross Entrophy, and an optimization function is Stochastic Gradient Description.
2.4 the model is trained so that the LOSS value approaches zero, and the current model is approximately 1.1236619684495963 e-05. And reserving the model as a corresponding page model.
2.5, different types of pages are selected, and the steps of 2.1-2.4 are repeated to obtain models of the different pages.
As shown in fig. 3, the present invention provides a test system for a dynamic page, which includes an acquisition module, an operation adding module, a verification content adding module, and a test module;
the acquisition module is used for acquiring the page information dynamically generated each time to acquire interface element information; the interface element information includes layout, controls, text, pictures, stack, and hierarchy.
The operation adding module is used for judging the type of the current page through the trained classification model and giving corresponding predefined operations to each page control one by one through the classification model;
the verification content adding module is used for adding corresponding verification content to the predefined operation through the classification model;
the test module is used for testing the verification content of the page and outputting a test result.
The test system further comprises: after each round of test execution is finished, the script generated by each control is modified in a manual modification mode, so that the subsequently generated script is more suitable for the current tested product.
The training mode of the trained classification model is as follows: acquiring all element information of a plurality of pages of the same type through an airtest automatic testing framework, and storing the element information into different one-dimensional arrays respectively as training data after binarization; taking the data of one page as a data reference, and taking the data of the rest pages of the plurality of pages of the same type as output data; creating two layers of forward neural networks by using a deep learning framework pytore, and carrying out model training, wherein a Loss function of the model training is Cross entropy Cross Encopy; and training the model to enable the Loss value to approach zero, and reserving the model as a classification model of the corresponding page.
Further, the judging the type of the current page by the trained classification model specifically includes: the method comprises the steps of performing binarization on interface element information acquired by page information, storing the interface element information into a one-dimensional array as model input data, inputting the model input data into a classification model to generate a new one-dimensional array, performing subtraction difference value combination calculation on the one-dimensional array of the input data and the new one-dimensional array, and judging that a current page belongs to a type page in the classification model if the value is less than 1; otherwise, the next classification model is circularly used for generating and combining the array (if the array information of one page element is combined with the new number generated by the chat page classification model and the difference value is less than 1, the page is judged to belong to the chat page).
In a word, the method collects the page information dynamically generated each time, judges the type of the current page through the trained classification model, estimates the expectation of interaction of each control, generates a corresponding operation instruction and verifies the execution result. And finally outputting the test result and the script data generated this time. Meanwhile, after each round of test execution is finished, whether the generated script is correct or not can be revised in a manual modification mode, so that the script generated by the system is closer to the current tested product.
The above description is only a preferred embodiment of the present invention, and all equivalent changes and modifications made in accordance with the claims of the present invention should be covered by the present invention.

Claims (10)

1. A method for testing a dynamic page is characterized in that: the method comprises the following steps:
s1, acquiring the dynamically generated page information each time to obtain interface element information;
step S2, judging the type of the current page through the trained classification model, and giving corresponding predefined operation to each page control one by one through the classification model;
step S3, adding corresponding verification content to the predefined operation through the classification model;
and step S4, testing the verification content of the page and outputting a test result.
2. The method for testing a dynamic page according to claim 1, wherein: the interface element information includes layout, controls, text, pictures, stack, and hierarchy.
3. The method for testing a dynamic page according to claim 1, wherein: the test method further comprises the following steps: after each round of test execution is finished, the script generated by each control is modified in a manual modification mode, so that the subsequently generated script is more suitable for the current tested product.
4. The method for testing a dynamic page according to claim 1, wherein: the training mode of the trained classification model is as follows: acquiring all element information of a plurality of pages of the same type through an airtest automatic testing framework, and storing the element information into different one-dimensional arrays respectively as training data after binarization; taking the data of one page as a data reference, and taking the data of the rest pages of the plurality of pages of the same type as output data; creating two layers of forward neural networks by using a deep learning framework pytore, and carrying out model training, wherein a Loss function of the model training is Cross Entrophy; and training the model to enable the Loss value to approach zero, and reserving the model as a classification model of the corresponding page.
5. The method for testing a dynamic page according to claim 4, wherein: the method for judging the type of the current page through the trained classification model specifically comprises the following steps: the method comprises the steps of performing binarization on interface element information acquired by page information, storing the interface element information into a one-dimensional array as model input data, inputting the model input data into a classification model to generate a new one-dimensional array, performing subtraction difference value combination calculation on the one-dimensional array of the input data and the new one-dimensional array, and judging that a current page belongs to a type page in the classification model if the value is less than 1; otherwise, the next classification model is circularly used for generating and combining the arrays.
6. A test system for dynamic pages, comprising: the system comprises an acquisition module, an operation adding module, a verification content adding module and a test module;
the acquisition module is used for acquiring the page information dynamically generated each time to acquire interface element information;
the operation adding module is used for judging the type of the current page through the trained classification model and giving corresponding predefined operations to each page control one by one through the classification model;
the verification content adding module is used for adding corresponding verification content to the predefined operation through the classification model;
the test module is used for testing the verification content of the page and outputting a test result.
7. The system for testing dynamic pages of claim 6, wherein: the interface element information includes layout, controls, text, pictures, stack, and hierarchy.
8. The system for testing dynamic pages of claim 6, wherein: the test system further comprises: after each round of test execution is finished, the script generated by each control is modified in a manual modification mode, so that the subsequently generated script is more suitable for the current tested product.
9. The system for testing dynamic pages of claim 6, wherein: the training mode of the trained classification model is as follows: acquiring all element information of a plurality of pages of the same type through an airtest automatic testing framework, and storing the element information into different one-dimensional arrays respectively as training data after binarization; taking the data of one page as a data reference, and taking the data of the rest pages of the plurality of pages of the same type as output data; creating two layers of forward neural networks by using a deep learning framework pytore, and carrying out model training, wherein a Loss function of the model training is Cross Entrophy; and training the model to enable the Loss value to approach zero, and reserving the model as a classification model of the corresponding page.
10. The system for testing a dynamic page of claim 9, wherein: the method for judging the type of the current page through the trained classification model specifically comprises the following steps: the method comprises the steps of performing binarization on interface element information acquired by page information, storing the interface element information into a one-dimensional array as model input data, inputting the model input data into a classification model to generate a new one-dimensional array, performing subtraction difference value combination calculation on the one-dimensional array of the input data and the new one-dimensional array, and judging that a current page belongs to a type page in the classification model if the value is less than 1; otherwise, the next classification model is circularly used for generating and combining the arrays.
CN202011071881.8A 2020-10-09 2020-10-09 Dynamic page testing method and system Pending CN114328169A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011071881.8A CN114328169A (en) 2020-10-09 2020-10-09 Dynamic page testing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011071881.8A CN114328169A (en) 2020-10-09 2020-10-09 Dynamic page testing method and system

Publications (1)

Publication Number Publication Date
CN114328169A true CN114328169A (en) 2022-04-12

Family

ID=81031941

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011071881.8A Pending CN114328169A (en) 2020-10-09 2020-10-09 Dynamic page testing method and system

Country Status (1)

Country Link
CN (1) CN114328169A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116244161A (en) * 2023-05-12 2023-06-09 山东齐鲁壹点传媒有限公司 Data acquisition method based on depth simulation operation

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116244161A (en) * 2023-05-12 2023-06-09 山东齐鲁壹点传媒有限公司 Data acquisition method based on depth simulation operation
CN116244161B (en) * 2023-05-12 2023-08-11 山东齐鲁壹点传媒有限公司 Data acquisition method based on depth simulation operation

Similar Documents

Publication Publication Date Title
CN111182162B (en) Telephone quality inspection method, device, equipment and storage medium based on artificial intelligence
CN1664810A (en) Assisted form filling
CN111611488B (en) Information recommendation method and device based on artificial intelligence and electronic equipment
CN112882974A (en) JSON data conversion method and device, computer equipment and storage medium
CN111444677A (en) Reading model optimization method, device, equipment and medium based on big data
CN112799782B (en) Model generation system, method, electronic device and storage medium
CN112149352B (en) Prediction method for marketing activity clicking by combining GBDT automatic characteristic engineering
CN111797320A (en) Data processing method, device, equipment and storage medium
Lopes et al. Evaluating HCI Design with Interaction Modeling and Mockups-A Case Study
CN103440199A (en) Method and device for guiding test
CN112527676A (en) Model automation test method, device and storage medium
CN115438984A (en) AI-based big data processing method and server
CN111814759A (en) Method and device for acquiring face quality label value, server and storage medium
CN111552796A (en) Volume assembling method, electronic device and computer readable medium
CN114328169A (en) Dynamic page testing method and system
CN113778864A (en) Test case generation method and device, electronic equipment and storage medium
CN112416800A (en) Intelligent contract testing method, device, equipment and storage medium
Perkins et al. Practical Data Science for Actuarial Tasks
CN111859074A (en) Internet public opinion information source influence assessment method and system based on deep learning
Wiesweg et al. Data-driven risk management for requirements engineering: An automated approach based on Bayesian networks
CN115017362A (en) Data processing method, electronic device and storage medium
do Amaral et al. Attribute selection with filter and wrapper: an application on incident management process
Bald et al. spatialMaxent: Adapting species distribution modeling to spatial data
CN107392415B (en) Telecommunication salesman portrait information processing method and device based on big data
KR20200021132A (en) Method for Processing Prediction by using Artificial Intelligence

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