CN106294178A - Automated testing method and device - Google Patents

Automated testing method and device Download PDF

Info

Publication number
CN106294178A
CN106294178A CN201610702138.5A CN201610702138A CN106294178A CN 106294178 A CN106294178 A CN 106294178A CN 201610702138 A CN201610702138 A CN 201610702138A CN 106294178 A CN106294178 A CN 106294178A
Authority
CN
China
Prior art keywords
language
test item
text
test
flag
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
CN201610702138.5A
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.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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 Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201610702138.5A priority Critical patent/CN106294178A/en
Publication of CN106294178A publication Critical patent/CN106294178A/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

Abstract

The present invention provides a kind of automated testing method and device, and wherein, the method includes: obtain the object language of test item, and the Text Flag of described test item;Transfer the language profile corresponding to the object language of described test item;According to described Text Flag, from the language profile transferred, extract the text message that described test item is corresponding under described object language;The automatic test of described test item is completed according to the text message extracted.The solution of the present invention, can support multilingual automatic test, simplifies testing process, improves automatic test efficiency.

Description

Automated testing method and device
Technical field
The present invention relates to automatization testing technique field, specifically, the present invention relates to a kind of automated testing method and Device.
Background technology
Along with the internationalization of software product extends trend, at present, for different countries and regions, often issue support The software product (being alternatively referred to as multilingual product herein) of different language, and to being in different language before software product is issued Software product under Yan carries out software test.
In order to save manpower, time or hardware resource, improve testing efficiency, just introduce with the artificial test row driven For being converted into the automatic test that machine performs, the i.e. automatization of software test.Generally, test case is being devised and by commenting After Shening, tester perform test step by step according to the code described in test case, obtain actual result and expectation The comparison of result.
It was found by the inventors of the present invention that the Product Logic at multilingual product judges that (such as, text importing, interface redirect Logics etc. are the most accurate), the window handle of automatization's window and automatic test environment is by automatic tests such as text locations In scene, product different language is at different test environments (system language variation), and the realization of automatization is different.And In existing automated test frame, the most only support a kind of language, even make the language of form by oneself, and do not support other The product test of language.Such as, at the test frame of Chinese edition, only support the product test under Chinese, i.e. require to survey at Chinese In test ring border, the language of the test item that multilingual product is current is Chinese;If the language of the test item that multilingual product is current is not Chinese, by somewhat limited when the test frame of Chinese edition is tested.Such as, the word of window is the most current with product Language is consistent, if testing in the test frame under other language, the interface action opening human window may It is restricted.
Therefore, in prior art, to complete the automatic test of multilingual product, then it is required for multilingual product Different language, uses different test frames individually to test, and the testing process causing multilingual product is relatively complicated.
Summary of the invention
The defect existed for above-mentioned prior art, the invention provides a kind of automated testing method and device, can prop up Hold multilingual automatic test, simplify testing process, improve automatic test efficiency.
The invention provides a kind of automated testing method, it is characterised in that including:
Obtain the object language of test item, and the Text Flag of described test item;
Transfer the language profile corresponding to the object language of described test item;
According to described Text Flag, from the language profile transferred, extract described test item under described object language Corresponding text message;
The automatic test of described test item is completed according to the text message extracted.
It is preferred that the Text Flag of described test item is inputted by user, or
Obtain in the following way:
Obtain the referenced text information that test item is corresponding;
Identify the language of described referenced text information, and transfer the language profile corresponding to the language identified;
The Text Flag corresponding to described referenced text information is found out from this language profile, and as described survey The Text Flag of examination item.
It is preferred that the test item that the language profile corresponding to the object language of described test item is specially pre-configured with The language profile corresponding to object language;And/or the language profile by the source code generation of described test item.
It is preferred that described test item literal code mode of the text message of correspondence under described object language is ten thousand country codes Utf-8 coded system.
It is preferred that after referenced text information corresponding to described acquisition test item, described automated testing method also includes:
By unified for the literal code mode of described referenced text information for utf-8 coded system.
It is preferred that described test item belongs at least one in multilingual product, multilingual test environment.
During it is preferred that described test item is specially the test item of multilingual product, the Text Flag of described test item points to At least one in the lookup of the click event of multilingual product, logical judgment, software window or system windows lookup.
It is preferred that described language profile uses extensible markup language xml form.
According to a further aspect in the invention, additionally providing a kind of automatic test device, this device includes:
Object language acquiring unit, for obtaining the object language of test item;
Text Flag acquiring unit, for obtaining the Text Flag of described test item;
Configuration file transfers unit, for transferring the language profile corresponding to object language of described test item;
Text message searches unit, the Text Flag of the test item for obtaining according to described Text Flag acquiring unit, Transfer from described configuration file and the language profile that unit is transferred extracts described test item correspondence under described object language Text message;
Automatic test unit, for searching the test item that extracts of unit under described object language according to text message Corresponding text message carries out automatic test.
It is preferred that described Text Flag acquiring unit specifically includes:
Text obtains subelement, for obtaining the referenced text information that test item is corresponding;
Subelement is searched in configuration, and for identifying the language of described referenced text information, and it is right to transfer the language institute identified The language profile answered;
Mark determines subelement, finds out referenced text for searching the language profile that subelement is transferred from configuration Text Flag corresponding to information, and as the Text Flag of described test item.
It is preferred that described Text Flag acquiring unit also includes:
The unified subelement of coding, for obtaining the literal code side of the referenced text information that subelement obtains by described text Formula is unified for utf-8 coded system.
It is preferred that described Text Flag acquiring unit receives the Text Flag of the test item inputted by user.
It is preferred that the test item that the language profile corresponding to the object language of described test item is specially pre-configured with The language profile corresponding to object language;And/or the language profile by the source code generation of described test item.
It is preferred that described test item literal code mode of the text message of correspondence under described object language is utf-8 Coded system.
It is preferred that described test item belongs at least one in multilingual product, multilingual test environment.
During it is preferred that described test item is specially the test item of multilingual product, the Text Flag of described test item points to At least one in the lookup of the click event of multilingual product, logical judgment, software window or system windows lookup.
It is preferred that described language profile uses xml form.
Aspect and advantage that the present invention adds will part be given in the following description, and these will become from the following description Obtain substantially, or recognized by the practice of the present invention.
Accompanying drawing explanation
The present invention above-mentioned and/or that add aspect and advantage will become from the following description of the accompanying drawings of embodiments Substantially with easy to understand, wherein:
The schematic flow sheet of the automated testing method that Fig. 1 provides for the present invention;
The schematic flow sheet of a kind of Text Flag acquisition methods that Fig. 2 provides for the present invention;
The structural representation of the automatic test device that Fig. 3 provides for the present invention;
Two kinds of structural representations of the Text Flag acquiring unit that Fig. 4 a, 4b provide for the present invention.
Detailed description of the invention
Embodiments of the invention are described below in detail, and the example of described embodiment is shown in the drawings, the most from start to finish Same or similar label represents same or similar element or has the element of same or like function.Below with reference to attached The embodiment that figure describes is exemplary, is only used for explaining the present invention, and is not construed as limiting the claims.
Those skilled in the art of the present technique are appreciated that unless expressly stated, singulative used herein " ", " Individual ", " described " and " being somebody's turn to do " may also comprise plural form.It is to be further understood that use in the description of the present invention arranges Diction " including " refers to there is described feature, integer, step, operation, element and/or assembly, but it is not excluded that existence or adds Other features one or more, integer, step, operation, element, assembly and/or their group.It should be understood that when we claim unit Part is " connected " or during " coupled " to another element, and it can be directly connected or coupled to other elements, or can also exist Intermediary element.Additionally, " connection " used herein or " coupling " can include wireless connections or wireless couple.Used herein arrange Diction "and/or" includes that one or more list the whole of item or any cell being associated combines with whole.
Those skilled in the art of the present technique are appreciated that unless otherwise defined, and all terms used herein (include technology art Language and scientific terminology), have with the those of ordinary skill in art of the present invention be commonly understood by identical meaning.Also should Be understood by, those terms defined in such as general dictionary, it should be understood that have with in the context of prior art The meaning that meaning is consistent, and unless by specific definitions as here, otherwise will not use idealization or the most formal implication Explain.
Those skilled in the art of the present technique are appreciated that " terminal " used herein above, " terminal unit " had both included wireless communication The equipment of number receptor, it only possesses the equipment of wireless signal receiver of non-emissive ability, includes again receiving and launching hardware Equipment, its have can on bidirectional communication link, perform two-way communication reception and launch hardware equipment.This equipment May include that honeycomb or other communication equipments, it has single line display or multi-line display or does not has multi-line to show The honeycomb of device or other communication equipments;PCS (Personal Communications Service, PCS Personal Communications System), it can Process with compositional language, data, fax and/or its communication ability;PDA (Personal Digital Assistant, individual Digital assistants), it can include the access of radio frequency receiver, pager, the Internet/intranet, web browser, notepad, day Go through and/or GPS (Global Positioning System, global positioning system) receptor;Conventional laptop and/or palm Type computer or other equipment, its have and/or include the conventional laptop of radio frequency receiver and/or palmtop computer or its His equipment." terminal " used herein above, " terminal unit " can be portable, can transport, be arranged on the vehicles (aviation, Sea-freight and/or land) in, or be suitable for and/or be configured at local runtime, and/or with distribution form, operate in the earth And/or any other position operation in space." terminal " used herein above, " terminal unit " can also is that communication terminal, on Network termination, music/video playback terminal, such as, can be PDA, MID (Mobile Internet Device, mobile Internet Equipment) and/or there is the mobile phone of music/video playing function, it is also possible to it is the equipment such as intelligent television, Set Top Box.
Those skilled in the art of the present technique are appreciated that remote network devices used herein above, and it includes but not limited to meter The cloud that calculation machine, network host, single network server, multiple webserver collection or multiple server are constituted.Here, Yun Youji A large amount of computers or the webserver in cloud computing (Cloud Computing) are constituted, and wherein, cloud computing is Distributed Calculation One, the super virtual machine being made up of a group loosely-coupled computer collection.In embodiments of the invention, far-end Can realize communicating by any communication mode between the network equipment, terminal unit with WNS server, include but not limited to, based on The mobile communication of 3GPP, LTE, WIMAX, based on TCP/IP, the computer network communication of udp protocol and based on bluetooth, infrared The low coverage wireless transmission method of transmission standard.
It was found by the inventors of the present invention that in actual application, although multilingual product has polyglot version, but it is tested Item is often consistent in itself, i.e. the configurable unique corresponding Text Flag of test item (is alternatively referred to as test item herein Text Flag), Text Flag point to unique test item.Test item similarly, for multilingual test environment also may be used The unique corresponding Text Flag of configuration.
Although the text message table on language due to the described test item that same test item configures under different language Existing difference, but it is directed to this test item.Therefore, the present inventor considers, can build this test item for every kind of language Text message corresponding under this kind of language and the corresponding relation of the Text Flag of this test item.So, follow-up can be according to literary composition This identifier lookup goes out the text message that the test item pointed by Text Flag is corresponding under various language.Wherein, test item belongs to At least one in multilingual product, multilingual test environment.
Then, in the automatic test course of multilingual product or multilingual test environment, determining multilingual product Or after the language the most to be tested of multilingual test environment, the Text Flag of current test item can be obtained;According to this Text Flag obtains the text message that this test item is corresponding under current language.Such that make at multilingual product current In the case of the language of language and test frame is inconsistent, the test item that can obtain based on said method is under current language Corresponding text message completes automatic test, and without the language to be tested of the difference for multilingual product, uses difference Test frame individually test, simplify the testing process of multilingual product.
Describe technical scheme below in conjunction with the accompanying drawings in detail.
The present inventor considers, for multilingual product or multilingual test environment, automatic test needs to carry Go out applicable multilingual support scheme, and without testing one by one on different test frames for different language, with this Simplify the testing process of automatic test, improve automatic test efficiency.
Therefore, multilingual automatic test scheme can be supported in order to provide, can be for different language, for automatically Change the language profile being pre-configured with correspondence in the machine of test or the test frame of virtual machine.So, follow-up can pass through Call language profile and obtain the text message of the automatic test for completing test item, simplify automatic test stream Journey.
Such as, for multilingual product or multilingual test environment, it may be predetermined that go out in automatic test and need Carry out the test item tested, and need the various language of test;For each test item, obtain the text mark of this test item Know and test item text message of correspondence under various language;For every kind of language, build the Text Flag of this test item with Corresponding relation between the text message that this test item is corresponding under this kind of language, and it is stored in the language corresponding to this kind of language In configuration file.
So, after determining the test item needing test, can be completed by automated testing method as shown in Figure 1 Automatic test, the idiographic flow of automated testing method may include steps of:
S101: obtain the object language of test item, and the Text Flag of test item.
The automatic test scheme that the present invention provides is applicable to the automatic test of multilingual product, is also applied for multi-lingual Speech test environment.Therefore, in the solution of the present invention, test item belongs in multilingual product, multilingual test environment at least One.Test item can be multilingual product or multilingual test environment is currently needed for the test item that carries out testing.Test item When being specially the test item of multilingual product, the Text Flag of test item point to the click event of multilingual product, logical judgment, At least one in software window lookup, system windows lookup.
, can first obtain to carry out automatic test to obtain test item text message of correspondence under object language The object language of test item, and the Text Flag of test item.So, in order to follow-up according to Text Flag directly from being pre-configured with Language profile in extract the text message that test item is corresponding under object language.
Wherein, the object language of test item refers to test item has needed the language of automatic test, such as, English, Simplified form of Chinese Character, Chinese-traditional, Portuguese, Vietnamese etc..In actual application, the object language of test item can with test item belonging to The language that multilingual product or multilingual test environment are currently needed for test is consistent.Such as carry out automatically at multilingual product When changing test, determine that multilingual product is when the object language that language is test item of front opening.The object language of test item is permissible Obtained by the identification of the current language of multilingual product or multilingual test environment.
The Text Flag of test item is the unique mark for test item configuration, and Text Flag points to unique test item.Though So the text message of the described test item that test item configures under different language is different, but the Text Flag of test item is in difference It is constant under language.
In the solution of the present invention, the acquisition mode of the Text Flag of test item has two kinds:
Mode one, by the Text Flag of user's input test item.
In actual application, in the case of tester is well understood by the Text Flag of test item, survey to accelerate to obtain The text message that examination item is corresponding under object language, tester can directly input the Text Flag of test item, such as control ID (Identity, identity number).
Mode two, referenced text information based on test item identifies the Text Flag of test item.
In the solution of the present invention, identify the Text Flag of test item about referenced text information based on test item Method, will be in subsequent detailed.
S102: transfer the language profile corresponding to the object language of test item.
In the solution of the present invention, for different language, there is the language profile of correspondence.Wherein, the language of every kind of language Speech configuration file stores the text message that the Text Flag of test item, test item are corresponding under this language, and test item Text Flag and text message between corresponding relation.
Therefore, the text message corresponding under object language in order to obtain test item, can obtain based on step S101 Object language, transfers the language profile corresponding to the object language of test item.
In the solution of the present invention, the survey that the language profile corresponding to the object language of test item is specially pre-configured with The language profile corresponding to object language of examination item;And/or the language profile by the source code generation of test item.
In actual application, about the language profile corresponding to the object language of the test item of system the most manually Configuration;And generally automatically generated by source code about the language profile corresponding to the object language of the test item of software.
In actual application, language profile can use the file format process storage that those skilled in the art commonly use;But No matter using which kind of file format, the required content included in language profile is indispensable, i.e. must include: test item Text Flag, text message that test item is corresponding under this language, and between the Text Flag of test item and text message Corresponding relation.Obviously, in actual application, except including required content in language profile, it is also possible to include other guide, Such as version, coded system etc..
Preferably, in the solution of the present invention, language profile can be from using self-defining xml (extensible Markup language, extensible markup language) form, such as:
<?Xml version=" 1.0 " encoding=" utf-8 "?>
<resource>
<string id="control id information"name="control description">Control text message text</string>
</resource>
Wherein, id information in space is the Text Flag of test item;Control text message is that test item is at language profile Text message corresponding under affiliated language.
In the solution of the present invention, use the definition of xml format language configuration file succinct, and be easy to user and enter as required Row amendment extension.By language profile, the Text Flag of input test item, this test item the most exportable configures at this language Text message corresponding under language corresponding to file, enormously simplify the design of program, shortens the process of exploitation, it is easy to reason Solve.
It is considered that during actual development, automatic test may relate to multiple product or system, and these produce The coded system of product or system is not necessarily consistent, and such as Chinese information processing system uses GBK (national standard extended code) coded system, traditional font Chinese information processing system uses BIG5 (Big5) coded system.Therefore, in actual application, also relate in automatic test course The conversion of coding.
In the solution of the present invention, in order to further speed up automatic test, unified coded system can be used, such as, The coded system of utf-8 (8-bit Unicode Transformation Format, ten thousand country codes).Test item is at object language The literal code mode of the text message of lower correspondence is utf-8 coded system.We obtain inconsistent from different products Coded format, but after all of literal code arrives native system, all use utf-8 coded system.So be conducive to program Writing, it is to avoid the confusion of coded system, logic becomes apparent from, and improves testing efficiency.
S103: according to the Text Flag of test item, extracts test item at object language from the language profile transferred The text message of lower correspondence.
The text envelope corresponding under this language owing to storing the Text Flag of test item, test item in language profile Breath, and the corresponding relation between the Text Flag of test item and text message.Therefore, in the solution of the present invention, by step After rapid S102 transfers out the language profile corresponding to object language of test item, the language configuration literary composition transferred can be searched Whether part exists the Text Flag of test item;If existing, then from language profile, extract text mark corresponding Text message, the text message that i.e. test item pointed by Text Flag is corresponding under object language.If not existing, the most permissible Resolve the source code of test item further, attempt obtaining the text message that test item is corresponding under object language.
S104: complete the automatic test of test item according to the text message extracted.
Obtained by step S103 test item at object language under after corresponding text message, can be according to commonly used in the art Technological means completes the automatic test of test item, such as automatization and finds window.
In actual application, the automatic test scheme that the present invention provides can be supported to extend language and the automatization of expanded function Test.Such as, if needing to extend other language, can be for each test item, by it under current already present language Text message is translated, the text message under the language that is expanded, and configuration obtains corresponding language profile, Ji Kezhi Holding the automatic test under extension language, extension is convenient succinct.Further, if needing extended products function, can will expand Exhibition function, as new test item, is determined this test item text message under various language, and correspondence is added various language to In the language profile of speech, it is not necessary to revise code on a large scale, extension is convenient.
, owing to there is test item in test frame at language (mesh to be tested in the automated testing method that the present invention provides Poster say) corresponding to language profile, so, at multilingual product or the language to be tested of multilingual test environment With the language of test frame inconsistent in the case of, it is also possible to obtain test item under object language for completing automatic test Text message.Such as, under the virtual machine test frame not having Vietnamese, the software of a Vietnamese, can be at Portuguese Virtual machine in carry out the automatic test of English interface.Difference is used compared to the existing different language for multilingual product Test frame individually test, the automatic test scheme that the present invention provides can support the polyglot of multilingual product Test, simplifies testing process, improves testing efficiency.
The Text Flag of test item is identified about the referenced text information based on test item mentioned in step S101 Method, as in figure 2 it is shown, its idiographic flow may include steps of:
S201: obtain the referenced text information that test item is corresponding.
In the solution of the present invention, in the case of tester is unfamiliar with the Text Flag of test item, test can be obtained Under item language beyond object language, the text message of correspondence is as the referenced text of the Text Flag for identifying test item Information.Such as, it is to look for English window to test, the text envelope that this window is corresponding under simplified form of Chinese Character can be obtained in advance Breath is as referenced text information.Or, the referenced text letter that test item that tester directly inputs is corresponding can be directly received Breath.
Further, in the solution of the present invention, if the literal code side of the text message of the storage in language profile Formula is utf-8 coded system, then after obtaining the referenced text information that test item is corresponding, it is also possible to the referenced text that will obtain The literal code mode of information is unified for utf-8 coded system, in order to follow-up prompt operation.
S202: identify the language of referenced text information, and obtain the language profile corresponding to language identified.
It is considered that be previously stored with each self-corresponding language profile of various language in test frame, and language Configuration file stores the Text Flag of test item, and the text message that test item is corresponding under this language, and test Corresponding relation between Text Flag and the text message of item.
Therefore, in the solution of the present invention, in order to obtain the Text Flag of test item, obtaining test item by step S201 Referenced text information after, the language of referenced text information can be identified;Then, the language of referenced text information is transferred out Corresponding language profile.
S203: find out the Text Flag corresponding to referenced text information from language profile, and as test item Text Flag.
In the solution of the present invention, language profile can be traveled through, search whether that existence is consistent with referenced text information Text language;If existing, then can further search for out the Text Flag corresponding to text language, i.e. referenced text information institute Corresponding Text Flag.In actual application, the Text Flag corresponding to the text language found out points to unique test item, i.e. The Text Flag found out is the Text Flag of test item.
Based on above-mentioned automated testing method, present invention also offers a kind of automatic test device, as it is shown on figure 3, from Dynamicization test device may include that object language acquiring unit 301, Text Flag acquiring unit 302, configuration file transfer unit 303, text message searches unit 304, automatic test unit 305.
In the solution of the present invention, multilingual automatic test device can be supported in order to provide, can for different language, It is pre-configured with the language profile of correspondence.So, follow-up can by call language profile obtain for complete survey The text message of the automatic test of examination item, simplifies automatic testing process.
Such as, for multilingual product or multilingual test environment, it may be predetermined that go out in automatic test and need Carry out the test item tested, and need the various language of test;For each test item, obtain the text mark of this test item Know, and the text message that test item is corresponding under various language;For every kind of language, build the Text Flag of this test item with Corresponding relation between the text message that this test item is corresponding under this kind of language, and it is stored in the language corresponding to this kind of language In configuration file.
So, automatic test device, can be based on language profile after determining the test item needing test Make the automatic test for completing test item.
Specifically, object language acquiring unit 301 is for obtaining the object language of test item;Text Flag acquiring unit 302 for obtaining the Text Flag of test item.
The automatic test device that the present invention provides is applicable to the automatic test of multilingual product, is also applied for multi-lingual Speech test environment.Therefore, in the solution of the present invention, test item belongs in multilingual product, multilingual test environment at least One.Test item can be multilingual product or multilingual test environment is currently needed for the test item that carries out testing.Test item When being specially the test item of multilingual product, the Text Flag of test item point to the click event of multilingual product, logical judgment, At least one in software window lookup, system windows lookup.
, can first obtain to carry out automatic test to obtain test item text message of correspondence under object language The object language of test item, and the Text Flag of test item.So, in order to follow-up according to Text Flag directly from being pre-configured with Language profile in extract the text message that test item is corresponding under object language.
Wherein, the object language of test item refers to test item has needed the language of automatic test, such as, English, Simplified form of Chinese Character, Chinese-traditional, Portuguese etc..In actual application, generally refer to multilingual product belonging to test item or multi-lingual The test environment of speech is currently needed for the language of test.Such as when multilingual product carries out automatic test, determine multilingual product Product are when the object language that language is test item of front opening.Object language acquiring unit 301 can by multilingual product or The identification of the language that multilingual test environment is current obtains the object language of test item.
The Text Flag of test item is the unique mark for test item configuration, and Text Flag points to unique test item.Though So the text message of the described test item that test item configures under different language is different, but the Text Flag of test item is in difference It is constant under language.
In the solution of the present invention, Text Flag acquiring unit 302 can obtain test item by least one mode following Text Flag:
Mode one, receives the Text Flag of the test item of user's input.
In actual application, in the case of tester is well understood by the Text Flag of test item, survey to accelerate to obtain The text message that examination item is corresponding under object language, tester can directly input the Text Flag of test item, such as control ID (Identity, identity number).
Mode two, referenced text information based on test item identifies the Text Flag of test item.
In the solution of the present invention, identify the Text Flag of test item about referenced text information based on test item Method, will be in subsequent detailed.
Configuration file transfers unit 303 for transferring the language profile corresponding to the object language of test item.
In the solution of the present invention, for different language, there is the language profile of correspondence.Wherein, the language of every kind of language Speech configuration file stores the Text Flag of test item, and the text message that test item is corresponding under this language, and surveys Corresponding relation between Text Flag and the text message of examination item.
Therefore, the text message corresponding under object language in order to obtain test item, it is permissible that configuration file transfers unit 303 The object language obtained based on object language acquiring unit 301, transfers the language configuration literary composition corresponding to the object language of test item Part.
In the solution of the present invention, the survey that the language profile corresponding to the object language of test item is specially pre-configured with The language profile corresponding to object language of examination item;And/or the language profile by the source code generation of test item.
In actual application, about the language profile corresponding to the object language of the test item of system the most manually Configuration;And generally automatically generated by source code about the language profile corresponding to the object language of the test item of software.
Text message searches the Text Flag of the unit 304 test item for obtaining according to Text Flag acquiring unit 302, Transfer extraction test item the language profile that unit 303 is transferred from configuration file to obtain at object language acquiring unit 301 Object language under corresponding text message.
The text envelope corresponding under this language owing to storing the Text Flag of test item, test item in language profile Breath, and the corresponding relation between the Text Flag of test item and text message.Therefore, in the solution of the present invention, text message Lookup unit 304 can be searched configuration file and transfer the literary composition that whether there is test item in the language profile that unit 303 is transferred This mark;If existing, then from language profile, extract the text message corresponding to text mark, i.e. Text Flag institute The text message that the test item pointed to is corresponding under object language.If not existing, then can resolve the source code of test item further, Attempt obtaining the text message that test item is corresponding under object language.
Automatic test unit 305 carries the test item of 304 taking-ups at object language for searching unit according to text message Text message corresponding under the object language that acquiring unit 301 obtains carries out automatic test.
In actual application, automatic test unit 305 can be searched based on text message according to technological means commonly used in the art The text message that the test item that unit 304 extracts is corresponding under object language completes the automatic test of test item, such as certainly Dynamicization finds window.
In actual application, the automatic test device that the present invention provides can be supported to extend language and the automatization of expanded function Test.Such as, if needing to extend other language, can be for each test item, by it under current already present language Text message is translated, the text message under the language that is expanded, and configuration obtains corresponding language profile, Ji Kezhi Holding the automatic test under extension language, extension is convenient succinct.Further, if needing extended products function, can will expand Exhibition function, as new test item, is determined this test item text message under various language, and correspondence is added various language to In the language profile of speech, it is not necessary to revise code on a large scale, extension is convenient.
In the solution of the present invention, the file format process that language profile can use those skilled in the art to commonly use is deposited Storage;But no matter using which kind of file format, the required content included in language profile is indispensable, i.e. must include: The Text Flag of test item, and the text message that test item is corresponding under this language, and the Text Flag of test item is with civilian Corresponding relation between this information.Obviously, in actual application, except including required content in language profile, it is also possible to bag Include other guide, such as version, coded system etc..
Preferably, in the solution of the present invention, language profile can be from using self-defining xml (extensible Markup language, extensible markup language) form, such as:
<?Xml version=" 1.0 " encoding=" utf-8 "?>
<resource>
<string id="control id information"name="control description">Control text message text</string>
</resource>
Wherein, id information in space is the Text Flag of test item;Control text message is that test item is at language profile Text message corresponding under affiliated language.
In the solution of the present invention, use the definition of xml format language configuration file succinct, and be easy to user and enter as required Row amendment extension.By language profile, the Text Flag of input test item, this test item the most exportable configures at this language Text message corresponding under language corresponding to file, enormously simplify the design of program, shortens the process of exploitation, it is easy to reason Solve.
It is considered that during actual development, automatic test may relate to multiple product or system, and these produce The coded system of product or system is not necessarily consistent, and such as Chinese information processing system uses GBK coded system, and Chinese-traditional system uses BIG5 Coded system.Therefore, in actual application, automatic test course has also related to the conversion of coding.
In the solution of the present invention, in order to further speed up automatic test, unified coded system can be used, such as, The coded system of utf-8.The literal code mode of the text message that test item is corresponding under object language is utf-8 coding staff Formula.We obtain inconsistent coded format from different products, but after all of literal code arrives native system, all adopt Use utf-8 coded system.So being conducive to the writing of program, it is to avoid the confusion of coded system, logic becomes apparent from, improve and survey Examination efficiency.
In the solution of the present invention, Text Flag acquiring unit 302 can support that two ways is to obtain the text mark of test item Knowing, if Text Flag acquiring unit 302 identifies Text Flag based on referenced text information, the most as shown in fig. 4 a, the present invention carries The Text Flag acquiring unit 302 of confession specifically may include that text obtains subelement 401, subelement 402 is searched in configuration and mark Determine subelement 403.
Wherein, text obtains subelement 401 for obtaining the referenced text information that test item is corresponding;Subelement is searched in configuration 402 for identifying the language of referenced text information, and transfers the language profile corresponding to the language identified;Mark determines Subelement 403 finds out the literary composition corresponding to referenced text information for searching the language profile that subelement is transferred from configuration This mark, and as the Text Flag of test item.
Specifically, in the case of tester is unfamiliar with the Text Flag of test item, test item can be obtained in target Text message corresponding under language beyond language is as the referenced text information of the Text Flag for identifying test item.Example As, it is to look for English window to test, the text message conduct that this window is corresponding under simplified form of Chinese Character can be obtained in advance Referenced text information.Or, the referenced text information that test item that tester directly inputs is corresponding can be directly received.
Wherein, if the literal code mode of the text message of the storage in language profile is utf-8 coded system, then After obtaining the referenced text information that test item is corresponding, it is also possible to the literal code mode of the referenced text information of acquisition is united One is utf-8 coded system, in order to follow-up prompt operation.
Specifically, as shown in Figure 4 b, Text Flag acquiring unit 302 is except including: text obtains subelement 401, configuration Search subelement 402, mark determines subelement 403, it is also possible to farther include: the unified subelement 404 of coding.
The unified subelement 404 of coding for obtaining the literal code of the referenced text information that subelement 401 obtains by text Mode is unified for utf-8 coded system.
It is considered that be previously stored with each self-corresponding language profile of various language in test frame, and language Configuration file stores the Text Flag of test item, and the text message that test item is corresponding under this language, and test Corresponding relation between Text Flag and the text message of item.
Therefore, in the solution of the present invention, in order to obtain the Text Flag of test item, subelement 402 is searched in configuration can be right Text obtains the referenced text information of subelement acquisition and is identified, and identifies the language of referenced text information;Then, transfer out Language profile corresponding to the language of referenced text information.
Then, mark determines that subelement 403 can travel through configuration and search the language profile that subelement is transferred out, searches Whether there is the text language consistent with referenced text information;If existing, then can further search for out text language institute right The Text Flag answered, i.e. Text Flag corresponding to referenced text information.In actual application, corresponding to the text language found out Text Flag point to unique test item, the Text Flag i.e. found out is the Text Flag of test item.
In the solution of the present invention, the concrete function of the subelement under each unit in automatic test device, and unit Realize, be referred to implementing of each step in automated testing method, do not repeat them here.
, owing to there is test item in test frame at language (mesh to be tested in the automatic test scheme that the present invention provides Poster say) corresponding to language profile, so, at multilingual product or the language to be tested of multilingual test environment With the language of test frame inconsistent in the case of, it is also possible to obtain test item under object language for completing automatic test Text message.Different test frames is used individually to test compared to the existing different language for multilingual product, The automatic test scheme that the present invention provides can support the test of the polyglot of multilingual product, simplifies testing process, carries High testing efficiency.
Those skilled in the art of the present technique be appreciated that can with computer program instructions realize these structure charts and/or The combination of the frame in each frame in block diagram and/or flow graph and these structure charts and/or block diagram and/or flow graph.This technology is led Field technique personnel be appreciated that these computer program instructions can be supplied to general purpose computer, special purpose computer or other The processor of programmable data processing method realizes, thus by computer or the process of other programmable data processing methods Device performs the scheme specified in structure chart disclosed by the invention and/or block diagram and/or the frame of flow graph or multiple frame.
Those skilled in the art of the present technique be appreciated that the various operations discussed in the present invention, method, in flow process Step, measure, scheme can be replaced, changed, combined or deleted.Further, there is discussed in the present invention each Other steps in kind operation, method, flow process, measure, scheme can also be replaced, changed, reset, decomposed, combined or deleted. Further, of the prior art have and the step in the various operations disclosed in the present invention, method, flow process, measure, scheme Can also be replaced, changed, reset, decomposed, combined or deleted.
The above is only the some embodiments of the present invention, it is noted that for the ordinary skill people of the art For Yuan, under the premise without departing from the principles of the invention, it is also possible to make some improvements and modifications, these improvements and modifications also should It is considered as protection scope of the present invention.

Claims (10)

1. an automated testing method, it is characterised in that including:
Obtain the object language of test item, and the Text Flag of described test item;
Transfer the language profile corresponding to the object language of described test item;
According to described Text Flag, from the language profile transferred, extract described test item corresponding under described object language Text message;
The automatic test of described test item is completed according to the text message extracted.
Method the most according to claim 1, it is characterised in that the Text Flag of described test item is inputted by user, or
Obtain in the following way:
Obtain the referenced text information that test item is corresponding;
Identify the language of described referenced text information, and transfer the language profile corresponding to the language identified;
The Text Flag corresponding to described referenced text information is found out from this language profile, and as described test item Text Flag.
Method the most according to claim 1, it is characterised in that the language configuration corresponding to the object language of described test item Language profile corresponding to the object language of the test item that file is specially pre-configured with;And/or by described test item The language profile that source code generates.
4. according to the arbitrary described method of claim 1-3, it is characterised in that described test item belongs to multilingual product, multi-lingual At least one in the test environment of speech.
Method the most according to claim 4, it is characterised in that described test item is specially the test item of multilingual product Time, the Text Flag of described test item points to the click event of multilingual product, logical judgment, software window lookup or system At least one in window lookup.
6. an automatic test device, it is characterised in that including:
Object language acquiring unit, for obtaining the object language of test item;
Text Flag acquiring unit, for obtaining the Text Flag of described test item;
Configuration file transfers unit, for transferring the language profile corresponding to object language of described test item;
Text message searches unit, and the Text Flag of the test item for obtaining according to described Text Flag acquiring unit, from institute State configuration file to transfer the language profile that unit is transferred extracts the literary composition that described test item is corresponding under described object language This information;
Automatic test unit, for searching, according to text message, test item correspondence under described object language that unit extracts Text message carry out automatic test.
Automatic test device the most according to claim 6, it is characterised in that described Text Flag acquiring unit specifically wraps Include:
Text obtains subelement, for obtaining the referenced text information that test item is corresponding;
Subelement is searched in configuration, for identifying the language of described referenced text information, and transfers corresponding to the language identified Language profile;
Mark determines subelement, finds out referenced text information for searching the language profile that subelement is transferred from configuration Corresponding Text Flag, and as the Text Flag of described test item.
Automatic test device the most according to claim 6, it is characterised in that corresponding to the object language of described test item The language profile corresponding to object language of test item that is specially pre-configured with of language profile;And/or by institute State the language profile that the source code of test item generates.
Automatic test device the most according to claim 6, it is characterised in that described test item is under described object language The literal code mode of corresponding text message is utf-8 coded system.
10. according to the arbitrary described automatic test device of claim 6-9, it is characterised in that described test item belongs to multi-lingual At least one in speech product, multilingual test environment.
CN201610702138.5A 2016-08-22 2016-08-22 Automated testing method and device Pending CN106294178A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610702138.5A CN106294178A (en) 2016-08-22 2016-08-22 Automated testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610702138.5A CN106294178A (en) 2016-08-22 2016-08-22 Automated testing method and device

