CN104423961A - Method and system for generating testing script - Google Patents

Method and system for generating testing script Download PDF

Info

Publication number
CN104423961A
CN104423961A CN201310412523.2A CN201310412523A CN104423961A CN 104423961 A CN104423961 A CN 104423961A CN 201310412523 A CN201310412523 A CN 201310412523A CN 104423961 A CN104423961 A CN 104423961A
Authority
CN
China
Prior art keywords
page
information
routing information
tested
database
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.)
Granted
Application number
CN201310412523.2A
Other languages
Chinese (zh)
Other versions
CN104423961B (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201310412523.2A priority Critical patent/CN104423961B/en
Publication of CN104423961A publication Critical patent/CN104423961A/en
Application granted granted Critical
Publication of CN104423961B publication Critical patent/CN104423961B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a method and a system for generating a testing script. Information of page elements is uniformly managed in a database; the testing script is generated by calling the information of the page elements in the database; even though path information of the page elements is changed, only contents of the database need to be updated without modifying codes in the generated testing script; moreover, the path information, which is stored in the database, of the page elements respectively points at element objects when the page elements are applied to a trunk code and/or a branch code, and thus, no matter whether a tested page is generated by the trunk code or the branch code, in the process of generating the testing script, the matched path information of the page elements can be called according to the actual testing environment, so that the generation and maintenance process of the testing script is greatly simplified.

Description

A kind of method and system generating test script
Technical field
The application relates to field of computer technology, particularly relates to a kind of method and system generating test script.
Background technology
The code disposed in applied software development process is referred to as branch code, branch code is reached the standard grade and is applied to the code that true environment disposes and is referred to as trunk code, branch code or trunk code are when running background, the corresponding page will be generated on foreground, in order to carry out functional test to branch code or trunk code, the page that branch code or trunk code can be generated, as tested object, generates test script and carries out functional test to the page.
Generate test script time, need to know the routing information of each page elements in the page in the page, with make generate test script can according to routing information, the page elements corresponding to this routing information carries out functional test.Described page elements comprises control, list, list etc. in the page.
At present, when generating test script, the routing information of page elements writes in the appointed object (as Java object) in test script by the form by explaining, and when there being the routing information of page elements to change, can revise the routing information of this page elements in the appointed object of test script.
By above-mentioned by the scheme in the appointed object of the routing information of page elements write test script, the unified management to page elements can be accomplished, but, essence due to its scheme is still and manually writes in the code of test script by the routing information of page elements, therefore, when there being the routing information of page elements to change, still the code in manual modification test script is needed, particularly when there being a large amount of page elements to have routing information to change, to the amendment meeting more complicated of code in test script, be also unfavorable for the maintenance to page elements, management simultaneously; In addition, if have modified the routing information of page elements in branch code, and this branch code is not also reached the standard grade when becoming trunk code, need to safeguard two test scripts respectively, one of them test script is used for testing the branch code that have modified page elements routing information, another test script is used for testing current trunk code, after branch code is reached the standard grade and is merged with trunk code, refresh test script again, makes the generation of whole test script and maintenance process very complicated.
Summary of the invention
The embodiment of the present application provides a kind of method and system generating test script, in order to solve the problem of generation and the maintenance test scenario process complexity existed in prior art.
Generate a method for test script, described method comprises:
Initiate information call request to database, carry address information and the test environment information of the tested page in described information call request, described test environment information represents that the described tested page is the page of trunk code building or the page of branch code generation;
Receive the information of each page elements in the described tested page that described database returns, wherein, the information of described page elements is the page info that described database root stores according to this locality, determine the page info at the described address information place received, the address information of the page and the information of each page elements in this page is comprised in described page info, inquire the information of the page elements comprised from the described page info determined with the routing information of each page elements of the described test environment information matches received after, described routing information and other information of each page elements in the described page info determined are returned,
Information according to each page elements in the described tested page received generates the test script tested the described tested page.
In the embodiment of the present application, even if the routing information of page elements changes, only need the content of more new database, and without the need to making an amendment the code in the test script generated; In addition, no matter the tested page is the page of trunk code building or the page of branch code generation, when generating test script, the routing information of the page elements of coupling can be called according to the test environment of reality, enormously simplify generation and the maintenance process of test script.
Alternatively, the information of described page elements comprises:
The mark of each page elements;
Each page elements is applied in the information of trunk code and/or is applied in the information of branch code;
The routing information of each page elements, described routing information comprises: when page elements is applied in trunk code this page elements routing information, when page elements is applied in branch code the routing information of this page elements.
In the embodiment of the present application, the content that contains of the packets of information of page elements is from different aspect to reflect the function of described page elements.
Alternatively, inquire the routing information with each page elements of the described test environment information matches received the information of the page elements that described database comprises from the described page info determined, specifically comprise:
Described database, when the described test environment information determining to receive represents that the described tested page is the page of trunk code building, inquires the routing information of this page elements when each page elements is applied in trunk code from the routing information of page elements;
Described database the described test environment information determining to receive represent the described tested page be branch code generate the page time, from the routing information of page elements, inquire the routing information of this page elements when each page elements is applied in branch code.
In the embodiment of the present application, according to the routing information of the page elements of the environmental selection adaptation of the tested page, make a set of test script generated can be applied to trunk environment and branch's environment respectively.
Alternatively, in the described tested page that described basis receives, the information of each page elements generates test script, specifically comprises:
The mark of described page elements received and the routing information of this page elements are bound;
The routing information of page elements is utilized to obtain the content of the page elements corresponding to page elements mark of binding to generate described test script.
In the embodiment of the present application, just the mark of all page elements and routing information are bound when initialization, the final test script generated can be tested all functions of the tested page.
Alternatively, also comprise in the information of described page elements:
The locator meams of the routing information of described page elements and this locator meams the device type that is suitable for;
In the described tested page that described database returns each page elements information before, described method also comprises:
Described database root, according to the device type of the equipment of the described information call request of initiation, determines that this equipment is suitable for the locator meams of the routing information of described page elements.
In the embodiment of the present application, when determining that the locator meams of the equipment of initiation information call request and the routing information of described page elements is adaptive, can guarantee that the information of the page elements returned correctly can be identified by described equipment.
Generate a system for test script, described system comprises UI framework and database, wherein:
Described UI framework, for initiating information call request to database, address information and the test environment information of the tested page is carried in described information call request, described test environment information represents that the described tested page is the page of trunk code building or the page of branch code generation, and receive the information of each page elements in the described tested page that described database returns, and generate according to the information of each page elements in the described tested page received the test script that the described tested page is tested;
Described database, for the page info stored according to this locality, determine the page info at the described address information place received, the address information of the page and the information of each page elements in this page is comprised in described page info, inquire the information of the page elements comprised from the described page info determined with the routing information of each page elements of the described test environment information matches received after, other information of each page elements in described routing information and the described page info determined are returned to described UI framework.
In the embodiment of the present application, even if the routing information of page elements changes, only need the content of more new database, and without the need to making an amendment the code in the test script generated; In addition, no matter the tested page is the page of trunk code building or the page of branch code generation, when generating test script, the routing information of the page elements of coupling can be called according to the test environment of reality, enormously simplify generation and the maintenance process of test script.
Alternatively, the information of described page elements comprises:
The mark of each page elements;
Each page elements is applied in the information of trunk code and/or is applied in the information of branch code;
The routing information of each page elements, described routing information comprises: when page elements is applied in trunk code this page elements routing information, when page elements is applied in branch code the routing information of this page elements.
In the embodiment of the present application, the content that contains of the packets of information of page elements is from different aspect to reflect the function of described page elements.
Alternatively, described database, during specifically for representing that the described tested page is the page of trunk code building in the described test environment information determining to receive, from the routing information of page elements, inquire the routing information of this page elements when each page elements is applied in trunk code; The described test environment information determining to receive represent the described tested page be branch code generate the page time, from the routing information of page elements, inquire the routing information of this page elements when each page elements is applied in branch code.
In the embodiment of the present application, according to the routing information of the page elements of the environmental selection adaptation of the tested page, make a set of test script generated can be applied to trunk environment and branch's environment respectively.
Alternatively, described UI framework, specifically for the mark of described page elements received and the routing information of this page elements being bound, the routing information of page elements is utilized to obtain the content of the page elements corresponding to page elements mark of binding to generate described test script.
In the embodiment of the present application, just the mark of all page elements and routing information are bound when initialization, the final test script generated can be tested all functions of the tested page.
Alternatively, also comprise in the information of described page elements:
The locator meams of the routing information of described page elements and this locator meams the device type that is suitable for;
Described database, also for the device type according to described UI framework, determines that this UI framework is suitable for the locator meams of the routing information of described page elements.
In the embodiment of the present application, when determining that the locator meams of the equipment of initiation information call request and the routing information of described page elements is adaptive, can guarantee that the information of the page elements returned correctly can be identified by described equipment.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present application, below the accompanying drawing used required in describing embodiment is briefly introduced, apparently, accompanying drawing in the following describes is only some embodiments of the application, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the method step schematic diagram in the embodiment of the present application one;
Fig. 2 is the system architecture schematic diagram in the embodiment of the present application two.
Embodiment
In order to make the object of the application, technical scheme and advantage clearly, be described in further detail the application below in conjunction with accompanying drawing, obviously, described embodiment is only some embodiments of the present application, instead of whole embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not making other embodiments all obtained under creative work prerequisite, all belong to the scope of the application's protection.
The embodiment of the present application proposes a kind of scheme of generation test script newly, before generation test script, first the page info of the page is stored in a database, comprise the information of each page elements in the address information of a page and this page in each page info, in the information of described page elements, comprise again routing information when page elements is applied in trunk code and/or branch code; Afterwards, when generating test script for the tested page, the information of the page elements stored for the described tested page can be called directly to database request, then database is that the page that generates of the page of trunk code building or branch code is for foundation with the tested page, inquire the routing information of coupling from the information of described page elements after, return the routing information of the page elements inquired, other information also having page elements simultaneously returned; The information of the page elements returned according to database directly can generate the test script tested the described tested page.
By the scheme of the embodiment of the present application, unified management can be carried out in a database to the information of page elements, in fact namely to the unified management of element object (particular content of the page elements pointed by the routing information of page elements), even if the routing information of page elements changes, only need the content of more new database, and without the need to making an amendment the code in the test script generated; In addition, the routing information of the page elements stored in database has pointed to element object when page elements is applied in trunk code and/or branch code respectively, therefore, no matter the tested page is the page of trunk code building or the page of branch code generation, when generating test script, the routing information of the page elements of coupling can be called according to the test environment of reality, enormously simplify generation and the maintenance process of test script.
Be described in detail to the application's scheme below by specific embodiment, certainly, the application is not limited to following examples.
Embodiment one:
As shown in Figure 1, for generating the method step schematic diagram of test script in the embodiment of the present application one, described method comprises following content:
Step 101: the page info of memory page in a database, comprises the address information of the page and the information of each page elements in this page in described page info.
This step 101 is not the step that all will perform when at every turn generating test script, namely the process of memory page information does not need to perform when each generation test script in a database, can before generation test script memory page information in a database in advance, follow-up can constantly for the page info stored carries out managing, safeguarding, as increased new page info, deleting the page info that stored or upgrade the content in the page info stored.
Corresponding page info can be stored respectively respectively in a database for each page, for convenience of to the page info stored in database safeguard (as interpolations, deletion, amendment etc.) and to the content search in page info with call, alternatively, can with tabular form memory page information in a database.Such as, the address information of the page can unique identification page, when generating the page info of tabular form for this page, can using the address information of the page as List name, make when calling the page info in database, can take page address as index, fast query goes out the page info of respective page.
It should be noted that, the present embodiment one is also not limited to other storage modes for database, and the present embodiment one not logarithm limits according to the file layout of page info in the type in storehouse and database.
The address information of the described page is can the information of a unique identification page, includes but not limited to URL(Uniform Resource Locator, URL(uniform resource locator)) or domain name+relative path information.
Alternatively, can also comprise the descriptor for the page in described page info, described descriptor is also not used in follow-up script generative process, but facilitates keeper to identify intuitively the page info stored in database.Such as, when storing corresponding page info in a database for a certain shopping website homepage, described descriptor can be " XX shopping website homepage "; Again such as, when storing corresponding page info in a database for search website homepage, described descriptor can be " YY search website homepage ".
Be stored in content in page info for page elements arbitrary in the page, include but not limited to:
1), the mark (Key) of page elements, can this page elements of unique identification.
2), page elements is applied in the information of trunk code and/or is applied in the information of branch code.
The page generated due to the page and the branch code of trunk code building has identical address information, and therefore, the page that trunk code and branch code generate respectively is same page info in a database.In fact, if the content in branch code does not upgrade, then trunk code and branch code generate the identical page.Even if having renewal in branch code, consider the performance of the branch code after renewal and trunk code performance can not difference too large, therefore, the page that branch code after renewal generates is compared with the page of trunk code building, major part page elements is identical, but some different page elements can be there are, for identical page elements, trunk code can be applied in and also can be applied in branch code, and different page elements still has identical Key, but its content is different, need be recorded it respectively and be applied in the information that trunk code is still applied in branch code, so that when follow-up generation test script, select the page elements being in equivalent environment with the tested page, such as, if the tested page is the page of trunk code building, the then information of the page elements of selective gist in trunk code, if the tested page is the page that branch code generates, the then information of the page elements of selective gist in branch code.
3), the routing information of page elements, because page elements may be applied in trunk code, also branch code may be applied in, therefore, described routing information comprises: when page elements is applied in trunk code this page elements routing information (being used in reference to the content of page elements when page elements is applied in trunk code), when page elements is applied in branch code the routing information (being used in reference to the content of page elements when page elements is applied in trunk code) of this page elements.
4), the locator meams of the routing information of page elements, in the scheme of the present embodiment one, can with CSS(Cascading Style Sheet, Cascading Style Sheet) determine the routing information of page elements, the UI framework of nearly all type all supports CSS, therefore, the routing information determined with CSS also can identify by all types of UI framework.Certainly, the embodiment of the present application one is also not limited to other locator meams, as id locator meams or name locator meams.
UI framework involved by the embodiment of the present application refers to the human-computer interaction interface be applied in systems development process, and system development is carried out in the navigation (navigation of the portal page, tree construction, multilevel menu navigation etc.) provided by UI framework.
5), locator meams the device type that is suitable for.According to the locator meams that the path of page elements is carried out, record the device type that is suitable for, equipment here can refer to UI framework.
6), page elements is web element(web object) type or web element list(web list object) type.If page elements is web element type, then follow-up generate test script time directly can obtain element object; If page elements is web element list type, represent that this page elements has other page elements associated with self, such as, the page elements of a web element list type is drop-down list, other page elements of particular content in the related list of this page elements.
7), other descriptors of page elements.
After storing the page info of each page in a database, in order to generate test script, can the information stored in database be called, therefore, database externally provides calling interface, as Dubbo interface (remote service of high-performance and transparence can be provided to call), http interface etc.
Step 102: initiate information call request to database, carry address information and the test environment information of the tested page in described information call request, described test environment information represents that the described tested page is the page of trunk code building or the page of branch code generation.
In this step 102, when needing to generate the script for testing the tested page, can by the interface in UI framework calling data storehouse, described information call request is initiated to database, require that database returns the information of each page elements in the described tested page, in order to generate test script.
Step 103: the information receiving each page elements in the described tested page that described database returns.
In this step 103, when database receives described information call request by reception, the address information of the tested page that basis is wherein carried and test environment information, from the page info that this locality stores, select suitable page elements information and return, detailed process is:
The first step: database identifies in information call request the address information of the tested page carried, and as index, from the page info that this locality stores, determine the page info for the described tested page, namely the page info at the address information place of the described tested page is the page info of the described tested page.
Second step: database obtains the information of each page elements in the tested page from the page info of the described tested page determined.
Due to the information (including but not limited to the information of 7 class page elements involved in step 101) of the address information and page elements that contain the page in page info, therefore, database, in the page info determining the tested page, directly therefrom can obtain the information of each page elements in the tested page.
3rd step: database root according to page elements routing information locator meams and the device type that is suitable for, judge to initiate the whether applicable described locator meams of equipment of described information call request, if applicable, then perform next step; Otherwise directly return refusal response message, can carry reason for rejection in this refusal response message is that UI framework type is not adaptive.
Here equipment can refer to the UI framework of initiating described information call request.
4th step: database inquires and the routing information of each page elements of test environment information matches that carries in information call request from the information of the page elements obtained.
The content being applied to trunk code due to a page elements may be different with the content be applied in branch code, therefore, need to be distinguished same page elements application content in different environments.
Particularly, database determines the routing information of page elements, described routing information comprise this page elements when page elements is applied in trunk code routing information, when page elements is applied in branch code the routing information of this page elements.If according to described test environment information, database root determines that the described tested page is the page of trunk code building, then from the routing information of page elements, inquire routing information when being applied in trunk code; If according to described test environment information, database root determines that the described tested page is the page that branch code generates, then from the routing information of page elements, inquire routing information when being applied in branch code.
5th step, the routing information of each page elements inquired and other information of page elements are returned to UI framework by database in the lump.
Step 104: the information according to each page elements in the described tested page received generates the test script tested the described tested page.
The specific implementation of this step 104 is:
First, by such as JDK(Java Development Kit) dynamic proxy mode, the mark of described page elements received and the routing information of this page elements are bound.
Due to when page initialization, some page elements dynamically generated also does not exist on the page, such as, for this page elements of menu that the button needed in the click page just occurs in the page, non-existent in the page when initial, but contain the information of this class page elements in the information of the page elements that database returns, therefore, just the mark of all page elements and routing information are bound when initialization, the final test script generated can be tested all functions of the tested page.
Then, the mark and routing information with the page elements of binding relationship are saved as Map object form, the mark of a page elements and the binding relationship of routing information is had in each Map object, wherein: the Key in Map object is the mark of page elements, the content of the page elements that the Value in Map object refers to for routing information, i.e. element object.
Finally, utilize described Map object to find out the element object generated needed for test script, and generate test script.
Owing to needing to produce the higher code of many multiplicities in the generative process of script, obtained the information of the page elements generated needed for test script by the method for the embodiment of the present application one after, mode by automatically generating directly generates test script, after test script generates, user writes concrete test parameter in described test script, as number of run per minute etc.
Embodiment two:
The embodiment of the present application two describes a kind of system belonging to the generation test script under unified inventive concept with embodiment one, and as shown in Figure 2, described system comprises UI framework 11 and database 12, wherein:
Described UI framework 11 is for initiating information call request to database 12, address information and the test environment information of the tested page is carried in described information call request, described test environment information represents that the described tested page is the page of trunk code building or the page of branch code generation, and receive the information of each page elements in the described tested page that described database 12 returns, and generate according to the information of each page elements in the described tested page received the test script that the described tested page is tested;
The page info of described database 12 for storing according to this locality, determine the page info at the described address information place received, the address information of the page and the information of each page elements in this page is comprised in described page info, inquire the information of the page elements comprised from the described page info determined with the routing information of each page elements of the described test environment information matches received after, other information of each page elements in described routing information and the described page info determined are returned to described UI framework 11.
Alternatively, the information of described page elements comprises:
1), the mark of page elements, can this page elements of unique identification.
2), page elements is applied in the information of trunk code and/or is applied in the information of branch code.
3), the routing information of page elements, described routing information comprises: when page elements is applied in trunk code this page elements routing information, when page elements is applied in branch code the routing information of this page elements.
4), the locator meams of the routing information of page elements.
5), locator meams the device type that is suitable for.
6), page elements is web element type or web element list type.
7), other descriptors of page elements.
Alternatively, when described database 12 is specifically for representing that the described tested page is the page of trunk code building in the described test environment information determining to receive, from the routing information of page elements, inquire the routing information of this page elements when each page elements is applied in trunk code; The described test environment information determining to receive represent the described tested page be branch code generate the page time, from the routing information of page elements, inquire the routing information of this page elements when each page elements is applied in branch code.
Alternatively, described UI framework 11, specifically for the mark of described page elements received and the routing information of this page elements being bound, utilizes the routing information of page elements to obtain the content of the page elements corresponding to page elements mark of binding to generate described test script.
Alternatively, described database 12, also for the device type according to described UI framework, determines that this UI framework is suitable for the locator meams of the routing information of described page elements.
By the scheme of the embodiment of the present application, the routing information of unified maintain pages element in a database, when each generation test script, and then the information in direct calling data storehouse, no matter how the routing information of page elements changes, as long as the routing information more safeguarded in new database, and without the need to revising the code in test script; Simultaneously, the routing information safeguarded in a database has been distinguished page elements and has been applied in content in trunk code and branch code, generate a set of test script, the routing information of page elements in trunk code context is used when testing trunk environment at test script, the routing information of page elements in branch code environment is used when this test script is tested branch's environment, achieve the operation of a set of script in trunk and branch's environment, simplify generation and the maintenance process of test script; In addition, the scripted code support higher for multiplicity generates automatically, improves the efficiency generating test script.
Those skilled in the art should understand, the embodiment of the application can be provided as method, system or computer program.Therefore, the application can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the application can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) of computer usable program code.
The application describes with reference to according to the process flow diagram of the method for the embodiment of the present application, equipment (system) and computer program and/or block scheme.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or square frame.These computer program instructions can being provided to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computing machine or other programmable data processing device produce device for realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be loaded in computing machine or other programmable data processing device, make on computing machine or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computing machine or other programmable devices is provided for the step realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
In one typically configuration, described computer equipment comprises one or more processor (CPU), input/output interface, network interface and internal memory.Internal memory may comprise the volatile memory in computer-readable medium, and the forms such as random access memory (RAM) and/or Nonvolatile memory, as ROM (read-only memory) (ROM) or flash memory (flash RAM).Internal memory is the example of computer-readable medium.Computer-readable medium comprises permanent and impermanency, removable and non-removable media can be stored to realize information by any method or technology.Information can be computer-readable instruction, data structure, the module of program or other data.The example of the storage medium of computing machine comprises, but be not limited to phase transition internal memory (PRAM), static RAM (SRAM), dynamic RAM (DRAM), the random access memory (RAM) of other types, ROM (read-only memory) (ROM), Electrically Erasable Read Only Memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc ROM (read-only memory) (CD-ROM), digital versatile disc (DVD) or other optical memory, magnetic magnetic tape cassette, tape magnetic rigid disk stores or other magnetic storage apparatus or any other non-transmitting medium, can be used for storing the information can accessed by computing equipment.According to defining herein, computer-readable medium does not comprise the computer readable media (transitory media) of non-standing, as data-signal and the carrier wave of modulation.
Although described the preferred embodiment of the application, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the application's scope.
Obviously, those skilled in the art can carry out various change and modification to the application and not depart from the spirit and scope of the application.Like this, if these amendments of the application and modification belong within the scope of the application's claim and equivalent technologies thereof, then the application is also intended to comprise these change and modification.

