CN104750604B - The generation method and device of browser compatibility test cases - Google Patents

The generation method and device of browser compatibility test cases Download PDF

Info

Publication number
CN104750604B
CN104750604B CN201310747049.9A CN201310747049A CN104750604B CN 104750604 B CN104750604 B CN 104750604B CN 201310747049 A CN201310747049 A CN 201310747049A CN 104750604 B CN104750604 B CN 104750604B
Authority
CN
China
Prior art keywords
function point
test cases
knowledge base
tested
test sample
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.)
Active
Application number
CN201310747049.9A
Other languages
Chinese (zh)
Other versions
CN104750604A (en
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.)
China Unionpay Co Ltd
Original Assignee
China Unionpay 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 China Unionpay Co Ltd filed Critical China Unionpay Co Ltd
Priority to CN201310747049.9A priority Critical patent/CN104750604B/en
Publication of CN104750604A publication Critical patent/CN104750604A/en
Application granted granted Critical
Publication of CN104750604B publication Critical patent/CN104750604B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The present invention relates to computer software development technique, the generation method and device of more particularly to a kind of browser compatibility test cases.Include according to the device for being used to generate browser compatibility test cases of one embodiment of the invention:Static scanning device, it is configured to by scanning page source program to generate the module of function point list to be tested, and the function point list to be tested is included in the function point detected in page source program;Knowledge base, it is configured to storage and the test sample of function Point matching;Knowledge base adaptation, it is configured to search the test sample matched with the function point in the function point list to be tested in the knowledge base;And test cases file generator, it is configured to the test cases file that generation includes the test sample.

Description

