WO2018010552A1 - 测试方法和装置 - Google Patents

测试方法和装置 Download PDF

Info

Publication number
WO2018010552A1
WO2018010552A1 PCT/CN2017/090999 CN2017090999W WO2018010552A1 WO 2018010552 A1 WO2018010552 A1 WO 2018010552A1 CN 2017090999 W CN2017090999 W CN 2017090999W WO 2018010552 A1 WO2018010552 A1 WO 2018010552A1
Authority
WO
WIPO (PCT)
Prior art keywords
test
tested
component
case
steps
Prior art date
Application number
PCT/CN2017/090999
Other languages
English (en)
French (fr)
Inventor
刘宗梁
唐甜甜
Original Assignee
博彦科技股份有限公司
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 博彦科技股份有限公司 filed Critical 博彦科技股份有限公司
Publication of WO2018010552A1 publication Critical patent/WO2018010552A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Definitions

  • the present invention relates to the field of testing, and in particular to a test method and apparatus.
  • white box test In the current test, including white box test, gray box test and black box test, white box test generally requires software developers to carry out the test, the code is written to test the completed code.
  • the black box test is to test the function of the software according to the requirements of the functional test without the need to understand the software code.
  • the gray box test is based on a white box test and a black box test.
  • the black box test needs to be performed manually.
  • the function to be tested is written in advance, and then the tester performs the step by step according to the written steps, manually operates the software, and then manually checks the response and function, performance or The quality of the user interface.
  • the operation process and the inspection process are all completed manually, and the results are manually recorded to generate a test report. If the feature does not pass, the test fails. When the test fails, the test result is recorded, and the bug is reported. This full manual test is time consuming and laborious, and is also prone to error.
  • test script test method there is also a recording software that can record a person's operation action and then replay the action, so that a certain test action can be repeated.
  • this recording test method is limited by the machine of the recorded script during playback, and it is difficult to replay on another machine; or the action represented by the recorded script itself is not repeatable, resulting in the script being not reusable.
  • Testers can also develop test scripts to automate part of the test by writing test scripts.
  • the preparation of test scripts requires testers to have basic programming knowledge. In general, non-automated testers do not have such skills. Automation engineers are costly, and script development and maintenance itself requires a lot of manpower, physics, financial resources, and costs. A lot of time, the versatility of the test object when the change is not guaranteed, and so on, thus limiting the use of the test script test method.
  • the embodiments of the present invention provide a testing method and apparatus to solve at least the problems caused by the programming ability of the tester in the prior art using the programming script for automatic testing.
  • a test method including: acquiring a test case consisting of one or more test templates, wherein the test template is pre-edited, and the test template includes one or a plurality of test steps, the operations performed on the object to be tested, some or all of the one or more test steps being described in a natural language; the natural language and machine language correspondence
  • the test step in the test case is translated into a machine language, wherein the machine language is a language that the machine can recognize and execute; the test case is executed on the object to be tested using the machine language; and the test result is recorded, wherein
  • the test result includes at least one of the following: a test result obtained by executing the test case, a test result obtained by executing the test template, and a test result obtained by performing the test step.
  • the method further includes: providing the one or more natural language descriptions for the user to select; receiving one or more test steps selected by the user and an order of the one or more test steps; The selected one or more test steps form a test template in the stated order.
  • the method further includes: receiving the permission information set by the user, where the permission information is used to identify the permission of the other user to the test template; and receiving the request of the other user for the test template, according to the permission information. Controlling the operation of the test template by the other users.
  • translating the test step in the test case into a machine language includes: acquiring a parameter, and transmitting the parameter to a corresponding test step and translating In machine language, wherein the parameter includes at least one of the following: data used for testing, to be tested The component being tested, controlling the actions performed by the component to be tested.
  • the step of transmitting the parameter to the corresponding testing step includes: finding a corresponding component to be tested according to the information of the component to be tested, and The component to be tested is passed to the corresponding test step.
  • searching for the corresponding component to be tested according to the information of the component to be tested includes at least one of the following: in case the information of the component to be tested includes the identifier of the component to be tested, according to the component to be tested Identifying a component to be tested according to the path of the component to be tested, and searching for a component to be tested according to the path of the component to be tested; If the information includes the text description of the component to be tested, the search is performed according to the text description and matched to the corresponding component to be tested.
  • the searching and matching to the corresponding component to be tested according to the text description includes at least one of: searching for a character or a picture in the object to be tested that matches the text description exceeding a threshold, and searching for the distance a component within a predetermined range of characters as the component to be tested; searching for a character or a picture matching the text description in the annotation information in the object to be tested, and finding a character whose matching degree with the text description exceeds a threshold or An annotation information of the image, the component corresponding to the annotation information is used as the component to be tested; searching for a placeholder in the placeholder of the component to be tested that matches the text description exceeds a threshold, and The component corresponding to the placeholder is used as the component to be tested; and the corresponding component is searched for as the component to be tested according to the layout relationship and the text description of the component of the test object.
  • recording the test results includes recording a process of performing each test step in the test case and a result of performing each of the test steps.
  • recording each of the test cases in the execution of the test case comprises: taking a screenshot of performing the test step and performing saving when each test step is performed.
  • the method further includes: displaying at least one of the following on the screenshot: a natural language description corresponding to the test step to be performed, a result corresponding to performing the test step, and a time for executing the test step .
  • the method further comprises: comparing the test result with a preset test result, and determining whether the test passes according to the comparison result.
  • the method further includes: recording the test result, the testing step, and an intermediate file generated during the testing.
  • the object to be tested includes one of the following: a user interface, a client software, a server software, Hardware drivers, applications on the operating system, operating systems.
  • a testing apparatus comprising: an obtaining module, configured to acquire a test case composed of one or more test templates, wherein the test template is pre-edited, The test template includes one or more test steps, the test step is an operation performed on the object to be tested, some or all of the one or more test steps are described in a natural language; the translation module is Provided to translate a test step in the test case into a machine language by a correspondence between a natural language and a machine language, wherein the machine language is a language that the machine can recognize and execute; an execution module configured to use the machine The language executes the test case on the object to be tested; the record module is configured to record a test result, wherein the test result includes at least one of: performing a test result obtained by the test case, and executing the test template The obtained test result, the test result obtained by performing the test step.
  • test case consisting of one or more test templates
  • the test template includes one or more test steps
  • the test step is an operation performed on the object to be tested, and one or more tests are performed.
  • Some or all of the steps are described in natural language; the test steps in the test case are translated into machine language by the correspondence between natural language and machine language, wherein the machine language is a language that the machine can recognize and execute; using machine language Execute test cases for the test object; record the test results.
  • test cases can be written in natural language, and test cases can be created through pre-edited templates. Since the use cases themselves can be directly executed, the steps of script development in the automated test process are eliminated. The problem of causing the tester to have programming ability in the prior art by using the scripting method for automatic testing is solved by the present application.
  • FIG. 1 is a flow chart of a test method in accordance with an embodiment of the present application.
  • FIG. 2 is a block diagram showing the structure of a test apparatus according to an embodiment of the present application.
  • FIG. 1 is a structural block diagram of a test method according to an embodiment of the present application. As shown in FIG. 1 , the process includes the following steps:
  • Step S102 Acquire a test case consisting of one or more test templates, where the test template is pre-edited, and the test template includes one or more test steps, and the test step is an operation performed on the object to be tested. Some or all of the one or more test steps are described in natural language;
  • Step S104 translating the test step in the test case into a machine language by a correspondence between a natural language and a machine language, wherein the machine language is a language that the machine can recognize and execute; and using the machine language to execute the object to be tested Test case
  • step S106 the test result is recorded, wherein the test result includes at least one of the following: a test result obtained by executing the test case, a test result obtained by executing the test template, and a test result obtained by executing the test step.
  • the tester can use the natural language to perform the editing test step, which can be edited in a natural language, which makes the editing of the test case easier.
  • the correspondence between these natural and machine languages can be pre-stored, then the natural language is provided to the tester, and the tester uses the natural language provided for editing. After editing the test case, submit the edited test case.
  • the test case is executed, the natural language is translated into machine language according to the correspondence between the pre-stored natural language and the machine language.
  • the machine language can be executed directly, so that after the test case is edited, the test case can also be executed. Since the use case itself can be executed, the above steps can be used for automated testing without the need to understand the programming language, thereby solving the problem that the prior art uses the script to perform automated testing, which requires the tester to have programming capability.
  • the problem is to promote the automation side.
  • test step can be saved because the test step may be used by other testers.
  • Multiple test steps can be done to test a function, if the function may be reused, or the function is the basis of another function, another function
  • the test can be done first by testing the first function, and you can save these test steps into a test template.
  • This test template can be called.
  • multiple test steps in the login function can be written as a test template, called "login.”
  • login When you need to test the function of modifying user data, you need to log in first. In this case, you can first call the "login" template, then use the natural language to edit the "modify user data" test step, and you can also modify the user data.
  • the test step is saved as another test template. With such a configuration, the reuse of test templates can be achieved.
  • test steps there is a better effect. Because the test steps, test templates, and test cases are distinguished, different dimensions can be selected to record the test results when recording the test results. You can record the test results of each test step, or you can record the test results of a test template, and also record the test results of the entire test case.
  • the test case may consist of one or more test templates, and may also include test templates and test steps; or test cases may be saved for use in the next test.
  • the above steps can be performed by a single computer, and the above test method can be made into a software.
  • the software can be a stand-alone version.
  • the software can be run on a computer, and then the user is prompted to support the natural language. And, the use hint of the natural language is given, and after the user edits the test case, it can be executed on the computer.
  • the test case can be exported to another computer installed on the software so that it can be executed.
  • the foregoing steps can be implemented by the BS architecture, and the user can use the browser webpage. Then, the user can edit the test step, edit the test template, edit the test case, select the test step, and select the test template on the webpage. Select a test case. After completing the editing or selection of the test case, submit it to the server in the background, and then the server can realize the transition from natural language to machine language. After getting the machine language, the server can execute the machine language. It is advantageous to implement through the BS architecture. Different users do not need to install any application on their own computers, and they can access them for testing through a browser. Moreover, all user test steps, test templates and test cases can be saved on the server, so you do not need to export test cases, you can directly test.
  • the server can be set up inside the company for testing by internal staff. Or you can set the server on the public network server. Different companies can have their own independent accounts, and give their testers to assign accounts.
  • the test method of the above steps is relatively easy to test the website and the webpage. It is assumed that the website www.testtesttesttest.com needs to be tested. As long as the use case is edited, the server can test on the website, and the test result can be retained after the test is completed.
  • test method of the above steps can also be used to test the software of the server.
  • the software of the server can be installed on a test computer, and then the network address used by the server on the test computer is set through the webpage. The test case is then executed at the server on the computer through the network address.
  • such a BS-based test tool can also be used for editing and managing test cases.
  • the user can also edit the correspondence between natural language and machine language, so that the machine language can be expressed in a natural language that is easier to use. In this way, the user can set the correspondence between the machine language and the natural language according to his own needs.
  • the logical relationship of the test step execution can also be provided. If there are multiple test steps in the test case, the test steps can be set to run in parallel; or the test steps can be performed in a certain order. run. Parallel operation can also be understood as a sequence.
  • the machine language can be a scripting language, and the scripting language itself is executed in order.
  • the machine language can also be a language including logical relationships.
  • This logical relationship can also be reflected in the user's editing of the test steps. For example, the logical relationship is expressed in a comparative image for the user to select. The user can select the test steps that need to be performed. On the other hand, the user can also choose to perform the logical relationship of the test step.
  • the embodiment of this logical relationship can also be reflected in the test template, or on the test case.
  • one or more test steps of a natural language description may be provided for the user to select; one or more test steps selected by the user and the sequence of the one or more test steps; one or more tests selected by the user
  • the steps form a test template in this order.
  • you need to test 5 users at the same time you can call the test template five times in parallel, so you can complete the parallel test. If you need to, you can store this as a test case, you can name it. For "parallel login.” If you need to test to log in 5 users at the same time, and then test and then exit, you can first call the "parallel login" test case, and then serially call the exit test template.
  • the exited test template can include multiple test steps.
  • the user can set the permission information.
  • This permission information is used to identify other users' permissions to the test template. If the permission information is set, when receiving the request of the other user for the test template, the operation of the test template by other users may be controlled according to the permission information.
  • Test templates can be set with different permissions. As an optional embodiment, you can also set different permissions for test cases. As another optional embodiment, if the user can edit the correspondence between the natural language and the machine language by himself, the test case edited by the user himself can also set different permissions.
  • test step it is sometimes necessary to enter parameters in the test step, or to find the component to be tested, or to input the action performed by the component to be tested.
  • separation of input parameters, test components, and actions performed by the test components may be implemented, and parameters and groups may be separately set. The actions performed by the component and the component, thereby realizing the separation of parameters, components, and actions.
  • translating the test step in the test case into a machine language includes: obtaining a parameter and passing the parameter to the corresponding test step and translating into a machine language, wherein The parameter includes at least one of the following: data used by the test, a component to be tested, and an action performed to control the component to be tested.
  • the component can be directly specified, but in some cases, the component cannot be found. In this case, some component information can be provided.
  • the server provides the service for finding the component, and automatically finds the test according to the component information.
  • Component That is, if the parameter includes the information of the component to be tested, the step of transmitting the parameter to the corresponding testing step includes: finding a corresponding component to be tested according to the information of the component to be tested, and transmitting the component to be tested to the corresponding component. Test steps.
  • the following example shows how to find the test component based on these parameters. These examples can be used in combination or separately.
  • the information of the component to be tested includes the identifier of the component to be tested
  • the situation is relatively straightforward, as long as the corresponding component to be tested is searched according to the identifier of the component to be tested. For example, if you need to find a component with ID 3, you can look up the ID directly in the object under test.
  • the path of the component can also be directly given.
  • the information of the component to be tested includes the path of the component to be tested, Find the corresponding component to be tested according to the path of the component to be tested.
  • the tester can generally know the text description of the test component. If the information of the component to be tested includes the text description of the component to be tested, the search is performed according to the text description and matched to the corresponding component to be tested.
  • the placeholder may be a default display.
  • the text in a text box or input box for example, in a certain input box, the user is required to input the name of some place, then the content of the placeholder may be the name of a region such as "Beijing".
  • the user enters the place name he wants, the words Beijing are replaced.
  • the content of these placeholders can also be used as the retrieved content.
  • Finding the corresponding component as the component to be tested according to the layout relationship and the text description of the component of the test object For example, if you want to delete a user A from the test object's UI at the time of testing, you need to click the delete button. However, there are multiple users in the UI: User A, User B, User C, etc. Each user is followed by a delete button. At this point, you can look for user A. According to the layout relationship, there is a certain layout relationship with user A. The delete button is used to delete user A.
  • test results you can simply record the final test results.
  • process of executing each of the test steps in the test case and the results of performing each of the test steps can also be recorded.
  • a screenshot can be taken, that is, when each test step is executed, a screenshot of the execution of the test step is intercepted and saved.
  • At least one of the following is displayed on the screenshot: a natural language description corresponding to the test step to be performed, a result corresponding to the execution of the test step, and a time at which the test step is performed.
  • the comparison of the test results can also be automatically performed by using a machine.
  • the method further includes: comparing the test result with a preset expected test result, and determining whether the test passes according to the comparison result. .
  • the method may also record the test result, the test step, and an intermediate file generated during the test.
  • This embodiment can be tested by software or by hardware.
  • the object to be tested includes one of the following: user interface UI (for example, web page), client software, server software, hardware driver, and operating system.
  • Application operating system.
  • the preferred embodiment of this embodiment is a test of a BS-based website.
  • the user interface can also include various interfaces of various smart devices, for example, a UI suitable for use in a mobile phone, or a UI to which various APPs in a mobile phone are applicable.
  • the smart device is not limited to a mobile phone, and the UI of various smart devices can be tested by applying the test method in the embodiment or the test device below.
  • FIG. 2 is a structural block diagram of a test device according to an embodiment of the present invention. As shown in FIG. 2, the test device includes:
  • the obtaining module 22 is configured to obtain a test case composed of one or more test templates, wherein the test template is pre-edited, and the test template includes one or more test steps, where the test step is for the object to be tested The operation performed, some or all of the one or more test steps are described in natural language;
  • the translation module 24 is configured to translate the test steps in the test case into a machine language by a correspondence between a natural language and a machine language, wherein the machine language is a language that the machine can recognize and execute;
  • the execution module 26 is configured to execute the test case for the object to be tested using the machine language
  • the recording module 28 is configured to record the test result, wherein the test result includes at least one of the following: a test result obtained by executing the test case, a test result obtained by executing the test template, and a test result obtained by executing the test step.
  • Such a module or unit in the device embodiment can be considered as a kind of software, which can be stored in the storage device or can be executed in the CPU.
  • the automated test system in this embodiment can implement the following functions:
  • the background automatically generates a complete set of code to run the test process
  • the background of the integrated test environment is background, users do not have to set up an automated environment by themselves, saving a lot of time;
  • test scenario is designed by the test case template and the test data module, and
  • the live test case reuse mechanism avoids the drawbacks of the previous record scripts that are not reusable.
  • the range covered in the automated test system can be selected according to the needs of the specific conditions of the product. frequency. It is also possible to run test cases of different platforms at the same time according to the product requirements of different platforms.
  • the automated test system is suitable for a wide range of products with different sizes of functional modules and different product cycles. It is the most economical and efficient automated test solution. There are many tools for automated test systems that can be automated in the physical automation framework that is available for each product, without relying solely on one tool. .
  • the disclosed technical contents may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or otherwise.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a computer device which may be a personal computer, server or network device, etc.
  • the foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .

Abstract

一种测试方法和装置,该方法包括:获取由一个或多个测试模板构成的测试用例,其中,测试模板中包括一个或多个测试步骤,测试步骤为对待测试对象所进行的操作,一个或多个测试步骤中的部分或者全部是用自然语言描述的;通过自然语言与机器语言的对应关系将测试用例中的测试步骤翻译成机器语言,其中,机器语言是机器能够识别并执行的语言;使用机器语言对待测试对象执行测试用例;记录测试结果。使用自然语言来编写测试用例,通过预先编辑的模板来创建测试用例,由于用例本身是可以直接执行的,从而省去了自动化测试过程中脚本开发的步骤,解决现有技术中使用编制脚本进行自动化测试需要测试人员具有编程能力而导致的问题。

Description

测试方法和装置
本申请要求于2016年07月12日提交中国专利局、申请号为201610547984.4、发明名称“测试方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及测试领域,具体而言,涉及一种测试方法和装置。
背景技术
随着技术的发展各种软件产品越来越多。尤其是随着互联网+时代到来,各种互联网产品也与日俱增,极大的方便了现代都市人的生活、商业和工作。互联网产品越来越普及到每个人的生活的点点滴滴,每天都有软件产品投入市场,随着各种需求的增加,已经上市的产品也在不停迭代更新加入新元素。
这些各种各样的软件在投入市场以前,都会有专门的产品质量检测过程。这些检测过程,会涉及到需要检查软件能否正常实现其功能和用户界面完整性。为了使用户对软件产品有较高的满意度,各软件开发商在软件质量测试环节投入了大量的人力和物力。
在目前的测试中,包括白盒测试、灰盒测试和黑盒测试,白盒测试一般情况下需要软件开发人员来进行,是通过代码的编写对已经完成的代码进行测试。黑盒测试是测试人员在不需要了解软件代码的情况下,根据功能测试的需求,对软件的功能进行测试。灰盒测试基于白盒测试和黑盒测试之间。
目前,黑盒测试需要靠人工来进行,一般提前写好需要测试的功能,然后由测试人员按照写好的步骤,一步一步进行执行,人工操作软件,再人工检查软件的响应和功能、性能或者用户界面的质量。操作过程和检查过程全部由人工完成,人工记录结果,生成测试报告。如果该功能没有通过,则该测试失败。在测试失败则记录测试结果,并且上报Bug,这种全人工测试耗时耗力,还容易出错。
这种人工测试的方式比较耗费人力,对企业来说成本比较高。而且人力测试有一些人为的因素,可以受到测试人员的工作状态影响。
在现有技术中,也有一种录制软件,该录制软件可以录制人的操作动作,然后对该动作进行重放,这样可以重复某种测试动作。但是这种录制测试方式在重放的时候受到录制的脚本的机器的限制,难以在另一台机器重放;或者是录制的脚本代表的动作本身就是不可重复的,导致脚本不具备可重用性。测试人员还可以编制测试脚本,通过编制测试脚本从而实现测试的部分自动化。但是,编制测试脚本需要测试人员需要基本的编程知识,一般情况下,非自动化测试人员不具有这样的技能,自动化工程师成本高,脚本开发维护本身也需要占用大量的人力、物理、财力,并花费大量时间,在被测试对象产生变化时的通用性不能保证等等,从而限制了使用编制测试脚本测试方式的推广。
针对现有技术中使用编制脚本进行自动化测试需要测试人员具有编程能力而导致的问题,目前尚未提出有效的解决方案。
发明内容
本发明实施例提供了一种测试方法和装置,以至少解决现有技术中使用编制脚本进行自动化测试需要测试人员具有编程能力而导致的问题。
根据本发明实施例的一个方面,提供了一种测试方法,包括:获取由一个或多个测试模板构成的测试用例,其中,所述测试模板为预先编辑的,所述测试模板中包括一个或多个测试步骤,所述测试步骤为对待测试对象所进行的操作,所述一个或多个测试步骤中的部分或者全部是用自然语言描述的;通过自然语言与机器语言的对应关系将所述测试用例中的测试步骤翻译成机器语言,其中,所述机器语言是机器能够识别并执行的语言;使用所述机器语言对所述待测试对象执行所述测试用例;记录测试结果,其中,所述测试结果包括以下至少之一:执行所述测试用例得到的测试结果、执行所述测试模板得到的测试结果、执行所述测试步骤得到的测试结果。
进一步地,还包括:提供一个或多个自然语言描述的所述测试步骤供用户进行选择;接收用户选择的一个或多个测试步骤以及所述一个或多个测试步骤的顺序;将所述用户选择的一个或多个测试步骤按照所述顺序构成测试模板。
进一步地,还包括:接收用户设置的权限信息,其中,所述权限信息用于标识其他用户对所述测试模板的权限;接收所述其他用户对所述测试模板的请求,根据所述权限信息控制所述其他用户对测试模板的操作。
进一步地,在所述测试用例中的测试步骤需要输入参数的情况下,将所述测试用例中的测试步骤翻译成机器语言包括:获取参数,并将所述参数传递给对应的测试步骤并翻译成机器语言,其中,所述参数包括以下至少之一:测试所使用的数据、待测 试的组件、控制所述待测试的组件所执行的动作。
进一步地,在所述参数包括所述待测试组件的信息的情况下,将上述参数传递给对应的测试步骤包括:根据所述待测试组件的信息查找到对应的待测试组件,并将所述待测试组件传递给对应的测试步骤。
进一步地,根据所述待测试组件的信息查找对应的待测试组件包括以下至少之一:在所述待测试组件的信息包括所述待测试组件的标识的情况下,根据所述待测试组件的标识查找对应的待测试组件;在所述待测试组件的信息包括所述待测试组件的路径的情况下,根据所述待测试组件的路径查找对应的待测试组件;在所述待测试组件的信息包括所述待测试组件的文字描述的情况下,根据所述文字描述进行检索并匹配到对应的待测试组件。
进一步地,根据所述文字描述进行检索并匹配到对应的待测试组件包括以下至少之一:在所述待测试对象中查找与所述文字描述匹配度超过阈值的字符或图片,查找距离所述字符预定范围内的组件作为所述待测试组件;在所述待测试对象中的注释信息中查找与所述文字描述匹配的字符或图片,查找到与所述文字描述匹配度超过阈值的字符或图片的注释信息,将该注释信息对应的组件作为所述待测试组件;在所述待测试对象中的组件的占位符中查找与所述文字描述匹配度超过阈值的占位符,将该占位符对应的组件作为所述待测试组件;根据所述测试对象的组件的布局关系和文字描述查找对应的组件作为所述待测试组件。
进一步地,记录所述测试结果包括:记录执行所述测试用例中每个测试步骤的过程以及执行所述每个测试步骤得到的结果。
进一步地,记录执行所述测试用例中的每个测试步骤包括:在执行每个测试步骤时,截取执行所述测试步骤的截图,并进行保存。
进一步地,所述方法还包括:将以下至少之一显示在所述截图上:将执行的所述测试步骤对应的自然语言描述、执行所述测试步骤对应的结果、执行所述测试步骤的时间。
进一步地,在记录所述测试结果之后,所述方法还包括:将所述测试结果与预先设置的预期测试结果进行比对,根据比对结果确定测试是否通过。
进一步地,在所述比对结果为测试不通过的情况下,所述方法还包括:将所述测试结果、所述测试步骤以及测试过程中产生的中间文件进行记录。
进一步地,所述待测试对象包括以下之一:用户界面、客户端软件、服务端软件、 硬件驱动程序、操作系统上的应用程序、操作系统。
根据本申请实施例的另一个方面,还提供了一种测试装置,包括:获取模块,被设置为获取由一个或多个测试模板构成的测试用例,其中,所述测试模板为预先编辑的,所述测试模板中包括一个或多个测试步骤,所述测试步骤为对待测试对象所进行的操作,所述一个或多个测试步骤中的部分或者全部是用自然语言描述的;翻译模块,被设置为通过自然语言与机器语言的对应关系将所述测试用例中的测试步骤翻译成机器语言,其中,所述机器语言是机器能够识别并执行的语言;执行模块,被设置为使用所述机器语言对所述待测试对象执行所述测试用例;记录模块,被设置为记录测试结果,其中,所述测试结果包括以下至少之一:执行所述测试用例得到的测试结果、执行所述测试模板得到的测试结果、执行所述测试步骤得到的测试结果。
通过本申请实施例,采用了获取由一个或多个测试模板构成的测试用例,其中,测试模板中包括一个或多个测试步骤,测试步骤为对待测试对象所进行的操作,一个或多个测试步骤中的部分或者全部是用自然语言描述的;通过自然语言与机器语言的对应关系将测试用例中的测试步骤翻译成机器语言,其中,机器语言是机器能够识别并执行的语言;使用机器语言对待测试对象执行测试用例;记录测试结果。通过本申请可以使用自然语言来编写测试用例,还可以通过预先编辑的模板来创建测试用例,由于用例本身是可以直接执行的,从而省去了自动化测试过程中脚本开发的步骤。通过本申请解决现有技术中使用编制脚本进行自动化测试需要测试人员具有编程能力而导致的问题。
说明书附图
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是根据本申请实施例的测试方法的流程图;
图2是根据本申请实施例的测试装置的结构框图。
具体实施方式
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于 本发明保护的范围。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
在本实施例中,提供了一种测试方法,图1是根据本申请实施例的测试方法的结构框图,如图1所示,该流程包括如下步骤:
步骤S102,获取由一个或多个测试模板构成的测试用例,其中,该测试模板为预先编辑的,该测试模板中包括一个或多个测试步骤,该测试步骤为对待测试对象所进行的操作,该一个或多个测试步骤中的部分或者全部是用自然语言描述的;
步骤S104,通过自然语言与机器语言的对应关系将该测试用例中的测试步骤翻译成机器语言,其中,该机器语言是机器能够识别并执行的语言;使用该机器语言对该待测试对象执行该测试用例;
步骤S106,记录测试结果,其中,该测试结果包括以下至少之一:执行该测试用例得到的测试结果、执行该测试模板得到的测试结果、执行该测试步骤得到的测试结果。
通过上述步骤,可以让测试人员使用自然语言来进行编辑测试步骤,该测试步骤由于可以使用自然语言来进行编辑,使测试用例的编辑更加简便。这些自然语言与机器语言的对应可以预先存储,然后将自然语言提供给测试人员,测试人员使用提供的自然语言来进行编辑。编辑完测试用例之后,提交编辑好的测试用例。在执行测试用例的时候,根据预先存储的自然语言与机器语言的对应关系,将自然语言翻译成机器语言。机器语言是可以直接执行的,从而在编辑完测试用例之后,该测试用例也可以执行。由于用例的本身是可以执行的,因此,通过上述步骤可以不需要懂编程语言的人就可以进行自动化测试,从而解决了现有技术中使用编制脚本进行自动化测试需要测试人员具有编程能力而导致的问题,推广了自动化侧。
在上述步骤,测试人员在使用自然语言编辑了测试步骤之后,由于该测试步骤可能被其他的测试人员使用,从而可以保存该测试步骤。多个测试步骤可以完成一个功能的测试,如果该功能可能被重复使用,或者该功能是另一个功能的基础,另一个功 能的测试需要首先完成对第一个功能的测试,此时可以将这些测试步骤存成一个测试模板。该测试模板可以被调用。例如,可以将登录功能中的多个测试步骤写成一个测试模板,称为是“登录”。当需要测试修改用户资料的功能时,需要首先进行登录,此时,可以首先调用“登录”的模板,然后再使用自然语言编辑“修改用户资料”的测试步骤,同时也可以将“修改用户资料”的测试步骤保存为另一个测试模板。通过这样的一个配置,可以做到测试模板的重复利用。
在上述步骤中,还有一个比较好的效果,由于区分了测试步骤、测试模板以及测试用例,在记录测试结果的时候,可以选择不同的维度来记录测试结果。可以记录每一个测试步骤的测试结果,也可以记录一个测试模板的测试结果,同时还可以记录整个测试用例的测试结果。
测试用例的构成可以包括一个或多个测试模板,也可以包括测试模板和测试步骤;或者,测试用例也可以进行保存,以供下次测试的时候使用。
上述的步骤可以由单个的计算机执行,可以将上述的测试方法做成一个软件,该软件可以为单机版,在测试的时候,可以在计算机上运行该软件,然后提示用户其支持的自然语言,并且,给出该自然语言的使用提示,在用户编辑完测试用例之后,可以在该计算机上执行。或者也可以将该测试用例导出到其他安装在该软件的计算机,从而可以执行。
在一个比较优的实施例中,可以BS架构来实现上述步骤,用户可以通过浏览器网页,然后,用户可以在网页上编辑测试步骤、编辑测试模板、编辑测试用例、选择测试步骤、选择测试模板、选择测试用例。在完成测试用例的编辑或者选择之后,提交到后台的服务器,然后服务器可以实现从自然语言到机器语言的转变的。得到机器语言之后,服务器可以执行该机器语言。通过BS架构来实现的是比较有优势的,不同的用户均不用在自己的计算机上安装任何的应用程序,只要通过浏览器就可以访问来进行测试。并且,所有用户的测试步骤、测试模板和测试用例均可以保存在服务器上,这样就不需要导出测试用例,直接进行测试就可以了。
在BS架构中,可以将服务器设置公司的内部,供公司内部人员的测试使用。或者也可以将服务器设置在公网服务器上,不同公司可以拥有自己独立的账号,并且,给自己的测试人员来分配账号。
上述步骤的测试方法是比较容易测试网站和网页的,假定需要测试www.testtesttesttest.com这个网站,只要编辑完用例,服务器就可以在该网站上进行测试,测试完毕之后保留测试结果就可以。
当然,上述步骤的测试方法也可以用来测试服务端的软件,此时服务端的软件可以安装在某一台测试计算机上,然后将测试计算机上的服务端用来提供的网络地址通过网页进行设置,然后在通过该网络地址在该计算机上的服务端执行测试用例。
在另外一个实施例中,也可以使用这种BS架构的测试工具来进行测试用例的编辑和管理。作为一个比较好的实施方式,用户也可以自己编辑自然语言与机器语言的对应关系,这样可以将机器语言使用较容易的自然语言进行表达。这样,用户可以根据自己的需要来设置机器语言和自然语言的对应关系。
在编辑测试用例的时候,还可以提供测试步骤执行的逻辑关系,如果测试用例中有多个测试步骤的时候,可以将这些测试步骤设置为并行运行;或者这些测试步骤也可以按照一定的顺序进行运行。并行运行也可以理解为一种顺序。需要说明的是,机器语言可以是一种脚本语言,脚本语言本身是按照顺序来执行的。机器语言还可以是包括逻辑关系的语言,这种逻辑关系也可以体现在用户对测试步骤的编辑上,例如,将这种逻辑关系用一种比较形象的关系表现出来供用户进行选择,一方面,用户可以选择需要执行的测试步骤,另一方面,用户还可以选择执行该测试步骤的逻辑关系。当然,这种逻辑关系的体现,也可以体现在测试模板上,或者是测试用例上。
例如,可以提供一个或多个自然语言描述的测试步骤供用户进行选择;接收用户选择的一个或多个测试步骤以及该一个或多个测试步骤的顺序;将该用户选择的一个或多个测试步骤按照该顺序构成测试模板。举一个形象的例子,在测试的是,需要测试同时登录5个用户,可以并行调用五次登录的测试模板,这样就完成了并行的测试,如果需要的话可以将此存储为测试用例,可以命名为“并行登录”。如果需要测试同时登录5个用户,然后再测试依次退出,可以首先调用“并行登录”测试用例,然后串行调用退出的测试模板。退出的测试模板可以包括多个测试步骤。
当有很多用户使用的该工具进行测试的时候,由于某些用户可能希望自己编辑的测试模板不能被其他的用户使用,此时,可以让用户设置权限信息。该权限信息用于标识其他用户对该测试模板的权限。如果设置了权限信息,在接收其他用户对该测试模板的请求的时候,可以根据该权限信息控制其他用户对测试模板的操作。测试模板可以设置不同的权限,作为一个可选的实施例,还可以为测试用例来设置不同的权限。作为另一个可选的实施例,如果用户可以自己编辑自然语言和机器语言的对应关系,此时用户自己编辑的测试用例也可以设置不同的权限。
在测试的时候,有时是需要在测试步骤中输入参数,或者也需要找到待测试组件,或者还可以输入待测试组件所执行的动作。在本实施例中,作为可选的实施例,可以实现输入参数、测试组件以及测试组件所执行的动作的分离,可以分别设置参数、组 件、和组件执行的动作,从而实现了参数、组件、动作的分离。例如,测试用例中的测试步骤需要输入参数的情况下,将该测试用例中的测试步骤翻译成机器语言包括:获取参数,并将该参数传递给对应的测试步骤并翻译成机器语言,其中,该参数包括以下至少之一:测试所使用的数据、待测试的组件、控制该待测试的组件所执行的动作。
组件是可以直接指定的,但是在某种情况下,是无法寻找到组件的,此时可以提供一些组件的信息,由服务器提供查找组件的服务,根据组件的信息来自动查找到需要进行测试的组件。即在该参数包括该待测试组件的信息的情况下,将上述参数传递给对应的测试步骤包括:根据该待测试组件的信息查找到对应的待测试组件,并将该待测试组件传递给对应的测试步骤。
下面举例说明如何根据这些参数查找到测试组件的。这些例子是可以结合使用的,也可以单独使用。
例1
在该待测试组件的信息包括该待测试组件的标识的情况下,这种情况是比较直接的,只要根据该待测试组件的标识查找对应的待测试组件即可。例如,需要寻找一个ID为3的组件,那么直接在被测试对象中查找该ID即可。
例2
不仅仅是测试组件的标识是一种比较直接的指示信息,在某种情况下,也可以直接给出该组件的路径,在该待测试组件的信息包括该待测试组件的路径的情况下,根据该待测试组件的路径查找对应的待测试组件。
例3
还有另外一种情况,可能无法知道具体的组件的标识,也不知道组件的路径。但是,测试人员可以大致知道该测试组件的文字描述,在该待测试组件的信息包括该待测试组件的文字描述的情况下,根据该文字描述进行检索并匹配到对应的待测试组件。
由于文字描述对于设备而言是一种不是那么严谨的描述方式,可以考虑采用如下至少之一的查找方式。在以下的查找方式中,模拟了人类的思维。
在该待测试对象中查找与该文字描述匹配度超过阈值的字符或图片,查找距离该字符预定范围内的组件作为该待测试组件;例如,需要寻找用户名的输入框,此时,可以首先寻找“用户”或者“用户名”的文字描述,那么按照正常的思路,在这些文字后面不远的地方就应当是用户名的输入框。
在该待测试对象中的注释信息中查找与该文字描述匹配的字符或图片,查找到与该文字描述匹配度超过阈值的字符或图片的注释信息,将该注释信息对应的组件作为该待测试组件;例如,有些组件是具有Tips的,虽然这些Tips中的内容并不直接显示在用户界面上,但是,当鼠标滑过这些组件的时候,Tips中的内容是会被显示的。此时,可以在Tips中查找相关文字描述,如果找到,那么该Tips对应的组件就是希望找到的组件了。
在该待测试对象中的组件的占位符中查找与该文字描述匹配度超过阈值的占位符,将该占位符对应的组件作为该待测试组件;例如,占位符可以是默认显示在一个文本框或者输入框中的文字,例如,在某个输入框中希望用户输入一些地方的名字,那么占位符的内容可以是“北京”等地区的名字。当用户输入自己希望的地名时,北京这两个字就被取代了。这些占位符的内容也可以作为被检索的内容,当在占位符中搜索到希望的文字时,可以确定该占位符所对应的组件就是希望进行测试的组件。
根据该测试对象的组件的布局关系和文字描述查找对应的组件作为该待测试组件。例如,希望在测试的时候,从测试对象的UI中删除一个用户A,此时需要点击删除按钮。但是在UI中存在多个用户:用户A、用户B、用户C等等,每一个用户后面均跟随着一个删除按钮。此时,可以寻找用户A,按照布局关系,跟用户A有一定布局关系删除按钮就是用来删除用户A的。
对于测试结果的记录,可以仅仅简单记录最终的测试结果。作为一个可选的方式,也可以记录执行该测试用例中每个测试步骤的过程以及执行该每个测试步骤得到的结果。
在记录的时候,可以采用截图的方式,即在执行每个测试步骤时,截取执行该测试步骤的截图,并进行保存。
更优地,将以下至少之一显示在该截图上:将执行的该测试步骤对应的自然语言描述、执行该测试步骤对应的结果、执行该测试步骤的时间。
当然,测试结果的比对也可以使用机器来自动执行,在记录该测试结果之后,该方法还包括:将该测试结果与预先设置的预期测试结果进行比对,根据比对结果确定测试是否通过。作为一个比较优的实施方式,在该比对结果为测试不通过的情况下,该方法还可以将该测试结果、该测试步骤以及测试过程中产生的中间文件进行记录。
本实施例可以而已软件进行测试,也可以对硬件进行测试,例如,待测试对象包括以下之一:用户界面UI(例如,网页)、客户端软件、服务端软件、硬件驱动程序、操作系统上的应用程序、操作系统。本实施例比较优的是对BS架构的网站的测试。用 户界面还可以包括各种智能设备的各种界面,例如,手机当中所适用的UI,或者手机当中各种APP所适用的UI。智能设备并不局限于手机,各种智能设备的UI都可以适用本实施例中的测试方法或者下文中的测试装置来进行测试。
在本实施例中还提供了一种测试装置,图2是根据本发明实施例的测试装置的结构框图,如图2所示,该测试装置包括:
获取模块22,被设置为获取由一个或多个测试模板构成的测试用例,其中,该测试模板为预先编辑的,该测试模板中包括一个或多个测试步骤,该测试步骤为对待测试对象所进行的操作,该一个或多个测试步骤中的部分或者全部是用自然语言描述的;
翻译模块24,被设置为通过自然语言与机器语言的对应关系将该测试用例中的测试步骤翻译成机器语言,其中,该机器语言是机器能够识别并执行的语言;
执行模块26,被设置为使用该机器语言对该待测试对象执行该测试用例;
记录模块28,被设置为记录测试结果,其中,该测试结果包括以下至少之一:执行该测试用例得到的测试结果、执行该测试模板得到的测试结果、执行该测试步骤得到的测试结果。
上述方法实施例以及实施方式中对应的内容,在装置实施例中同样适用。这样装置实施例中的模块或者单元可以认为是一种软件,该软件可以存储在存储装置中,也可以在CPU中来执行。
下面结合一个可选的实施例进行说明。本实施例中的自动化测试系统可以实现如下功能:
用自然语言来写测试用例;
提前把抽象化/数字化测试用例的模板做好,后台完成对自然语言的解析;
后台自动生成一整套代码运行测试流程;
使用户对组件对象的搜索不用输入太多的参数和关键字即可完成解析;
集成测试环境后台化,用户不用自己动手搭建自动化环境,节省大量时间;
自动生成详细的步骤报告和截图;
生成的截图上精确的标记缺陷,可以直观的还原真实的场景重现;
支持动态数据,测试用例可复用,其他自动化工具录制的脚本做不到。
在本实施例中,通过测试用例模板以及测试数据模块来设计测试场景,并且,灵 活的测试用例重用机制,规避以往录制脚本不可重用的弊端,测试用例一旦创建即可自动运行,运行过程可视化,自动捕捉缺陷并且自动生成缺陷报告,还可自动进行缺陷验证。支持网站和手机应用(iOS,android),实现产品平台全面覆盖,集成的测试环境覆盖不同浏览器厂商和版本,以及iOS和android各个主流系统版本。
通过本实施例,因为每个测试对象的功能、测试需求的范围有所不同,包括每个产品周期的长短也不同,所以可以根据产品具体情况的需要来选择在自动化测试系统中覆盖的范围和频率。也可以根据不同平台的产品需求,同时运行不同平台的测试用例。自动化测试系统适用于功能模块不同大小以及产品周期不同长短的各种产品,是最经济实用且高效的一种自动化测试解决方案。自动化测试系统的工具有很多种,在不单一依赖一种工具的情况下,可在各产品已有的实体自动化框架内进行自动化测试。。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所 述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。

Claims (14)

  1. 一种测试方法,其中,包括:
    获取由一个或多个测试模板构成的测试用例,其中,所述测试模板为预先编辑的,所述测试模板中包括一个或多个测试步骤,所述测试步骤为对待测试对象所进行的操作,所述一个或多个测试步骤中的部分或者全部是用自然语言描述的;
    通过自然语言与机器语言的对应关系将所述测试用例中的测试步骤翻译成机器语言,其中,所述机器语言是机器能够识别并执行的语言;
    使用所述机器语言对所述待测试对象执行所述测试用例;
    记录测试结果,其中,所述测试结果包括以下至少之一:执行所述测试用例得到的测试结果、执行所述测试模板得到的测试结果、执行所述测试步骤得到的测试结果。
  2. 根据权利要求1所述的方法,其中,还包括:
    提供一个或多个自然语言描述的所述测试步骤供用户进行选择;
    接收用户选择的一个或多个测试步骤以及所述一个或多个测试步骤的顺序;
    将所述用户选择的一个或多个测试步骤按照所述顺序构成测试模板。
  3. 根据权利要求2所述的方法,其中,还包括:
    接收用户设置的权限信息,其中,所述权限信息用于标识其他用户对所述测试模板的权限;
    接收所述其他用户对所述测试模板的请求,根据所述权限信息控制所述其他用户对测试模板的操作。
  4. 根据权利要求1所述的方法,其中,在所述测试用例中的测试步骤需要输入参数的情况下,将所述测试用例中的测试步骤翻译成机器语言包括:
    获取参数,并将所述参数传递给对应的测试步骤并翻译成机器语言,其中,所述参数包括以下至少之一:测试所使用的数据、待测试的组件、控制所述待测试的组件所执行的动作。
  5. 根据权利要求4所述的方法,其中,在所述参数包括所述待测试组件的信息的情况下,将上述参数传递给对应的测试步骤包括:
    根据所述待测试组件的信息查找到对应的待测试组件,并将所述待测试组件传递给对应的测试步骤。
  6. 根据权利要求5所述的方法,其中,根据所述待测试组件的信息查找对应的待测试组件包括以下至少之一:
    在所述待测试组件的信息包括所述待测试组件的标识的情况下,根据所述待测试组件的标识查找对应的待测试组件;
    在所述待测试组件的信息包括所述待测试组件的路径的情况下,根据所述待测试组件的路径查找对应的待测试组件;
    在所述待测试组件的信息包括所述待测试组件的文字描述的情况下,根据所述文字描述进行检索并匹配到对应的待测试组件。
  7. 根据权利要求6所述的方法,其中,根据所述文字描述进行检索并匹配到对应的待测试组件包括以下至少之一:
    在所述待测试对象中查找与所述文字描述匹配度超过阈值的字符或图片,查找距离所述字符预定范围内的组件作为所述待测试组件;
    在所述待测试对象中的注释信息中查找与所述文字描述匹配的字符或图片,查找到与所述文字描述匹配度超过阈值的字符或图片的注释信息,将该注释信息对应的组件作为所述待测试组件;
    在所述待测试对象中的组件的占位符中查找与所述文字描述匹配度超过阈值的占位符,将该占位符对应的组件作为所述待测试组件;
    根据所述测试对象的组件的布局关系和文字描述查找对应的组件作为所述待测试组件。
  8. 根据权利要求1所述的方法,其中,记录所述测试结果包括:
    记录执行所述测试用例中每个测试步骤的过程以及执行所述每个测试步骤得到的结果。
  9. 根据权利要求7所述的方法,其中,记录执行所述测试用例中的每个测试步骤包括:
    在执行每个测试步骤时,截取执行所述测试步骤的截图,并进行保存。
  10. 根据权利要求9所述的方法,其中,所述方法还包括:
    将以下至少之一显示在所述截图上:将执行的所述测试步骤对应的自然语言 描述、执行所述测试步骤对应的结果、执行所述测试步骤的时间。
  11. 根据权利要求1至10中任一项所述的方法,其中,在记录所述测试结果之后,所述方法还包括:
    将所述测试结果与预先设置的预期测试结果进行比对,根据比对结果确定测试是否通过。
  12. 根据权利要求11所述的方法,其中,在所述比对结果为测试不通过的情况下,所述方法还包括:
    将所述测试结果、所述测试步骤以及测试过程中产生的中间文件进行记录。
  13. 根据权利要求1至10中任一项所述的方法,其中,所述待测试对象包括以下之一:用户界面、客户端软件、服务端软件、硬件驱动程序、操作系统上的应用程序、操作系统。
  14. 一种测试装置,其中,包括:
    获取模块,被设置为获取由一个或多个测试模板构成的测试用例,其中,所述测试模板为预先编辑的,所述测试模板中包括一个或多个测试步骤,所述测试步骤为对待测试对象所进行的操作,所述一个或多个测试步骤中的部分或者全部是用自然语言描述的;
    翻译模块,被设置为通过自然语言与机器语言的对应关系将所述测试用例中的测试步骤翻译成机器语言,其中,所述机器语言是机器能够识别并执行的语言;
    执行模块,被设置为使用所述机器语言对所述待测试对象执行所述测试用例;
    记录模块,被设置为记录测试结果,其中,所述测试结果包括以下至少之一:执行所述测试用例得到的测试结果、执行所述测试模板得到的测试结果、执行所述测试步骤得到的测试结果。
PCT/CN2017/090999 2016-07-12 2017-06-30 测试方法和装置 WO2018010552A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610547984.4 2016-07-12
CN201610547984.4A CN107608874A (zh) 2016-07-12 2016-07-12 测试方法和装置

Publications (1)

Publication Number Publication Date
WO2018010552A1 true WO2018010552A1 (zh) 2018-01-18

Family

ID=60951954

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/090999 WO2018010552A1 (zh) 2016-07-12 2017-06-30 测试方法和装置

Country Status (2)

Country Link
CN (1) CN107608874A (zh)
WO (1) WO2018010552A1 (zh)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108959067A (zh) * 2018-05-31 2018-12-07 康键信息技术(深圳)有限公司 搜索引擎的测试方法、装置及计算机可读存储介质
CN109800395A (zh) * 2019-01-25 2019-05-24 广东电网有限责任公司 一种变电站自动化设备测试方法
CN109815145A (zh) * 2019-01-18 2019-05-28 中国农业银行股份有限公司 一种批量程序测试方法及装置
CN110096259A (zh) * 2019-03-15 2019-08-06 佛山青藤信息科技有限公司 一种Web页面元素定位方法及系统
CN110287095A (zh) * 2019-05-20 2019-09-27 深圳壹账通智能科技有限公司 一种自动化测试方法、装置及存储介质
CN111459796A (zh) * 2020-02-27 2020-07-28 西安广和通无线软件有限公司 自动化测试方法、装置、计算机设备和存储介质
CN111459818A (zh) * 2020-03-31 2020-07-28 中国银行股份有限公司 可视化测试方法及装置
CN111488275A (zh) * 2020-04-03 2020-08-04 携程旅游网络技术(上海)有限公司 Ui自动化测试方法、装置、存储介质及电子设备
CN111813687A (zh) * 2020-07-20 2020-10-23 网易(杭州)网络有限公司 测试方法、装置、控制终端、测试设备及存储介质
CN112115058A (zh) * 2020-09-25 2020-12-22 建信金融科技有限责任公司 测试方法及装置、测试用例生成方法及装置、测试系统
CN112162916A (zh) * 2020-08-31 2021-01-01 北京交大思诺科技股份有限公司 可自动生成测试脚本的lkj测试系统
CN112214390A (zh) * 2019-07-09 2021-01-12 腾讯科技(深圳)有限公司 一种测试用例生成方法、装置、系统、设备及介质
CN112527630A (zh) * 2020-11-18 2021-03-19 平安消费金融有限公司 测试用例生成方法、装置、计算机设备和存储介质
CN112685322A (zh) * 2021-01-12 2021-04-20 武汉思普崚技术有限公司 一种客制化测试方法、装置及系统
CN112905441A (zh) * 2019-12-04 2021-06-04 阿里巴巴集团控股有限公司 测试用例生成方法、测试方法、装置及设备
CN113505065A (zh) * 2021-07-09 2021-10-15 深圳市泛海检测认证有限公司 一种基于Android平台自动化测试的实现方法
CN114253867A (zh) * 2022-03-02 2022-03-29 北京仁科互动网络技术有限公司 基于神经网络模型的自动化测试方法、装置及系统
CN115174383A (zh) * 2022-05-30 2022-10-11 青岛海尔科技有限公司 设备更新方法、存储介质及电子装置

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108717392A (zh) * 2018-04-11 2018-10-30 南京思博特智能科技有限公司 一种智能软件自动化测试方法
CN108763066A (zh) * 2018-05-15 2018-11-06 南京璇玑信息技术有限公司 一种词槽设计的自然语言测试脚本编辑方法及测试机器人
CN109189690A (zh) * 2018-09-17 2019-01-11 郑州云海信息技术有限公司 一种阶段测试方法及装置
CN109815127B (zh) * 2018-12-21 2022-11-15 浙江数链科技有限公司 自动化脚本转换方法、装置、计算机设备和存储介质
CN111382055B (zh) * 2018-12-29 2023-09-15 贝壳技术有限公司 一种基于统一描述语言的自动化单元测试方法及装置
CN109818833B (zh) * 2019-03-14 2021-08-17 北京信而泰科技股份有限公司 一种以太网测试系统和以太网测试方法
CN110377516A (zh) * 2019-07-17 2019-10-25 拉扎斯网络科技(上海)有限公司 测试方法、装置、电子设备及计算机可读存储介质
CN111475410B (zh) * 2020-03-31 2024-01-09 北京经纬恒润科技股份有限公司 一种测试用例生成方法及装置
CN111124938B (zh) * 2020-03-31 2020-08-21 四川新网银行股份有限公司 组件化的测试用例的生成方法
CN115629295B (zh) * 2022-11-30 2023-04-14 苏州萨沙迈半导体有限公司 芯片自动化测试系统、方法及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080126880A1 (en) * 2006-11-27 2008-05-29 Orla Hegarty Automatic generation of test cases from error data
CN102779091A (zh) * 2012-06-18 2012-11-14 中兴通讯股份有限公司 测试转化方法及装置
CN103218292A (zh) * 2013-03-29 2013-07-24 北京控制工程研究所 一种航天星载软件自动测试系统
US20130263089A1 (en) * 2012-03-30 2013-10-03 NIIT Technologies Ltd Generating test cases for functional testing of a software application

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9021440B1 (en) * 2014-08-11 2015-04-28 Pmc-Sierra Us, Inc. System and method for automated test script generation
CN104391794A (zh) * 2014-12-03 2015-03-04 浪潮集团有限公司 一种多种脚本自动测试方法
CN104932980B (zh) * 2015-06-30 2018-10-23 北京奇虎科技有限公司 软件自动测试方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080126880A1 (en) * 2006-11-27 2008-05-29 Orla Hegarty Automatic generation of test cases from error data
US20130263089A1 (en) * 2012-03-30 2013-10-03 NIIT Technologies Ltd Generating test cases for functional testing of a software application
CN102779091A (zh) * 2012-06-18 2012-11-14 中兴通讯股份有限公司 测试转化方法及装置
CN103218292A (zh) * 2013-03-29 2013-07-24 北京控制工程研究所 一种航天星载软件自动测试系统