Publications (1)

Publication Number Publication Date
CN106294178A true CN106294178A (en) 2017-01-04

Family

ID=57661120

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610702138.5A Pending CN106294178A (en) 2016-08-22 2016-08-22 Automated testing method and device

Country Status (1)

Country Link
CN (1) CN106294178A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107315681A (en) * 2017-06-09 2017-11-03 上海爱优威软件开发有限公司 Application program self-starting test system, medium and method
CN108768764A (en) * 2018-05-08 2018-11-06 四川斐讯信息技术有限公司 A kind of router test method and device
CN109634872A (en) * 2019-02-25 2019-04-16 北京达佳互联信息技术有限公司 Application testing method, device, terminal and storage medium
CN111324535A (en) * 2020-02-18 2020-06-23 腾讯科技(深圳)有限公司 Control abnormity detection method and device and computer equipment
CN112131869A (en) * 2020-09-02 2020-12-25 苏州好玩友网络科技有限公司 Multi-language-based text detection method and device
CN112633118A (en) * 2020-12-18 2021-04-09 上海眼控科技股份有限公司 Text information extraction method, equipment and storage medium
CN112882947A (en) * 2021-03-15 2021-06-01 深圳市腾讯信息技术有限公司 Interface test method, device, equipment and storage medium
CN113268416A (en) * 2021-05-17 2021-08-17 深圳Tcl新技术有限公司 Application program testing method and device, storage medium and terminal
CN113515443A (en) * 2021-04-21 2021-10-19 深圳市康冠商用科技有限公司 Multi-language automatic checking method, device, computer equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070061113A1 (en) * 2005-08-25 2007-03-15 International Business Machines Corporation Enabling Test Script Play Back in Different Locales
CN101369249A (en) * 2007-08-14 2009-02-18 国际商业机器公司 Method and apparatus for marking GUI component of software
CN101916192A (en) * 2010-09-14 2010-12-15 深圳市华力特电气股份有限公司 Multi-language switching method and device for user interface
CN102289376A (en) * 2011-09-16 2011-12-21 烽火通信科技股份有限公司 Embedded multi-language WEB page realization method and system
CN102957773A (en) * 2011-08-29 2013-03-06 比亚迪股份有限公司 Mobile phone software testing method and mobile phone software testing system
CN105760293A (en) * 2014-12-19 2016-07-13 博雅网络游戏开发(深圳)有限公司 Multi-language platform test method and multi-language platform test system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070061113A1 (en) * 2005-08-25 2007-03-15 International Business Machines Corporation Enabling Test Script Play Back in Different Locales
CN101369249A (en) * 2007-08-14 2009-02-18 国际商业机器公司 Method and apparatus for marking GUI component of software
CN101916192A (en) * 2010-09-14 2010-12-15 深圳市华力特电气股份有限公司 Multi-language switching method and device for user interface
CN102957773A (en) * 2011-08-29 2013-03-06 比亚迪股份有限公司 Mobile phone software testing method and mobile phone software testing system
CN102289376A (en) * 2011-09-16 2011-12-21 烽火通信科技股份有限公司 Embedded multi-language WEB page realization method and system
CN105760293A (en) * 2014-12-19 2016-07-13 博雅网络游戏开发(深圳)有限公司 Multi-language platform test method and multi-language platform test system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
何浩: "基于XML的UI测试工具的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107315681A (en) * 2017-06-09 2017-11-03 上海爱优威软件开发有限公司 Application program self-starting test system, medium and method
CN108768764A (en) * 2018-05-08 2018-11-06 四川斐讯信息技术有限公司 A kind of router test method and device
CN109634872A (en) * 2019-02-25 2019-04-16 北京达佳互联信息技术有限公司 Application testing method, device, terminal and storage medium
CN109634872B (en) * 2019-02-25 2023-03-10 北京达佳互联信息技术有限公司 Application testing method, device, terminal and storage medium
CN111324535A (en) * 2020-02-18 2020-06-23 腾讯科技(深圳)有限公司 Control abnormity detection method and device and computer equipment
CN111324535B (en) * 2020-02-18 2022-02-25 腾讯科技(深圳)有限公司 Control abnormity detection method and device and computer equipment
CN112131869A (en) * 2020-09-02 2020-12-25 苏州好玩友网络科技有限公司 Multi-language-based text detection method and device
CN112131869B (en) * 2020-09-02 2021-09-10 苏州好玩友网络科技有限公司 Multi-language-based text detection method and device
CN112633118A (en) * 2020-12-18 2021-04-09 上海眼控科技股份有限公司 Text information extraction method, equipment and storage medium
CN112882947A (en) * 2021-03-15 2021-06-01 深圳市腾讯信息技术有限公司 Interface test method, device, equipment and storage medium
CN113515443A (en) * 2021-04-21 2021-10-19 深圳市康冠商用科技有限公司 Multi-language automatic checking method, device, computer equipment and storage medium
CN113268416A (en) * 2021-05-17 2021-08-17 深圳Tcl新技术有限公司 Application program testing method and device, storage medium and terminal