The generation method and device of browser compatibility test cases
Invention field
The present invention relates to computer software development technique, more particularly to a kind of generation side of browser compatibility test cases Method and device.
Background technology
Browser-safe sex chromosome mosaicism be otherwise known as webpage compatibility or compatible Website sex chromosome mosaicism, refer to webpage in various browsers On display effect may be inconsistent and produce the compatibling problem between browser and webpage.Due to different browsers in kernel, be in It is existing to there is difference between engine, JavaScript interpreter and data storage so that same webpage is in some clients Display effect does not reach preferable effect, so as to have influence on the usage experience of user.
Test currently for browser compatibility is general by being accomplished manually.Tester is needed to the same page in difference Presentation effect on browser is made artificial compare and analyzed.There are shortcomings in this mode.
For example, because Development of Web Browser manufacturer is numerous and the navigator product of same manufacturer is there is also many versions, because This test environment is very huge, if to accomplish to cover all around, it is necessary to put into the money such as substantial amounts of tester and test man-hour Source, causes cost very high.Secondly, test typically use general test cases, not in view of between each browser the characteristics of and Difference, lacks repetitive operation useless in flexibility, therefore test process and occupies sizable ratio.Furthermore, due to surveying Test result depends on artificial judgment, with subjective colo(u)r, therefore accuracy rate can not be guaranteed.
As can be seen here, the browser compatibility method of testing and dress of disadvantages mentioned above can be overcome in the urgent need to offer is a kind of Put.
The content of the invention
It is an object of the present invention to provide a kind of generation method of browser compatibility test cases, it can improve simultaneous The efficiency and accuracy of capacitive test.
According to the generation method of the browser compatibility test cases of one embodiment of the invention, comprise the following steps:
Function point list to be tested is generated, the function point list to be tested is included in the work(detected in page source program Can point;
The test sample matched with the function point in the function point list to be tested is searched in knowledge base;And
Generation includes the test cases file of the test sample.
Preferably, in the generation method of above-mentioned browser compatibility test cases, function point list to be tested is generated Step includes:
If detecting the page source program has syntax error, the life of the function point list to be tested is terminated Into being otherwise transferred to the following steps;
According to the type of function point, function point present in it is searched by scanning the code of the page source program; And
The function point found is added to the function point list to be tested.
Preferably, in the generation method of above-mentioned browser compatibility test cases, the type of the function point includes Javascript classes, CSS classes and HTML5 classes.
Preferably, in the generation method of above-mentioned browser compatibility test cases, search and treated with described in knowledge base The test sample that each function point in test function point list matches.
Preferably, in the generation method of above-mentioned browser compatibility test cases, search and treated with described in knowledge base The test sample of the type matching of every kind of function point in test function point list.
Preferably, in the generation method of above-mentioned browser compatibility test cases, looked into a parallel fashion in knowledge base Look for the test sample with multiple function points or a variety of function point type matchings.
Preferably, in the generation method of above-mentioned browser compatibility test cases, the type of the function point is can be more New.
It is also an object of the present invention to provide a kind of device for being used to generate browser compatibility test cases, its energy Enough improve the efficiency and accuracy of compatibility test.
Include according to the device for being used to generate browser compatibility test cases of one embodiment of the invention:
Static scanning device, it is configured to by scanning page source program generate the module of function point list to be tested, institute State function point list to be tested and be included in the function point detected in page source program;
Knowledge base, it is configured to storage and the test sample of function Point matching;
Knowledge base adaptation, it is configured to search in the knowledge base and the function in the function point list to be tested The test sample that point matches;And
Test cases file generator, it is configured to the test cases file that generation includes the test sample.
Preferably, above-mentioned for generating in the device of browser compatibility test cases, the test specimens of the knowledge base Originally it is renewable.
Preferably, be used to generating the device of browser compatibility test cases above-mentioned, the knowledge base adaptation with Parallel mode searches the test sample matched with multiple function points in knowledge base.
Brief description of the drawings
From described further below with reference to accompanying drawing, it will make above and other objects of the present invention and advantage more complete It is clear.
Fig. 1 is the block diagram for being used to generate the device of browser compatibility test cases according to one embodiment of the invention.
Fig. 2 is the flow chart of the generation method of the browser compatibility test cases according to one embodiment of the invention.
Fig. 3 be flow chart shown in Fig. 2 in function point list generation step S220 to be tested flow chart.
Fig. 4 be flow chart shown in Fig. 2 in lookup test sample step S230 flow chart.
Embodiment
The present invention is more fully illustrated referring to which illustrates the accompanying drawing of illustrative examples of the present invention.But this hair It is bright to be realized by multi-form, and be not construed as being only limitted to each embodiment given herein.The above-mentioned each implementation provided Example is intended to make this paper disclosure comprehensively complete, so as to the understanding of the scope of the present invention more fully and accurately.
The term of such as "comprising" and " comprising " etc is represented except direct with having in the specification and in the claims Beyond the unit and step clearly stated, technical scheme be also not excluded for do not stated directly or clearly its The situation of its unit and step.
Embodiments of the invention are specifically described below by accompanying drawing.
Fig. 1 is the block diagram for being used to generate the device of browser compatibility test cases according to one embodiment of the invention.
As shown in figure 1, including static scanning device 110, knowledge for the device 10 for generating browser compatibility test cases Storehouse adaptation 120, knowledge base 130 and test cases file generator 140.
In the present embodiment, after page source program to be tested is loaded into internal memory, static scanning device 110 enters to it Row scans for the function point wherein included.In this manual, function point refer to being capable of complete independently some is specific Operation flow.Preferably, function point is categorized as Javascript classes by embodiments of the invention(It meets Javascript scripts Linguistic norm), CSS classes(It meets Cascading Style Sheet specification)With HTML5 classes(It meets HTML5 programming language specifications)Deng.It is quiet The function point found is also put into function point list to be tested and exported to knowledge base adaptation 120 by state scanner 110.
Then, knowledge base adaptation 120 is inquired about and each function point in function point list to be tested in knowledge base 130 The test sample matched.If there is the test sample of matching, then added to test sample list, otherwise, then generation lacks The message of the test sample of matching and it is stored in knowledge base 130, so that knowledge base maintenance personnel are that these function points increase Suitable test sample.The content of knowledge base 130 is renewable, i.e. can increase, delete and change test specimens therein This.Preferably, knowledge base adaptation 120 can perform inquiry operation to improve processing speed to knowledge base 130 in a parallel fashion.
After completing to treat the matching inquiry of all function points in test function point list, knowledge base adaptation 120 Test sample list is exported to test cases file generator 140, test cases file is generated by the latter.Test cases file In the test specimens matched with each function point in function point list to be tested that can find comprising knowledge base adaptation 120 This.Or in order to reduce in test job amount, test cases file only can be found comprising knowledge base adaptation 120 with it is to be measured Try the test sample of every kind of function point type matching in function point list.
Fig. 2 is the flow chart of the generation method of the browser compatibility test cases according to one embodiment of the invention.Show Example property, it is assumed here that the present embodiment is realized for generating the device of browser compatibility test cases using shown in Fig. 1, But will recognize that from the following description, the method for the present embodiment is not rely on specific structure.
As shown in Fig. 2 in step S210, page source program to be tested is loaded into internal memory.Subsequently enter step S220,110 pairs of the static scanning device page source program is scanned to be looked into searching the function point wherein included, and generating to include The function point list to be tested of the function point found.
Subsequently enter step S230, knowledge base adaptation 120 inquired about in knowledge base 130 with function point list to be tested The test sample that matches of each function point and generate test sample list.
Subsequently enter step S240, selection or default option life of the test cases file generator 140 according to user Into the test cases file of corresponding format, form described here for example include but is not limited to Microsoft word, The file formats such as Microsoft excel.
Fig. 3 be flow chart shown in Fig. 2 in function point list generation step S220 to be tested flow chart.
As shown in figure 3, in step S221, static scanning device 110 for page source program to be tested be scanned with Determine whether there is syntax error, if it is present exiting the flow shown in whole Fig. 2, otherwise, then perform step S222。
Step S222 continues the step S210 from Fig. 2.In this step, the scanning of static scanning device 110 page source program Code search Javascript classes function point wherein that may be present, and by the Javascript class function points found Add function point list to be tested.
Step S223 is subsequently entered, the code of the scanning page source program of static scanning device 110 wherein there may be to search CSS class function points, and the CSS classes function point found is added into function point list to be tested.
Step S224 is subsequently entered, the code of the scanning page source program of static scanning device 110 wherein there may be to search HTML5 class function points, and the HTML5 classes function point found is added into function point list to be tested.
Step S225 is subsequently entered, the code of the scanning page source program of static scanning device 110 wherein there may be to search Other control class function points, and the other control class function points found are added into function point list to be tested.
Step S226 is finally entered, static scanning device exports function point list to be tested to knowledge base adaptation 120.It is complete It will enter the step S230 in flow chart shown in Fig. 2 after into step S226.
Fig. 4 be flow chart shown in Fig. 2 in lookup test sample step flow chart.
As shown in figure 4, the step S226 in step S210 or Fig. 3 that step S231 continues from Fig. 2.In step S231 In, knowledge base adaptation 120 determines whether each function point in function point list to be tested has been traversed first, in other words With the presence or absence of the function point for being not carried out matching inquiry operation, if there is the function point for being not carried out matching inquiry operation, then enter Step step S232, otherwise, then into step S233.
In step S232, knowledge base adaptation 120 is for example extracted in function point list to be tested still according to storage order The function point of matching inquiry operation is not performed.
Step S234 is subsequently entered, knowledge base adaptation 120 accesses knowledge base 130 and determines whether deposited in knowledge base 130 With the test sample in the step S232 function Point matchings extracted.If there is the test sample of matching, then into step S235, test sample list is added by the test sample found;Otherwise, then into step S236, generation lacks the survey of matching The message of sample sheet and store it in knowledge base 130.
After step S235 and S236 is performed, the flow return to step S231 shown in Fig. 4.
Another branching step S233 returned to after step S231, in this step, knowledge base adaptation 120 will be tested Sample list is exported to test cases file generator 140.Alternatively, in this step, knowledge base adaptation 120 can be to surveying Examination sample list enters edlin, only retains one or several test samples for same type of function point.
After step S233, the step S240 that the flow shown in Fig. 4 will enter in Fig. 2.
It is worthy of note that, although in the present embodiment, knowledge base adaptation 120 treats test function point range according to order Function point in table performs matching inquiry operation one by one, but in order to improve processing speed, knowledge base adaptation can also be with simultaneously Multiple function points are performed matching inquiry operation by line mode simultaneously.
Compared with prior art, embodiments of the invention have following advantages.
First, by static scanning page source program and the instruction in page source program, code are read come analytic function Point, can substantially reduce the workload of tester.
Secondly, it is the compatibility test that function point automatically generates matching according to the content in browser compatibility knowledge base Case file, this significantly reduces the live load of Test Case Design personnel, and test cases is more simplified, and excludes Unnecessary test content, so as to significantly improve testing efficiency.
Due to the present invention can be implemented in a variety of manners in the case of without departing substantially from essence spirit of the present invention, therefore above The embodiment of description is merely illustrative rather than restricted.The scope of the present invention is defined by the independent claims, The protection domain of appended claims is belonged to various change that mode made or variation is described above.

Claims (10)

1. a kind of generation method of browser compatibility test cases, it is characterised in that comprise the following steps:
Function point list to be tested is generated, the function point list to be tested is included in the function of being detected in page source program Point;
The test sample matched with the function point in the function point list to be tested is searched in knowledge base;And
Generation includes the test cases file of the test sample.
2. the generation method of browser compatibility test cases according to claim 1, wherein, generate function point to be tested The step of list, includes:
If detecting the page source program has syntax error, the generation of the function point list to be tested is terminated, it is no Then it is transferred to the following steps;
According to the type of function point, function point present in it is searched by scanning the code of the page source program;And
The function point found is added to the function point list to be tested.
3. the generation method of browser compatibility test cases according to claim 2, wherein, the type of the function point Including Javascript classes, CSS classes and HTML5 classes.
4. the generation method of browser compatibility test cases according to claim 2, wherein, searched in knowledge base with The test sample that each function point in the function point list to be tested matches.
5. the generation method of browser compatibility test cases according to claim 2, wherein, searched in knowledge base with The test sample of the type matching of every kind of function point in the function point list to be tested.
6. the generation method of the browser compatibility test cases according to claim 4 or 5, wherein, exist in a parallel fashion The test sample with multiple function points or a variety of function point type matchings is searched in knowledge base.
7. the generation method of browser compatibility test cases according to claim 2, wherein, the type of the function point It is renewable.
8. a kind of device for being used to generate browser compatibility test cases, it is characterised in that including:
Static scanning device, it is configured to by scanning page source program to generate the module of function point list to be tested, described to treat Test function point list is included in the function point detected in page source program;
Knowledge base, it is configured to storage and the test sample of function Point matching;
Knowledge base adaptation, it is configured to search and the function point phase in the function point list to be tested in the knowledge base The test sample of matching;And
Test cases file generator, it is configured to the test cases file that generation includes the test sample.
9. the device according to claim 8 for being used to generate browser compatibility test cases, wherein, the knowledge base Test sample is renewable.
10. the device according to claim 8 for being used to generate browser compatibility test cases, wherein, the knowledge base Adaptation searches the test sample matched with multiple function points in knowledge base in a parallel fashion.
CN201310747049.9A 2013-12-30 2013-12-30 The generation method and device of browser compatibility test cases Active CN104750604B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310747049.9A CN104750604B (en) 2013-12-30 2013-12-30 The generation method and device of browser compatibility test cases

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310747049.9A CN104750604B (en) 2013-12-30 2013-12-30 The generation method and device of browser compatibility test cases

Publications (2)

Publication Number Publication Date
CN104750604A CN104750604A (en) 2015-07-01
CN104750604B true CN104750604B (en) 2017-08-25

Family

ID=53590338

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310747049.9A Active CN104750604B (en) 2013-12-30 2013-12-30 The generation method and device of browser compatibility test cases

Country Status (1)

Country Link
CN (1) CN104750604B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708726A (en) * 2015-11-17 2017-05-24 北京京东尚科信息技术有限公司 Page compatibility testing system and method
CN107291614B (en) * 2017-05-04 2020-10-30 平安科技(深圳)有限公司 File abnormity detection method and electronic equipment
CN108549603A (en) * 2018-04-11 2018-09-18 平安普惠企业管理有限公司 Generating method of test project, device, computer equipment and storage medium
CN111767217B (en) * 2020-06-24 2024-02-02 中国工商银行股份有限公司 JS unit test case generation method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101192194A (en) * 2007-01-19 2008-06-04 中兴通讯股份有限公司 Test case design method based on test case database
CN101251798A (en) * 2008-04-01 2008-08-27 中兴通讯股份有限公司 Test case generating method based on relationship
CN103186463A (en) * 2011-12-30 2013-07-03 阿里巴巴集团控股有限公司 Method and system for determining testing range of software
CN103309807A (en) * 2013-05-31 2013-09-18 中国联合网络通信集团有限公司 Program test method and platform

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719095A (en) * 2009-12-30 2010-06-02 北京世纪高通科技有限公司 Method and device for managing regression testing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101192194A (en) * 2007-01-19 2008-06-04 中兴通讯股份有限公司 Test case design method based on test case database
CN101251798A (en) * 2008-04-01 2008-08-27 中兴通讯股份有限公司 Test case generating method based on relationship
CN103186463A (en) * 2011-12-30 2013-07-03 阿里巴巴集团控股有限公司 Method and system for determining testing range of software
CN103309807A (en) * 2013-05-31 2013-09-18 中国联合网络通信集团有限公司 Program test method and platform

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Web自动化测试框架的设计与实现;陈江勇;《福建师范大学学报》;20130730;第29卷(第4期);全文 *
本体知识库在软件测试脚本自动生成中的应用;张盈谦;《中国优秀硕士学位论文全文数据库信息科技辑》;20060415(第4期);论文第38页第8-10行,第39页第27-31行,第12页第3行、图8.1 *

Also Published As

Publication number Publication date
CN104750604A (en) 2015-07-01

Similar Documents

Publication Publication Date Title
CN110674429A (en) Method, apparatus, device and computer-readable storage medium for information retrieval
US20160283592A1 (en) Method for performing network search at a browser side and a browser
CN104750604B (en) The generation method and device of browser compatibility test cases
JP2015204103A (en) Interactive search and recommendation method and device thereof
US8352913B2 (en) Generating and resolving component names in an integrated development environment
CN109739725A (en) Monitoring method, device and system based on browser and storage medium
CN111367595B (en) Data processing method, program running method, device and processing equipment
US10621255B2 (en) Identifying equivalent links on a page
JP2013517550A (en) System, method, and computer program for ranking individualized tags
CN102523130B (en) Bad webpage detection method and device
CN107133165B (en) Browser compatibility detection method and device
US10599760B2 (en) Intelligent form creation
US9367638B2 (en) Surfacing actions from social data
CN110019660A (en) A kind of Similar Text detection method and device
CN111240653A (en) Interface document generation method and device and readable storage medium
CN109308254A (en) A kind of test method, device and test equipment
US20230205796A1 (en) Method and system for document retrieval and exploration augmented by knowledge graphs
CN105550169A (en) Method and device for identifying point of interest names based on character length
WO2021253641A1 (en) Shading language translation method
CN108427580B (en) Configuration pair naming repetition detection method, storage medium and intelligent device
CN103955425B (en) Webpage (WEB) exploring testing device and method
CN107066302A (en) Defect inspection method, device and service terminal
CN108255891B (en) Method and device for judging webpage type
US8161109B2 (en) Client side culling of dynamic resources
CN107783983B (en) Information display method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant