CN108235761A - The method and device of automatic detection control - Google Patents

The method and device of automatic detection control Download PDF

Info

Publication number
CN108235761A
CN108235761A CN201780002429.6A CN201780002429A CN108235761A CN 108235761 A CN108235761 A CN 108235761A CN 201780002429 A CN201780002429 A CN 201780002429A CN 108235761 A CN108235761 A CN 108235761A
Authority
CN
China
Prior art keywords
common controls
common
maximum length
prompt message
address
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
CN201780002429.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.)
Shenzhen ZTE Netview Technology Co Ltd
Shenzhen ZNV Technology Co Ltd
Original Assignee
Shenzhen ZTE Netview Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen ZTE Netview Technology Co Ltd filed Critical Shenzhen ZTE Netview Technology Co Ltd
Publication of CN108235761A publication Critical patent/CN108235761A/en
Pending legal-status Critical Current

Links

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present invention provides a kind of method and device of automatic detection control, belongs to the detection field of Web automatic test common controls.This method includes:Classify to the type of the common controls of examining system;Common test point and common parameters of the extraction per class common controls;According to the test point and parameter of extraction, the test script of all kinds of common controls is write;When carrying out use-case test to first kind common controls, call the test script of first kind common controls and parameter is passed to according to the self-demand of first kind common controls;First kind common controls detect Testcase execution and output result.The method and device of automatic detection control proposed by the present invention realizes control properties detection and interface layout, improve the preciseness and convenience of test control detection, upper strata use-case, which calls, to be more convenient, and maintenance gets up to be also easier to, and improves the working efficiency and maintenance cost of automatic test.

Description