Cited By (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108959067A (zh) * 2018-05-31 2018-12-07 康键信息技术(深圳)有限公司 搜索引擎的测试方法、装置及计算机可读存储介质
CN108959067B (zh) * 2018-05-31 2023-04-07 康键信息技术(深圳)有限公司 搜索引擎的测试方法、装置及计算机可读存储介质
CN109815145A (zh) * 2019-01-18 2019-05-28 中国农业银行股份有限公司 一种批量程序测试方法及装置
CN109800395A (zh) * 2019-01-25 2019-05-24 广东电网有限责任公司 一种变电站自动化设备测试方法
CN110096259A (zh) * 2019-03-15 2019-08-06 佛山青藤信息科技有限公司 一种Web页面元素定位方法及系统
CN110287095A (zh) * 2019-05-20 2019-09-27 深圳壹账通智能科技有限公司 一种自动化测试方法、装置及存储介质
CN112214390B (zh) * 2019-07-09 2024-01-30 腾讯科技(深圳)有限公司 一种测试用例生成方法、装置、系统、设备及介质
CN112214390A (zh) * 2019-07-09 2021-01-12 腾讯科技(深圳)有限公司 一种测试用例生成方法、装置、系统、设备及介质
CN112905441A (zh) * 2019-12-04 2021-06-04 阿里巴巴集团控股有限公司 测试用例生成方法、测试方法、装置及设备
CN111459796B (zh) * 2020-02-27 2024-03-15 西安广和通无线软件有限公司 自动化测试方法、装置、计算机设备和存储介质
CN111459796A (zh) * 2020-02-27 2020-07-28 西安广和通无线软件有限公司 自动化测试方法、装置、计算机设备和存储介质
CN111459818A (zh) * 2020-03-31 2020-07-28 中国银行股份有限公司 可视化测试方法及装置
CN111459818B (zh) * 2020-03-31 2023-11-21 中国银行股份有限公司 可视化测试方法及装置
CN111488275A (zh) * 2020-04-03 2020-08-04 携程旅游网络技术(上海)有限公司 Ui自动化测试方法、装置、存储介质及电子设备
CN111488275B (zh) * 2020-04-03 2023-08-25 携程旅游网络技术(上海)有限公司 Ui自动化测试方法、装置、存储介质及电子设备
CN111813687A (zh) * 2020-07-20 2020-10-23 网易(杭州)网络有限公司 测试方法、装置、控制终端、测试设备及存储介质
CN112162916B (zh) * 2020-08-31 2024-04-19 北京交大思诺科技股份有限公司 可自动生成测试脚本的lkj测试系统
CN112162916A (zh) * 2020-08-31 2021-01-01 北京交大思诺科技股份有限公司 可自动生成测试脚本的lkj测试系统
CN112115058B (zh) * 2020-09-25 2024-03-29 建信金融科技有限责任公司 测试方法及装置、测试用例生成方法及装置、测试系统
CN112115058A (zh) * 2020-09-25 2020-12-22 建信金融科技有限责任公司 测试方法及装置、测试用例生成方法及装置、测试系统
CN112527630A (zh) * 2020-11-18 2021-03-19 平安消费金融有限公司 测试用例生成方法、装置、计算机设备和存储介质
CN112527630B (zh) * 2020-11-18 2023-07-07 平安消费金融有限公司 测试用例生成方法、装置、计算机设备和存储介质
CN112685322A (zh) * 2021-01-12 2021-04-20 武汉思普崚技术有限公司 一种客制化测试方法、装置及系统
CN112685322B (zh) * 2021-01-12 2022-10-04 武汉思普崚技术有限公司 一种客制化测试方法、装置及系统
CN113505065A (zh) * 2021-07-09 2021-10-15 深圳市泛海检测认证有限公司 一种基于Android平台自动化测试的实现方法
CN114253867B (zh) * 2022-03-02 2022-06-14 北京仁科互动网络技术有限公司 基于神经网络模型的自动化测试方法、装置及系统
CN114253867A (zh) * 2022-03-02 2022-03-29 北京仁科互动网络技术有限公司 基于神经网络模型的自动化测试方法、装置及系统
CN115174383A (zh) * 2022-05-30 2022-10-11 青岛海尔科技有限公司 设备更新方法、存储介质及电子装置
CN115174383B (zh) * 2022-05-30 2024-03-22 青岛海尔科技有限公司 设备更新方法、存储介质及电子装置

Also Published As

Publication number Publication date
CN107608874A (zh) 2018-01-19

Similar Documents

Publication Publication Date Title
WO2018010552A1 (zh) 测试方法和装置
US9846638B2 (en) Exposing method related data calls during testing in an event driven, multichannel architecture
CN106844217B (zh) 对应用的控件进行埋点的方法及装置、可读存储介质
US7895565B1 (en) Integrated system and method for validating the functionality and performance of software applications
CN108959068B (zh) 软件界面测试方法、设备及存储介质
US10146753B2 (en) Visual regression testing tool
Alegroth et al. JAutomate: A tool for system-and acceptance-test automation
US20150339213A1 (en) Automated testing of an application system
US20190303269A1 (en) Methods and systems for testing visual aspects of a web page
US10146672B2 (en) Method and system for automated user interface (UI) testing through model driven techniques
US10162742B2 (en) System and method for end to end performance response time measurement based on graphic recognition
CN106776338B (zh) 一种测试方法、装置及服务器
JP2015109059A (ja) 文書オブジェクトモデルツリーとカスケーディング・スタイル・シートとが取り出されることが可能なアプリケーションのソースコードを変更することによって生じる影響を検知するための方法、並びに、当該影響を検知するためのコンピュータ及びそのコンピュータ・プログラム
WO2018120965A1 (zh) 自动化测试方法、计算机可读存储介质及装置
CN108923997B (zh) 一种基于python的云服务节点自动测试方法及装置
US20200327043A1 (en) System and a method for automated script generation for application testing
CN111966580A (zh) 基于人工智能的自动化测试方法、装置、设备和存储介质
CN106959919B (zh) 基于测试路径图的软件测试方法及装置
Tuovenen et al. MAuto: Automatic mobile game testing tool using image-matching based approach
CN104111852A (zh) 一种基于数据驱动的Web应用自动化测试系统及测试方法
CN110990285B (zh) 一种ui自动化测试方法及装置
CN107704389B (zh) 一种页面测试方法及装置
US20140317450A1 (en) Pretest setup planning
US9946632B1 (en) Self-service customer escalation infrastructure model
CN116719736A (zh) 一种用于测试软件界面的测试用例生成方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17826889

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17826889

Country of ref document: EP

Kind code of ref document: A1