Claims (10)

1. generate a method for test script, it is characterized in that, described method comprises:
Initiate information call request to database, carry address information and the test environment information of the tested page in described information call request, described test environment information represents that the described tested page is the page of trunk code building or the page of branch code generation;
Receive the information of each page elements in the described tested page that described database returns, wherein, the information of described page elements is the page info that described database root stores according to this locality, determine the page info at the described address information place received, the address information of the page and the information of each page elements in this page is comprised in described page info, inquire the information of the page elements comprised from the described page info determined with the routing information of each page elements of the described test environment information matches received after, described routing information and other information of each page elements in the described page info determined are returned,
Information according to each page elements in the described tested page received generates the test script tested the described tested page.
2. the method for claim 1, is characterized in that, the information of described page elements comprises:
The mark of each page elements;
Each page elements is applied in the information of trunk code and/or is applied in the information of branch code;
The routing information of each page elements, described routing information comprises: when page elements is applied in trunk code this page elements routing information, when page elements is applied in branch code the routing information of this page elements.
3. method as claimed in claim 2, is characterized in that, inquire the routing information with each page elements of the described test environment information matches received, specifically comprise the information of the page elements that described database comprises from the described page info determined:
Described database, when the described test environment information determining to receive represents that the described tested page is the page of trunk code building, inquires the routing information of this page elements when each page elements is applied in trunk code from the routing information of page elements;
Described database the described test environment information determining to receive represent the described tested page be branch code generate the page time, from the routing information of page elements, inquire the routing information of this page elements when each page elements is applied in branch code.
4. method as claimed in claim 2, is characterized in that, in the described tested page that described basis receives, the information of each page elements generates test script, specifically comprises:
The mark of described page elements received and the routing information of this page elements are bound;
The routing information of page elements is utilized to obtain the content of the page elements corresponding to page elements mark of binding to generate described test script.
5. the method as described in as arbitrary in Claims 1 to 4, is characterized in that, also comprise in the information of described page elements:
The locator meams of the routing information of described page elements and this locator meams the device type that is suitable for;
In the described tested page that described database returns each page elements information before, described method also comprises:
Described database root, according to the device type of the equipment of the described information call request of initiation, determines that this equipment is suitable for the locator meams of the routing information of described page elements.
6. generate a system for test script, it is characterized in that, described system comprises UI framework and database, wherein:
Described UI framework, for initiating information call request to database, address information and the test environment information of the tested page is carried in described information call request, described test environment information represents that the described tested page is the page of trunk code building or the page of branch code generation, and receive the information of each page elements in the described tested page that described database returns, and generate according to the information of each page elements in the described tested page received the test script that the described tested page is tested;
Described database, for the page info stored according to this locality, determine the page info at the described address information place received, the address information of the page and the information of each page elements in this page is comprised in described page info, inquire the information of the page elements comprised from the described page info determined with the routing information of each page elements of the described test environment information matches received after, other information of each page elements in described routing information and the described page info determined are returned to described UI framework.
7. system as claimed in claim 6, it is characterized in that, the information of described page elements comprises:
The mark of each page elements;
Each page elements is applied in the information of trunk code and/or is applied in the information of branch code;
The routing information of each page elements, described routing information comprises: when page elements is applied in trunk code this page elements routing information, when page elements is applied in branch code the routing information of this page elements.
8. system as claimed in claim 7, is characterized in that,
Described database, during specifically for representing that the described tested page is the page of trunk code building in the described test environment information determining to receive, from the routing information of page elements, inquire the routing information of this page elements when each page elements is applied in trunk code; The described test environment information determining to receive represent the described tested page be branch code generate the page time, from the routing information of page elements, inquire the routing information of this page elements when each page elements is applied in branch code.
9. system as claimed in claim 7, is characterized in that,
Described UI framework, specifically for the mark of described page elements received and the routing information of this page elements being bound, the routing information of page elements is utilized to obtain the content of the page elements corresponding to page elements mark of binding to generate described test script.
10. the system as described in as arbitrary in claim 6 ~ 9, is characterized in that, also comprise in the information of described page elements:
The locator meams of the routing information of described page elements and this locator meams the device type that is suitable for;
Described database, also for the device type according to described UI framework, determines that this UI framework is suitable for the locator meams of the routing information of described page elements.
CN201310412523.2A 2013-09-11 2013-09-11 A kind of method and system for generating test script Active CN104423961B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310412523.2A CN104423961B (en) 2013-09-11 2013-09-11 A kind of method and system for generating test script

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310412523.2A CN104423961B (en) 2013-09-11 2013-09-11 A kind of method and system for generating test script