The method and device of automatic detection control
Technical field
Detection field more particularly to a kind of automatic detection control the present invention relates to Web automatic test common controls Method and device.
Background technology
In the automatic test at interface, control properties detection is a necessary detection, common are text input Frame, Password Input frame, numerical value input frame, mobile phone input frame, mail input frame etc..And the point detected, usually spcial character It checks, such as longest character check, if must fill out, boundary value inspection etc..According to the difference of control type, emphasis is different.Now Common way is, by taking a Text Entry as an example, when writing test case, maximum length inspection, can set one is more than The character string that text frame limits checks;Spcial character inputs several spcial character inspections;Boundary value inspection, maximum length Subtract one, maximum length, maximum length adds one;Whether must fill out;Half-angle double byte character whether is supported to convert.
However, for examining system, all Text Entries are required for carrying out these detections repeated, cause much to use Example process compares redundancy, and the character string or Chinese character detected is all fixed, is unfavorable for the preciseness of detection.
In the prior art, also a kind of way is:The point of detection with use-case is separated, is packaged into different feet This.Spcial character checks script, longest character check script, bounds checking script etc..It is called respectively again according to the characteristic of control Different script combinations.And this method, the point of inspection cannot whole this features comprising whole system control, be mainly reflected in The form and suggestion content of prompting are difficult to ensure that consistency.Position as prompted in popping up, some are being controlled in the right of control, some The lower section of part is shown in the form of prompted dialog frame.The content information of prompting is also easily formed fuzzy general.Separately Outside, using this method, also there are a point defects:Control, which writes use-case, can have calling omission when these is called to check script Place.
Invention content
It is a primary object of the present invention to propose a kind of method and device of automatic detection control, use-case is facilitated directly to adjust With, make control detection and business preferably detach, and then improve test control detection preciseness and convenience.
To achieve the above object, the present invention provides a kind of method of automatic detection control, the method includes:To system to be measured The type of the common controls of system is classified;Common test point and common parameters of the extraction per class common controls;According to extraction Test point and parameter write the test script of all kinds of common controls;When carrying out use-case test to first kind common controls, call The test script of the first kind common controls is simultaneously passed to parameter according to the self-demand of the first kind common controls;Described A kind of common controls detection Testcase execution and output result.
Optionally, the common controls include Text Entry, the test script for writing all kinds of common controls, packet It includes:It detects and enters information into input frame;Focus is moved to except the input frame;When the content according to described information When judgement has prompt message, then obtain the prompt message and carry out fuzzy matching.
Optionally, the common controls include Text Entry, and the test point of the Text Entry is long including boundary Degree detection, the test script for writing all kinds of common controls, including:It is corresponding in the system page to search the common controls Address;It detects and the character string that maximum length subtracts one is input in described address;The character for subtracting one according to the maximum length The content of string judges whether there is prompt message, if so, abnormal and log information is thrown, if it is not, then detecting most to greatly enhance The character string of degree is input in described address;Prompt message is judged whether there is according to the content of the character string of the maximum length, If so, throwing abnormal and log information, one character string is added to be input to described address maximum length if it is not, then detecting In;The content of one character string is added to judge whether there is prompt message according to the maximum length, if so, obtaining the prompting letter Breath carries out fuzzy matching.
Optionally, it is described detect by the character string that maximum length subtracts one be input in described address after or The character string of maximum length is input in described address later or maximum length is added one detecting by described detect After character string is input in described address, the method further includes:Focus is moved to except the input frame.
Optionally, it is described to judge whether there is prompt message, including:Search address corresponding with the common controls;According to Described address searches the corresponding prompting address of prompt message;Judge whether Web page the prompting address occurs.
Optionally, the type of the common controls to examining system is classified, including:It is treated using selenium acquisitions The property value of the common controls of examining system, and classify to its type.
Optionally, it is described to judge whether Web page the prompting address occurs, including:Described in being searched using selenium First kind common controls whether in Web page there are corresponding addresses.
In addition, to achieve the above object, the present invention also provides a kind of device of automatic detection control, described device includes: Sort module is set as classifying to the type of the common controls of examining system;Extraction module is set as extracting every class general The common test point and common parameters of control;Module is write, is set as test point and parameter according to extraction, is write all kinds of general The test script of control;Calling module is set as, when carrying out use-case test to first kind common controls, calling the first kind The test script of common controls is simultaneously passed to parameter according to the self-demand of the first kind common controls;Execution module is set as Make the first kind common controls detection Testcase execution and output result.
Optionally, the common controls include Text Entry, and the module of writing includes:Detection module is set as examining It measures and enters information into input frame;Mobile unit is set as focus being moved to except the input frame;Judging unit, It is set as judging whether there is prompt message according to the content of described information;Acquiring unit, be set as when the judging unit according to When the content judgement of described information has prompt message, then obtain the prompt message and carry out fuzzy matching.
Optionally, the common controls include Text Entry, and the test point of the Text Entry is long including boundary Degree detection, the module of writing include:Searching unit is set as searching the common controls in the system page correspondingly Location;Detection unit, is set as detecting the character string that maximum length subtracts one is input in described address;Judging unit, setting The content of character string to subtract one according to the maximum length judges whether there is prompt message, if so, throwing abnormal and daily record note Information is recorded, if it is not, then detection trigger unit detects the character string of maximum length is input in described address;It is described to judge list Member is also configured to judge whether there is prompt message according to the content of the character string of the maximum length, if so, throwing abnormal and day Will records information, if it is not, then detection trigger unit detects and one character string added to be input in described address maximum length;Institute Judging unit is stated, is also configured to one content of character string be added to judge whether there is prompt message according to the maximum length, if so, Then trigger acquiring unit;The acquiring unit is set as obtaining the prompt message progress fuzzy matching.
Optionally, described device further includes:Mobile unit is set as focus being moved to except the input frame.
Optionally, the judging unit is specifically configured to:Search address corresponding with the common controls;According to described The corresponding prompting address of prompt message is searched in location;Judge whether Web page the prompting address occurs.
Optionally, the sort module, the attribute of the common controls specifically for using selenium acquisition examining systems Value, and classify to its type.
Optionally, the judgment module, specifically for using selenium search the first kind common controls whether There are corresponding addresses in Web page.
The method and device of automatic detection control proposed by the present invention, by the types of the common controls to examining system into Row classification, extracts the common test point and common parameters per class common controls, according to the test point and parameter of extraction, writes all kinds of The test script of common controls when carrying out use-case test to first kind common controls, calls the first kind common controls Test script is simultaneously passed to parameter according to the self-demand of the first kind common controls so that the use-case test can perform automatically and Export result.The situation of same type of control pop-up prompting is identical, and the content of prompting is similar, and the test point of judgement also seals together In test script.In this way when carrying out use-case test, it is only necessary to call the test script of such control, be passed to the use-case and survey The type control corresponding actual parameter during examination.It realizes control properties detection and interface layout, operation flow is separated from Come, improve the preciseness and convenience of test control detection, use-case calling in upper strata is more convenient, and maintenance gets up to be also easier to, and improves The working efficiency and maintenance cost of automatic test.
Description of the drawings
Fig. 1 is the flow diagram of the method for automatic detection control that present pre-ferred embodiments provide;
Fig. 2 is the sub-process schematic diagram of the method for automatic detection control that present pre-ferred embodiments provide;
Fig. 3 is the schematic diagram of the display reminding information in certain system;
Fig. 4 is another sub-process schematic diagram of the method for automatic detection control that present pre-ferred embodiments provide;
Fig. 5 is another sub-process schematic diagram of the method for automatic detection control that present pre-ferred embodiments provide;
Fig. 6 is the module diagram of the device of automatic detection control that present pre-ferred embodiments provide;
Fig. 7 is the module diagram that module is write in Fig. 6;
Fig. 8 is the module diagram that module is write in Fig. 6.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
The embodiment of the present invention is described below in detail, the example of the embodiment is shown in the drawings, wherein from beginning to end Same or similar label represents same or similar element or the element with same or like function.Below with reference to attached The embodiment of figure description is exemplary, it is intended to is set as explaining the present invention, and is not considered as limiting the invention.
Fig. 1 is please referred to, it is described for the flow diagram of the method for automatic detection control that present pre-ferred embodiments provide Method includes step:
Step 110, classify to the type of the common controls of examining system.
Specifically, classification of the function of Main Basiss control to common controls type, in a manner of prompting and content etc. into Row divides.In the present embodiment, the classification of common controls type includes:Text Entry, Password Input frame, numerical value input frame, Mobile phone input frame, selection of time frame etc..
In the present embodiment, examining system refers to Web page to be tested.
Step 120, the common test point and common parameters per class common controls are extracted.
Specifically, the detailed test point per class common controls is extracted, and extracts its common parameters.
The test point of all kinds of common controls is different.Now by common controls for for Text Entry.The inspection of Text Entry Measuring point includes:Boundary length detection, space detection, normal input detection, must fill out detection and full-shape half at spcial character detection It detects at angle.Wherein, boundary length detection refer to for the maximum length that the input frame limits for, input maximum length subtract one, Maximum length and maximum length add one random string, and without prompt message, maximum length adds for the moment first two, carries Show, whether prompt message is consistent with reality.Spcial character detection refers to the several spcial characters provided by examining system demand, Each spcial character inputs together with random string, if has the information of prompting spcial character.Space detection refers to input word There is space before and after symbol string, if automatic fitration space.Normal input refers to that input is normal, no prompt message.Detection must be filled out to refer to It must fill out, which does not input, and whether prompt message is correct.The switching of half-angle full-shape refers to the number of characters of full-shape input Word, if normal conversion is the situation under half-angle.
The parameter of common controls is to embody the different numerical value of similar control.It, generally can be with for example, the general parameter of text box Setting four:Whether the path of text box, maximum input length must fill out and minimum input length.Wherein, the road of text box Diameter refers to the address of text frame corresponding page.Minimum input length is generally defaulted as 0.
Illustratively, if common controls are positive integer input frame, including for its common parameter is extracted:Input frame corresponding page Address, maximum input positive and minimum input positive.Herein, minimum input positive integer is defaulted as 1.
Step 130, according to the test point of extraction and parameter, the test script of all kinds of common controls is write.
Specifically, test script needs the function, the performance that are related to each test point in compiling procedure.
Step 140, when carrying out use-case test to first kind common controls, the test of the first kind common controls is called Script is simultaneously passed to parameter according to the self-demand of the first kind common controls.
Specifically, when testing first kind common controls, the test script of first kind common controls is called, and will The own actual situation of first kind common controls is passed to parameter.By taking one inputs the text box of name as an example, maximum length is limited It is 50, then when corresponding to the test case of this input box type, the address of text frame and limitation maximum length 50 need to be passed to.
Step 150, the first kind common controls detection Testcase execution and output result.
Specifically, after use-case automatic running, the general status of all controls detections is known that according to the result of operation.Fortune The use-case of row failure, the reason of accurately being positioned unsuccessfully by daily record.
Fig. 2 is please referred to, by taking common controls are Text Entry as an example, the test script for writing all kinds of common controls, Include the following steps:
Step 210, it detects and enters information into input frame.
Step 220, focus is moved to except the input frame.
Specifically, operation of the response operator to mouse, except moving focal point to input frame.
Step 230, prompt message is judged whether there is according to the content of described information, if so, entering step 240.
Specifically, the situation of the information to input frame is actually entered by matching, it is whether consistent with actual parameter situation, And then judge whether prompt message occur, to judge that can the control by the test point.That is, only when the letter of input When breath and inconsistent actual parameter, it just will appear prompt message.
As shown in figure 3, the schematic diagram for the display reminding information in certain system.In figure 3, when the input in amount of assets Input " a " in frame, and when the focus of mouse is moved to except input frame, generate prompt message " positive number invalid * ", prompting letter Breath is shown in the lower section of input frame.
Step 240, it obtains the prompt message and carries out fuzzy matching.
Fig. 4 is please referred to, it is described to write all kinds of general controls by taking common controls is the boundary length detections of Text Entry as an example The test script of part, includes the following steps:
Step 410, the common controls corresponding address in the system page is searched.
Step 420, it detects and the character string that maximum length subtracts one is input in described address.
Step 430, focus is moved to except input frame.
Step 440, the content for the character string for subtracting one according to the maximum length judges whether there is prompt message, if so, Enter step 450;If it is not, then enter step 460.
Step 450, abnormal and log information is thrown.
It should be noted that when the throwing exception of test point, subsequent detection point continues to perform corresponding operation.
Step 460, it detects and the character string of maximum length is input in described address.
Step 470, focus is moved to except the input frame.
Step 480, prompt message is judged whether there is according to the content of the character string of the maximum length, if so, into Step 450;If it is not, then enter step 490.
Step 490, it detects and one character string is added to be input in described address maximum length.
Step 500, focus is moved to except the input frame.
Step 510, the content of one character string is added to judge whether there is prompt message according to the maximum length, if so, Enter step 520.
Step 520, it obtains the prompt message and carries out fuzzy matching.
For example, work as the string content of input (such as:12) more than maximum length (such as:10) when, prompt message is at most not It, can be using fuzzy matching as numerical value corresponding no more than with maximum length (10 characters) more than how many character (10 character).
Further, each common controls are in web front end HTML (hypertext markup language, HyperText Markup Language all there are one corresponding identifier in) showing, i.e., the address for representing symbol with this to represent the control.Prompt message occurs When in the page also there are one corresponding location information, generally all have opposite logical relationship with control identifier-location.
In the present embodiment, Web automatic tests have used basic operations of the selenium to webpage control, selenium Each property value of control is obtained by page identifier, and is classified to it, and passes through page automatic decision prompt message to be No appearance and the textual value of prompt message.When control loses focus, the appearance of prompt message could be excited.Focus is lost, It is the location information of the page, the point for subtracting one by mouse click location information where obtaining control by means of selenium so that The common controls lose focus.
Fig. 5 is please referred to, to judge whether there is the flow diagram of prompt message in step 410,480,510, is specifically included Following steps:
Step 610, address corresponding with common controls is searched.
Step 620, according to described address, the corresponding prompting address of prompt message is searched.
Step 630, judge whether Web page the prompting address occurs.
Specifically, using selenium search the first kind common controls whether in Web page there are corresponding Location.
Further, when judging that the prompting address occurs in Web page, then the corresponding prompting in the prompting address is obtained Information.
The method of automatic detection control that the present embodiment proposes, is divided by the type of the common controls to examining system Class is extracted common test point and common parameters per class common controls, according to the test point and parameter of extraction, is write all kinds of general The test script of control when carrying out use-case test to first kind common controls, calls the test of the first kind common controls Script is simultaneously passed to parameter according to the self-demand of the first kind common controls so that use-case test can be performed and be exported automatically As a result.The situation of same type of control pop-up prompting is identical, and the content of prompting is similar, and the test point of judgement is also encapsulated in together In test script.In this way when carrying out use-case test, it is only necessary to the test script of such control is called, when being passed to use-case test The corresponding actual parameter of the type control.Control properties detection and interface layout are realized, operation flow, which is separated from, to be come, and is carried The preciseness and convenience of height test control detection, upper strata use-case, which calls, to be more convenient, and maintenance gets up to be also easier to, and is improved automatic Change the working efficiency and maintenance cost of test.
Fig. 6 is please referred to, another preferred embodiment of the present invention additionally provides a kind of device of automatic detection control, the device packet It includes:
Sort module 710 is set as classifying to the type of the common controls of examining system.
Specifically, classification of the function of 710 Main Basiss control of sort module to common controls type, in a manner of prompting It is divided with content etc..In the present embodiment, the classification of common controls type includes:Text Entry, Password Input frame, number It is worth input frame, mobile phone input frame, selection of time frame etc..Sort module, specifically for selenium is used to obtain examining system The property value of common controls, and classify to its type.
Extraction module 720 is set as extracting the common test point and common parameters of every class common controls.
Specifically, extraction module 720 extracts the detailed test point of every class common controls, and extracts its common parameters.
The test point of all kinds of common controls is different.Now by common controls for for Text Entry.The inspection of Text Entry Measuring point includes:Boundary length detection, space detection, normal input detection, must fill out detection and full-shape half at spcial character detection It detects at angle.Wherein, boundary length detection refer to for the maximum length that the input frame limits for, input maximum length subtract one, Maximum length and maximum length add one random string, and without prompt message, maximum length adds for the moment first two, carries Show, whether prompt message is consistent with reality.Spcial character detection refers to the several spcial characters provided by examining system demand, Each spcial character inputs together with random string, if has the information of prompting spcial character.Space detection refers to input word There is space before and after symbol string, if automatic fitration space.Normal input refers to that input is normal, no prompt message.Detection must be filled out to refer to It must fill out, which does not input, and whether prompt message is correct.The switching of half-angle full-shape refers to the number of characters of full-shape input Word, if normal conversion is the situation under half-angle.
The parameter of common controls is to embody the different numerical value of similar control.It, generally can be with for example, the general parameter of text box Setting four:Whether the path of text box, maximum input length must fill out and minimum input length.Wherein, the road of text box Diameter refers to the address of text frame corresponding page.Minimum input length is generally defaulted as 0.
Illustratively, if common controls are positive integer input frame, including for its common parameter is extracted:Input frame corresponding page Address, maximum input positive and minimum input positive.Herein, minimum input positive integer is defaulted as 1.
Module 730 is write, is set as test point and parameter according to extraction, writes the test script of all kinds of common controls.
Specifically, test script needs the function, the performance that are related to each test point in compiling procedure.
Calling module 740 is set as, when carrying out use-case test to first kind common controls, calling the first kind general The test script of control is simultaneously passed to parameter according to the self-demand of the first kind common controls.
Specifically, when testing first kind common controls, calling module 740 calls the survey of first kind common controls Training sheet, and the own actual situation of first kind common controls is passed to parameter.By taking one inputs the text box of name as an example, limit Maximum length processed is 50, then when corresponding to the test case of this input box type, need to be passed to the address of text frame and limit most Long length 50.
Execution module 750 is set as making the first kind common controls detection Testcase execution and output result.
Specifically, after use-case automatic running, the general status of all controls detections is known that according to the result of operation.Fortune The use-case of row failure, the reason of accurately being positioned unsuccessfully by daily record.
In a preferred embodiment, by common controls for Text Entry, to please refer to Fig. 7, writing module 730 and wrap It includes:
Detection unit 810, is set as detecting and enters information into input frame.
Mobile unit 820 is set as focus being moved to except the input frame.
Specifically, mobile unit 820 responds operation of the operator to mouse, except moving focal point to input frame.
Judging unit 830 is set as judging whether there is prompt message according to the content of described information, if so, triggering obtains Take unit 840.
Specifically, judging unit 830 actually enters the situation of the information to input frame by matching, with actual parameter feelings Whether condition is consistent, and then judges whether prompt message occur, to judge that can the control by the test point.That is, only Have when the information of input is inconsistent with actual parameter, just will appear prompt message.
As shown in figure 3, the schematic diagram for the display reminding information in certain system.In figure 3, when the input in amount of assets Input " a " in frame, and when the focus of mouse is moved to except input frame, generate prompt message " positive number invalid * ", prompting letter Breath is shown in the lower section of input frame.
Acquiring unit 840 is set as obtaining the prompt message progress fuzzy matching.
In a further preferred embodiment, by taking common controls is the boundary length detections of Text Entry as an example, figure is please referred to 8, the module 730 of writing includes:
Searching unit 910 is set as searching the common controls corresponding address in the system page.
Detection unit 920, is set as detecting the character string that maximum length subtracts one is input in described address.
Mobile unit 930 is set as focus being moved to except input frame.
Judging unit 940, the content for being set as the character string for subtracting one according to the maximum length judge whether there is prompting letter Breath, if so, throwing abnormal and log information;If it is not, then detection trigger unit 920 is detected the word of maximum length again Symbol string is input in described address.
It should be noted that when the throwing exception of test point, subsequent detection point continues to perform corresponding operation.
The judging unit 940 is also configured to judge whether there is prompting letter according to the content of the character string of the maximum length Breath, if so, throwing abnormal and log information;If it is not, then detection trigger unit 920 detects maximum length adding one again Character string be input in described address.
The judging unit 940 is also configured to one content of character string be added to judge whether there is and carry according to the maximum length Show information, if so, triggering acquiring unit 950.
Acquiring unit 950 is set as obtaining the prompt message progress fuzzy matching.
For example, work as the string content of input (such as:12) more than maximum length (such as:10) when, prompt message is at most not It, can be using fuzzy matching as numerical value corresponding no more than with maximum length (10 characters) more than how many character (10 character).
Further, each common controls are represented there are one corresponding identifier in web front end HTML is shown with this Accord with the address to represent the control.In the page also there are one corresponding location information when prompt message occurs, generally all with control Identifier-location has opposite logical relationship.
In the present embodiment, Web automatic tests have used basic operations of the selenium to webpage control, selenium Each property value of control is obtained by page identifier, and is classified to it, and passes through page automatic decision prompt message to be No appearance and the textual value of prompt message.When control loses focus, the appearance of prompt message could be excited.Focus is lost, It is the location information of the page, the point for subtracting one by mouse click location information where obtaining control by means of selenium so that The common controls lose focus.
Further, the course of work of judgment module 830 or judgment module 940 includes:
Step 1:Search address corresponding with common controls.
Step 2:According to described address, the corresponding prompting address of prompt message is searched.
Step 3:Judge whether Web page the prompting address occurs.When judging that the prompting address occurs in Web page When, then obtain the corresponding prompt message in the prompting address.
Specifically, judgment module 830 or judgment module 940, specifically for searching the first kind using selenium Common controls whether in Web page there are corresponding addresses.
The device of automatic detection control that the present embodiment proposes, by sort module 710 to the common controls of examining system Type classify, extraction module 720 extracts the common test point and common parameters of every class common controls, writes module 730 According to the test point and parameter of extraction, the test script of all kinds of common controls is write, use-case is being carried out to first kind common controls During test, calling module 740 calls the test script of the first kind common controls and according to the first kind common controls Self-demand is passed to parameter so that use-case test can perform and export automatically result.Same type of control pop-up prompting Situation is identical, and the content of prompting is similar, and the test point of judgement is also encapsulated in test script together.Carrying out use-case test in this way When, it is only necessary to the test script of such control is called, the type control corresponding actual parameter when being passed to use-case test. Control properties detection and interface layout are realized, operation flow, which is separated from, to be come, and improves the preciseness and facility of test control detection Property, upper strata use-case, which calls, to be more convenient, and maintenance gets up to be also easier to, and improves the working efficiency and maintenance cost of automatic test.
It should be noted that herein, term " comprising " or its any other variant are intended to nonexcludability Comprising so that process, method, article or device including a series of elements are not only including those elements, but also wrap Include other elements that are not explicitly listed or further include for this process, method, article or device it is intrinsic will Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including the element Process, method, also there are other identical elements in article or device.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on such understanding, technical scheme of the present invention substantially in other words does the prior art Going out the part of contribution can be embodied in the form of software product, which is stored in a storage medium In (such as ROM/RAM, magnetic disc, CD), used including some instructions so that a station terminal equipment (can be mobile phone, computer takes Be engaged in device, air conditioner or the network equipment etc.) perform method described in each embodiment of the present invention.
It these are only the preferred embodiment of the present invention, be not intended to limit the scope of the invention, it is every to utilize this hair The equivalent structure or equivalent flow shift that bright specification and accompanying drawing content are made directly or indirectly is used in other relevant skills Art field, is included within the scope of the present invention.
Industrial applicibility
The method and device of automatic detection control proposed by the present invention, by the types of the common controls to examining system into Row classification, extracts the common test point and common parameters per class common controls, according to the test point and parameter of extraction, writes all kinds of The test script of common controls when carrying out use-case test to first kind common controls, calls the first kind common controls Test script is simultaneously passed to parameter according to the self-demand of the first kind common controls so that the use-case test can perform automatically and Export result.The situation of same type of control pop-up prompting is identical, and the content of prompting is similar, and the test point of judgement also seals together In test script.In this way when carrying out use-case test, it is only necessary to call the test script of such control, be passed to the use-case and survey The type control corresponding actual parameter during examination.It realizes control properties detection and interface layout, operation flow is separated from Come, improve the preciseness and convenience of test control detection, use-case calling in upper strata is more convenient, and maintenance gets up to be also easier to, and improves The working efficiency and maintenance cost of automatic test.Therefore, it is industrially applicable.