Similar Documents

Publication Publication Date Title
CN106294178A (en) Automated testing method and device
EP3848823A1 (en) Method and apparatus for extracting poi name, device, and computer storage medium
CN103324613A (en) System and method for automatic language translation for applications
CN102236423B (en) A kind of method that character supplements automatically, device and input method system
CN106202066A (en) The interpretation method of website and device
CN106294184A (en) The graphical creation method of test scene, device and terminal unit
CN111753064A (en) Man-machine interaction method and device
JP5529092B2 (en) Note data translation apparatus, note data translation method, and note data translation program
CN106126713A (en) Wearable device and synchronous applications message display method thereof
US20150106701A1 (en) Input support method and information processing system
KR20210145811A (en) Methods, devices, devices and computer recording media for retrieving geographic locations
US20130332477A1 (en) Record creating support apparatus and method
JP6378263B2 (en) Translation method using image, user terminal, server, system, and computer program
CN103793321B (en) application program detection method and system
CN105637912A (en) Method and system for conversion of smart phone applications to basic phone applications
JPH10171810A (en) Communication system handling multilanguage
US20220207047A1 (en) Data processing system and method
KR101734533B1 (en) Method for providing news of multi-nations
CN105989046A (en) Website display method and system and user terminal
CN105808628A (en) Webpage transcoding method, apparatus and system
CN110516174A (en) The method, apparatus and storage medium of text are obtained based on Simple Syndication
Nieto Acevedo et al. Gis model of analysis to promote tourism through the use of a web application
CN111949748A (en) Multilingual intelligent translation electronic map system
US20110061024A1 (en) Electronic device and method for accessing weather information
US20190019054A1 (en) Contact Information Identification System

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170104

RJ01 Rejection of invention patent application after publication