Publications (2)

Publication Number Publication Date
CN104423961A true CN104423961A (en) 2015-03-18
CN104423961B CN104423961B (en) 2017-11-17

Family

ID=52973053

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310412523.2A Active CN104423961B (en) 2013-09-11 2013-09-11 A kind of method and system for generating test script

Country Status (1)

Country Link
CN (1) CN104423961B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105868111A (en) * 2016-03-29 2016-08-17 网易(杭州)网络有限公司 Automatic testing method and device for mobile terminal game
CN106776319A (en) * 2016-12-15 2017-05-31 广州酷狗计算机科技有限公司 Automatic test approach and device
CN107038227A (en) * 2017-03-31 2017-08-11 武汉票据交易中心有限公司 The increment synchronization method and system of a kind of script code file
CN107102938A (en) * 2016-02-19 2017-08-29 阿里巴巴集团控股有限公司 The update method and device of test script
CN107181806A (en) * 2017-05-27 2017-09-19 北京思特奇信息技术股份有限公司 A kind of distributed service processing system and method based on dubbo
CN107402882A (en) * 2017-07-21 2017-11-28 杭州迪普科技股份有限公司 Web page method of testing and device
CN108415804A (en) * 2018-01-23 2018-08-17 平安普惠企业管理有限公司 Obtain method, terminal device and the computer readable storage medium of information

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101241466A (en) * 2007-02-08 2008-08-13 深圳迈瑞生物医疗电子股份有限公司 Embedded software test method and system
CN101515250A (en) * 2009-04-09 2009-08-26 腾讯科技(深圳)有限公司 Method for testing software system and device thereof
US20110283181A1 (en) * 2010-05-13 2011-11-17 Salesforce.Com, Inc. Test Framework of Visual Components in a Multitenant Database Environment
CN202372969U (en) * 2011-08-30 2012-08-08 中国工商银行股份有限公司 Software testing system based on point function driving
CN102932197A (en) * 2011-08-11 2013-02-13 阿里巴巴集团控股有限公司 Testing method and system
CN103116542A (en) * 2013-01-24 2013-05-22 浪潮(北京)电子信息产业有限公司 Test method of equipment expansion stability
US20130151600A1 (en) * 2007-10-15 2013-06-13 Software Research, Inc. Method and System for Testing Websites

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101241466A (en) * 2007-02-08 2008-08-13 深圳迈瑞生物医疗电子股份有限公司 Embedded software test method and system
US20130151600A1 (en) * 2007-10-15 2013-06-13 Software Research, Inc. Method and System for Testing Websites
CN101515250A (en) * 2009-04-09 2009-08-26 腾讯科技(深圳)有限公司 Method for testing software system and device thereof
US20110283181A1 (en) * 2010-05-13 2011-11-17 Salesforce.Com, Inc. Test Framework of Visual Components in a Multitenant Database Environment
CN102932197A (en) * 2011-08-11 2013-02-13 阿里巴巴集团控股有限公司 Testing method and system
CN202372969U (en) * 2011-08-30 2012-08-08 中国工商银行股份有限公司 Software testing system based on point function driving
CN103116542A (en) * 2013-01-24 2013-05-22 浪潮(北京)电子信息产业有限公司 Test method of equipment expansion stability

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
夏启明等: "Web系统用户登录与访问控制测试模板模型", 《武汉大学学报(工学版)》 *
彭璇: "面向Web应用的自动化功能测试架构研究与实现", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107102938A (en) * 2016-02-19 2017-08-29 阿里巴巴集团控股有限公司 The update method and device of test script
CN107102938B (en) * 2016-02-19 2020-11-17 创新先进技术有限公司 Test script updating method and device
CN105868111A (en) * 2016-03-29 2016-08-17 网易(杭州)网络有限公司 Automatic testing method and device for mobile terminal game
CN105868111B (en) * 2016-03-29 2018-07-03 网易(杭州)网络有限公司 Game of mobile terminal automatic test approach and device
CN106776319A (en) * 2016-12-15 2017-05-31 广州酷狗计算机科技有限公司 Automatic test approach and device
CN106776319B (en) * 2016-12-15 2020-02-14 广州酷狗计算机科技有限公司 Automatic test method and device
CN107038227A (en) * 2017-03-31 2017-08-11 武汉票据交易中心有限公司 The increment synchronization method and system of a kind of script code file
CN107181806A (en) * 2017-05-27 2017-09-19 北京思特奇信息技术股份有限公司 A kind of distributed service processing system and method based on dubbo
CN107402882A (en) * 2017-07-21 2017-11-28 杭州迪普科技股份有限公司 Web page method of testing and device
CN107402882B (en) * 2017-07-21 2020-11-06 杭州迪普科技股份有限公司 Web page testing method and device
CN108415804A (en) * 2018-01-23 2018-08-17 平安普惠企业管理有限公司 Obtain method, terminal device and the computer readable storage medium of information
CN108415804B (en) * 2018-01-23 2021-06-04 平安普惠企业管理有限公司 Method for acquiring information, terminal device and computer readable storage medium