Claims (14)

1. a kind of method of automatic detection control, the method includes:
Classify to the type of the common controls of examining system;
Common test point and common parameters of the extraction per class common controls;
According to the test point and parameter of extraction, the test script of all kinds of common controls is write;
When carrying out use-case test to first kind common controls, the test script of the first kind common controls is called and according to institute The self-demand for stating first kind common controls is passed to parameter;
The first kind common controls detection Testcase execution and output result.
2. the method for automatic detection control according to claim 1, wherein, the common controls include Text Entry, The test script for writing all kinds of common controls, including:
It detects and enters information into input frame;
Focus is moved to except the input frame;
When having prompt message according to the judgement of the content of described information, then obtain the prompt message and carry out fuzzy matching.
3. the method for automatic detection control according to claim 1, wherein, the common controls include Text Entry, The test point of the Text Entry is detected including boundary length, the test script for writing all kinds of common controls, including:
Search the common controls corresponding address in the system page;
It detects and the character string that maximum length subtracts one is input in described address;
The content for the character string for subtracting one according to the maximum length judges whether there is prompt message, if so, throwing abnormal and daily record Information is recorded, the character string of maximum length is input in described address if it is not, then detecting;
Prompt message is judged whether there is according to the content of the character string of the maximum length, if so, throwing abnormal and log recording Maximum length is added one character string to be input in described address by information if it is not, then detecting;
The content of one character string is added to judge whether there is prompt message according to the maximum length, if so, obtaining the prompting Information carries out fuzzy matching.
4. the method for automatic detection control according to claim 3, wherein, detect what maximum length was subtracted one described The character string of maximum length is input in described address after character string is input in described address or in described detect Later or after detecting that the character string that maximum length is added to one is input in described address, the method further includes:It will Focus is moved to except the input frame.
5. the method for the automatic detection control according to Claims 2 or 3, wherein, it is described to judge whether there is prompt message, packet It includes:
Search address corresponding with the common controls;
According to described address, the corresponding prompting address of prompt message is searched;
Judge whether Web page the prompting address occurs.
6. the method for automatic detection control according to claim 1, wherein, the class of the common controls to examining system Type is classified, including:
The property value of the common controls of examining system is obtained using selenium, and is classified to its type.
7. the method for automatic detection control according to claim 5, wherein, it is described that judge whether Web page occurs described Address is prompted, including:
Using selenium search the first kind common controls whether in Web page there are corresponding addresses.
8. a kind of device of automatic detection control, described device include:
Sort module is set as classifying to the type of the common controls of examining system;
Extraction module is set as extracting the common test point and common parameters of every class common controls;
Module is write, is set as test point and parameter according to extraction, writes the test script of all kinds of common controls;
Calling module is set as, when carrying out use-case test to first kind common controls, calling the first kind common controls Test script is simultaneously passed to parameter according to the self-demand of the first kind common controls;
Execution module is set as making the first kind common controls detection Testcase execution and output result.
9. the device of automatic detection control according to claim 8, wherein, the common controls include Text Entry, The module of writing includes:
Detection module, is set as detecting and enters information into input frame;
Mobile unit is set as focus being moved to except the input frame;
Judging unit is set as judging whether there is prompt message according to the content of described information;
Acquiring unit is set as when the judging unit has prompt message according to the judgement of the content of described information, then obtaining institute It states prompt message and carries out fuzzy matching.
10. the device of automatic detection control according to claim 7, wherein, the common controls include Text Entry, The test point of the Text Entry is detected including boundary length, and the module of writing includes:
Searching unit is set as searching the common controls corresponding address in the system page;
Detection unit, is set as detecting the character string that maximum length subtracts one is input in described address;
Judging unit, the content for being set as the character string for subtracting one according to the maximum length judge whether there is prompt message, if so, Then throw abnormal and log information, if it is not, then detection trigger unit detect the character string of maximum length is input to it is described In address;
The judging unit is also configured to judge whether there is prompt message according to the content of the character string of the maximum length, if It is then to throw abnormal and log information, if it is not, then detection trigger unit detects and one character string added to input maximum length Into described address;
The judging unit, be also configured to according to the maximum length add one character string content judge whether there is prompting letter Breath, if so, triggering acquiring unit;
The acquiring unit is set as obtaining the prompt message progress fuzzy matching.
11. the device of automatic detection control according to claim 10, wherein, described device further includes:Mobile unit, if It is set to and focus is moved to except the input frame.
12. the device of automatic detection control according to claim 9 or 10, wherein, the judging unit is specifically configured to:
Search address corresponding with the common controls;
According to described address, the corresponding prompting address of prompt message is searched;
Judge whether Web page the prompting address occurs.
13. the device of automatic detection control according to claim 8, wherein, the sort module, specifically for using Selenium obtains the property value of the common controls of examining system, and classifies to its type.
14. the device of automatic detection control according to claim 12, wherein, the judgment module, specifically for using Selenium search the first kind common controls whether in Web page there are corresponding addresses.
CN201780002429.6A 2017-03-21 2017-03-21 The method and device of automatic detection control Pending CN108235761A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/077441 WO2018170722A1 (en) 2017-03-21 2017-03-21 Method and device for automatically testing control

Publications (1)

Publication Number Publication Date
CN108235761A true CN108235761A (en) 2018-06-29

Family

ID=62645528

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201780002429.6A Pending CN108235761A (en) 2017-03-21 2017-03-21 The method and device of automatic detection control

Country Status (2)

Country Link
CN (1) CN108235761A (en)
WO (1) WO2018170722A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109558319A (en) * 2018-11-27 2019-04-02 泰康保险集团股份有限公司 Test method, equipment and the storage medium of Web page control
CN109783389A (en) * 2019-01-22 2019-05-21 未来电视有限公司 Element control automatic test approach, device and electronic equipment
CN110460497A (en) * 2019-08-20 2019-11-15 迈普通信技术股份有限公司 A kind of automated testing method, apparatus and system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113238961B (en) * 2021-06-08 2024-04-30 中国农业银行股份有限公司 Test data processing method, device, equipment, storage medium and program product

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101118515A (en) * 2007-09-11 2008-02-06 腾讯科技(深圳)有限公司 Automatically testing method and apparatus for list
CN102207872A (en) * 2011-06-04 2011-10-05 ***通信集团内蒙古有限公司 Method and system for customizing Web UI (User Interface) control according to user requirements
CN102360271A (en) * 2011-10-10 2012-02-22 深圳中兴网信科技有限公司 Input box detection method based on Web test
US8726148B1 (en) * 1999-09-28 2014-05-13 Cloanto Corporation Method and apparatus for processing text and character data
CN104050076A (en) * 2013-03-12 2014-09-17 阿里巴巴集团控股有限公司 Testing method, device and system of application software on mobile terminal
CN104252410A (en) * 2013-06-27 2014-12-31 阿里巴巴集团控股有限公司 Method and equipment for testing control in page
US20150324275A1 (en) * 2013-01-29 2015-11-12 Jinfeng Luan Generating test code to test executable code

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8726148B1 (en) * 1999-09-28 2014-05-13 Cloanto Corporation Method and apparatus for processing text and character data
CN101118515A (en) * 2007-09-11 2008-02-06 腾讯科技(深圳)有限公司 Automatically testing method and apparatus for list
CN102207872A (en) * 2011-06-04 2011-10-05 ***通信集团内蒙古有限公司 Method and system for customizing Web UI (User Interface) control according to user requirements
CN102360271A (en) * 2011-10-10 2012-02-22 深圳中兴网信科技有限公司 Input box detection method based on Web test
US20150324275A1 (en) * 2013-01-29 2015-11-12 Jinfeng Luan Generating test code to test executable code
CN104050076A (en) * 2013-03-12 2014-09-17 阿里巴巴集团控股有限公司 Testing method, device and system of application software on mobile terminal
CN104252410A (en) * 2013-06-27 2014-12-31 阿里巴巴集团控股有限公司 Method and equipment for testing control in page

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张帅: "匹配装置自动检测***的软件设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
贾丽等: "Web***测试用例自动执行***", 《计算机工程与应用》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109558319A (en) * 2018-11-27 2019-04-02 泰康保险集团股份有限公司 Test method, equipment and the storage medium of Web page control
CN109558319B (en) * 2018-11-27 2022-03-01 泰康保险集团股份有限公司 Method and device for testing Web page control and storage medium
CN109783389A (en) * 2019-01-22 2019-05-21 未来电视有限公司 Element control automatic test approach, device and electronic equipment
CN110460497A (en) * 2019-08-20 2019-11-15 迈普通信技术股份有限公司 A kind of automated testing method, apparatus and system