Also Published As

Publication number Publication date
CN104423961B (en) 2017-11-17

Similar Documents

Publication Publication Date Title
CN104423961A (en) Method and system for generating testing script
CN106874174B (en) Method and device for realizing interface test and function test
CN106559438B (en) Program uploading method and device based on target network platform
US10656907B2 (en) Translation of natural language into user interface actions
CN106569783B (en) Method and device for executing task script
CN105335132A (en) Method, apparatus and system for user-defined application function
CN103777969A (en) Server parameter deploying method and device with no need for restarting
CN104391690A (en) Application development system and method
CN106990974B (en) APP updating method and device and electronic equipment
CN104283947A (en) Java script dynamic consolidated server and work process thereof
US20120159515A1 (en) Sharing object representations
CN105354195A (en) Information search method and apparatus
CN112235132A (en) Method, device, medium and server for dynamically configuring service
CN106294113B (en) creation method and device based on programmable test service
US9626371B2 (en) Attribute selectable file operation
US20150310207A1 (en) Method for analysing program code of electronic device and electronic device
US9552347B1 (en) Data grid cell styling systems and methods
CN106775629B (en) Search file generation method and device
CN105635208A (en) Business processing method and device
CN104252413A (en) Automatic script generation method, device and system
CN105577707A (en) Remote call method and remote call device
KR20140095903A (en) Method and apparatus for providing mash up service based on user device
CN107291524B (en) Remote command processing method and device
CN109558375B (en) Optimized file storage method, storage medium, equipment and system
CN104281521A (en) Method and device for debugging applications

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