Also Published As

Publication number Publication date
WO2018170722A1 (en) 2018-09-27

Similar Documents

Publication Publication Date Title
CN108235761A (en) The method and device of automatic detection control
CN104239485B (en) A kind of dark chain detection method in internet based on statistical machine learning
CN109726107A (en) Test method, device, equipment and storage medium
CN105956180B (en) A kind of filtering sensitive words method
US11019099B2 (en) Method of application malware detection based on dynamic API extraction, and readable medium and apparatus for performing the method
CN107016298A (en) A kind of webpage tamper monitoring method and device
CN111858242A (en) System log anomaly detection method and device, electronic equipment and storage medium
CN109711163A (en) Android malware detection method based on API Calls sequence
CN106951782A (en) A kind of malicious code detecting method applied towards Android
CN110543422B (en) Software package code defect data processing method, system and medium for FPR
CN103902440A (en) Method and device for detecting characters in application program
CN115952503B (en) Application safety test method and system fused with black and white ash safety detection technology
CN108804332A (en) A kind of c program memory overflow intellectualized detection method based on machine learning
CN111753290A (en) Software type detection method and related equipment
CN109753286A (en) A method of the code method based on functional label counts its call number
CN111309505B (en) Page exception handling method and device and electronic equipment
CN112948664A (en) Method and system for automatically processing sensitive words
CN107966648A (en) A kind of embedded failure diagnosis method based on correlation matrix
CN114722323A (en) System and method for safety examination based on webpage content
JP5618861B2 (en) Information processing apparatus, information processing method, and program
CN105975379A (en) False mobile device recognition method and system
CN106355314A (en) A Vehicle Engine Air Valve Quality Streaming Data Processing Method and Device
CN103746871B (en) Data validity detection means and detection method
CN110515829A (en) Application testing method, device, equipment and computer readable storage medium
CN116340172A (en) Data collection method and device based on test scene and test case detection method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20180629