[go: up one dir, main page]

CN107391361B - A kind of POS terminal automatic testing method and device - Google Patents

A kind of POS terminal automatic testing method and device Download PDF

Info

Publication number
CN107391361B
CN107391361B CN201710440337.8A CN201710440337A CN107391361B CN 107391361 B CN107391361 B CN 107391361B CN 201710440337 A CN201710440337 A CN 201710440337A CN 107391361 B CN107391361 B CN 107391361B
Authority
CN
China
Prior art keywords
test
pos terminal
execution
use cases
executed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710440337.8A
Other languages
Chinese (zh)
Other versions
CN107391361A (en
Inventor
吕更
李健
杨维
蓝海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
PAX Computer Technology Shenzhen Co Ltd
Original Assignee
PAX Computer Technology Shenzhen 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 PAX Computer Technology Shenzhen Co Ltd filed Critical PAX Computer Technology Shenzhen Co Ltd
Priority to CN201710440337.8A priority Critical patent/CN107391361B/en
Priority to PCT/CN2017/095891 priority patent/WO2018227735A1/en
Publication of CN107391361A publication Critical patent/CN107391361A/en
Application granted granted Critical
Publication of CN107391361B publication Critical patent/CN107391361B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Cash Registers Or Receiving Machines (AREA)

Abstract

本发明适用于POS终端技术领域,提供了一种POS终端自动测试方法及装置,包括:使用远程过程调用XML‑RPC协议,从基于web的用例管理系统TESTLINK上下载用例;获取选择的测试属性,根据选择的测试属性,在下载的用例中筛选出要执行的用例;在要执行的用例中选择关键词进行排序,得到执行顺序;根据执行顺序,控制POS终端批处理或单个执行所述用例,执行结束后,上传测试结果。本发明实施例的有益效果如下:1)使用XML‑RPC协议通过远程来操作TESTLINK,实现了用例的下载和测试结果的上传;2)使用可靠的协议和POS终端通讯,控制POS终端上的用例执行,实现自动测试的目的;3)提供过滤、排序、批处理或单个执行用例的方式,大大方便了测试人员按需执行用例。

Figure 201710440337

The invention is applicable to the technical field of POS terminals, and provides an automatic testing method and device for POS terminals, comprising: using a remote procedure call XML-RPC protocol to download use cases from a web-based use case management system TESTLINK; obtaining selected test attributes, According to the selected test attributes, filter out the use cases to be executed in the downloaded use cases; select keywords in the use cases to be executed to sort to obtain the execution order; according to the execution order, control the POS terminal batch processing or single execution of the use cases, After the execution is complete, upload the test results. The beneficial effects of the embodiments of the present invention are as follows: 1) use the XML-RPC protocol to remotely operate TESTLINK, thereby realizing the downloading of use cases and the uploading of test results; 2) using reliable protocols to communicate with the POS terminal to control the use cases on the POS terminal Execution, to achieve the purpose of automatic testing; 3) Provide a way of filtering, sorting, batch processing or single execution of use cases, which greatly facilitates testers to execute use cases on demand.

Figure 201710440337

Description

一种POS终端自动测试方法及装置A kind of POS terminal automatic testing method and device

技术领域technical field

本发明属于POS终端技术领域,尤其涉及一种POS终端自动测试方法及装置。The invention belongs to the technical field of POS terminals, and in particular relates to an automatic testing method and device of a POS terminal.

背景技术Background technique

随着经济发展,POS终端的配置越来越强大,功能越来越齐全,当用户需要完成商品支付时,可以通过POS终端进行刷卡消费,以享受POS终端带来的快速支付体验,此外,在POS机投入使用前,需要对POS机进行测试。With the development of economy, the configuration of POS terminal is becoming more and more powerful, and the functions are more and more complete. When users need to complete the payment of goods, they can use the POS terminal to swipe the card to enjoy the fast payment experience brought by the POS terminal. Before the POS machine is put into use, the POS machine needs to be tested.

然而,现有POS终端在测试用例时,需要在TESTLINK上手工填写测试结果,并记录日志信息,不利于提高测试效率,其原因在于,在TESTLINK上手工填写测试结果的方式,虽然能将测试结果更新到TESTLINK上,但其过程只能由用户手动完成,操作步骤繁琐,当用例很多时,耗费的时间过长,影响了测试效率,However, the existing POS terminal needs to manually fill in the test results on TESTLINK and record log information when testing a case, which is not conducive to improving the test efficiency. Update to TESTLINK, but the process can only be done manually by the user, and the operation steps are cumbersome. When there are many use cases, the time-consuming is too long, which affects the test efficiency.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本发明实施例提供了一种POS终端自动测试方法及装置,以解决现有POS终端在测试用例时,需要在TESTLINK上手工填写测试结果,并记录日志信息,不利于提高测试效率的问题。In view of this, the embodiments of the present invention provide an automatic testing method and device for a POS terminal, so as to solve the problem that the existing POS terminal needs to manually fill in the test results on TESTLINK and record log information when testing a case, which is not conducive to improving the test efficiency. The problem.

本发明实施例的第一方面提供了一种POS终端自动测试方法,包括:A first aspect of the embodiments of the present invention provides an automatic testing method for a POS terminal, including:

使用远程过程调用XML-RPC协议,从基于web的用例管理系统TESTLINK 上下载用例;Use remote procedure call XML-RPC protocol to download use cases from the web-based use case management system TESTLINK;

获取选择的测试属性,根据选择的测试属性,在下载的用例中筛选出要执行的用例;Get the selected test attributes, and filter out the use cases to be executed from the downloaded use cases according to the selected test attributes;

在要执行的用例中选择关键词进行排序,得到执行顺序;Select keywords in the use cases to be executed and sort to get the execution order;

根据执行顺序,控制POS终端批处理或单个执行所述用例,执行结束后,上传测试结果。According to the execution sequence, control the POS terminal to execute the use case in batch or individually, and upload the test result after the execution.

本发明实施例的第二方面提供了一种POS终端自动测试装置,包括:A second aspect of the embodiments of the present invention provides an automatic testing device for a POS terminal, including:

下载模块,用于使用远程过程调用XML-RPC协议,从基于web的用例管理系统TESTLINK上下载用例;The download module is used to download use cases from the web-based use case management system TESTLINK using the remote procedure call XML-RPC protocol;

筛选模块,用于获取选择的测试属性,根据选择的测试属性,在下载的用例中筛选出要执行的用例;The filter module is used to obtain the selected test attributes, and filter out the use cases to be executed from the downloaded use cases according to the selected test attributes;

排序模块,用于在要执行的用例中选择关键词进行排序,得到执行顺序;The sorting module is used to select keywords in the use cases to be executed for sorting, and obtain the execution order;

测试模块,用于根据执行顺序,控制POS终端批处理或单个执行所述用例,执行结束后,上传测试结果。The test module is used to control the batch or single execution of the use case of the POS terminal according to the execution sequence, and upload the test result after the execution.

本发明实施例的第三方面提供了一种POS终端自动测试装置/终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述方法的步骤。A third aspect of the embodiments of the present invention provides a POS terminal automatic testing apparatus/terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor The steps of the above-described methods are implemented when the computer program is executed.

本发明实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述方法的步骤。A fourth aspect of the embodiments of the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the foregoing method are implemented.

本发明实施例与现有技术相比存在的有益效果是:The beneficial effects that the embodiment of the present invention has compared with the prior art are:

1)使用XML-RPC协议通过远程来操作TESTLINK,实现了用例的下载和测试结果的上传;1) Using the XML-RPC protocol to remotely operate TESTLINK, the download of use cases and the upload of test results are realized;

2)使用可靠的协议和POS终端通讯,控制POS终端上的用例执行,实现自动测试的目的;2) Use a reliable protocol to communicate with the POS terminal, control the execution of the use case on the POS terminal, and achieve the purpose of automatic testing;

3)提供过滤、排序、批处理或单个执行用例的方式,大大方便了测试人员按需执行用例。3) Provides methods of filtering, sorting, batch processing or single execution of use cases, which greatly facilitates testers to execute use cases on demand.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only for the present invention. In some embodiments, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without any creative effort.

图1是本发明实施例提供的POS终端自动测试方法的实现流程图;Fig. 1 is the realization flow chart of the POS terminal automatic test method that the embodiment of the present invention provides;

图2是本发明实施例提供的POS终端自动测试方法中使用远程过程调用 XML-RPC协议,从基于web的用例管理系统TESTLINK上下载用例并显示的实现流程图;Fig. 2 is the realization flow chart of using the remote procedure call XML-RPC protocol in the POS terminal automatic testing method provided by the embodiment of the present invention to download the use case and display from the web-based use case management system TESTLINK;

图3是本发明实施例提供的POS终端自动测试方法中过滤用例和排序的实现流程图;Fig. 3 is the realization flow chart of filtering use cases and sorting in the POS terminal automatic testing method provided by the embodiment of the present invention;

图4是本发明实施例提供的POS终端自动测试方法中执行测试的应用流程图;Fig. 4 is the application flow chart of executing the test in the POS terminal automatic test method provided by the embodiment of the present invention;

图5是本发明实施例提供的POS终端自动测试方法中线程的序列图;Fig. 5 is the sequence diagram of the thread in the POS terminal automatic testing method provided by the embodiment of the present invention;

图6是本发明实施例提供的上传测试结果的应用流程图;6 is an application flow chart of uploading test results provided by an embodiment of the present invention;

图7是本发明实施例提供的POS终端自动测试装置的结构框图;Fig. 7 is a structural block diagram of a POS terminal automatic testing device provided by an embodiment of the present invention;

图8是本发明实施例提供的POS终端自动测试装置/终端设备的示意图。FIG. 8 is a schematic diagram of a POS terminal automatic testing apparatus/terminal device provided by an embodiment of the present invention.

具体实施方式Detailed ways

以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本发明实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本发明。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本发明的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures and technologies are set forth in order to provide a thorough understanding of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.

为了说明本发明所述的技术方案,下面通过具体实施例来进行说明。In order to illustrate the technical solutions of the present invention, the following specific embodiments are used for description.

应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It is to be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described feature, integer, step, operation, element and/or component, but does not exclude one or more other features , whole, step, operation, element, component and/or the presence or addition of a collection thereof.

还应当理解,在此本发明说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本发明。如在本发明说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It is also to be understood that the terminology used in this specification of the present invention is for the purpose of describing particular embodiments only and is not intended to limit the present invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural unless the context clearly dictates otherwise.

还应当进一步理解,在本发明说明书和所附权利要求书中使用的术语“和/ 或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be further understood that, as used in this specification and the appended claims, the term "and/or" refers to and including any and all possible combinations of one or more of the associated listed items .

如在本说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in this specification and the appended claims, the term "if" may be contextually interpreted as "when" or "once" or "in response to determining" or "in response to detecting" . Similarly, the phrases "if it is determined" or "if the [described condition or event] is detected" may be interpreted, depending on the context, to mean "once it is determined" or "in response to the determination" or "once the [described condition or event] is detected. ]" or "in response to detection of the [described condition or event]".

具体实现中,本发明实施例中描述的终端设备包括但不限于诸如具有触摸敏感表面(例如,触摸屏显示器和/或触摸板)的移动电话、膝上型计算机或平板计算机之类的其它便携式设备。还应当理解的是,在某些实施例中,所述设备并非便携式通信设备,而是具有触摸敏感表面(例如,触摸屏显示器和/或触摸板)的台式计算机。In specific implementations, the terminal devices described in the embodiments of the present invention include, but are not limited to, other portable devices such as mobile phones, laptop computers, or tablet computers with touch-sensitive surfaces (eg, touch screen displays and/or touch pads). . It should also be understood that in some embodiments, the device is not a portable communication device, but rather a desktop computer with a touch-sensitive surface (eg, a touch screen display and/or a touch pad).

在接下来的讨论中,描述了包括显示器和触摸敏感表面的终端设备。然而,应当理解的是,终端设备可以包括诸如物理键盘、鼠标和/或控制杆的一个或多个其它物理用户接口设备。In the discussion that follows, an end device that includes a display and a touch-sensitive surface is described. However, it should be understood that the terminal device may include one or more other physical user interface devices such as a physical keyboard, mouse and/or joystick.

终端设备支持各种应用程序,例如以下中的一个或多个:绘图应用程序、演示应用程序、文字处理应用程序、网站创建应用程序、盘刻录应用程序、电子表格应用程序、游戏应用程序、电话应用程序、视频会议应用程序、电子邮件应用程序、即时消息收发应用程序、锻炼支持应用程序、照片管理应用程序、数码相机应用程序、数字摄影机应用程序、web浏览应用程序、数字音乐播放器应用程序和/或数字视频播放器应用程序。The terminal device supports various applications, such as one or more of the following: drawing applications, presentation applications, word processing applications, website creation applications, disc burning applications, spreadsheet applications, gaming applications, telephony applications Apps, Video Conferencing Apps, Email Apps, Instant Messaging Apps, Workout Support Apps, Photo Management Apps, Digital Camera Apps, Digital Video Camera Apps, Web Browsing Apps, Digital Music Player Apps and/or digital video player applications.

可以在终端设备上执行的各种应用程序可以使用诸如触摸敏感表面的至少一个公共物理用户接口设备。可以在应用程序之间和/或相应应用程序内调整和 /或改变触摸敏感表面的一个或多个功能以及终端上显示的相应信息。这样,终端的公共物理架构(例如,触摸敏感表面)可以支持具有对用户而言直观且透明的用户界面的各种应用程序。Various applications that may be executed on the terminal device may use at least one common physical user interface device, such as a touch sensitive surface. One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal may be adjusted and/or changed between applications and/or within respective applications. In this way, the common physical architecture of the terminal (eg, touch-sensitive surface) can support various applications with a user interface that is intuitive and transparent to the user.

为了说明本发明所述的技术方案,下面通过具体实施例来进行说明。In order to illustrate the technical solutions of the present invention, the following specific embodiments are used for description.

实施例一Example 1

参考图1,图1是本发明实施例提供的POS终端自动测试方法的实现流程图,该方法应用于终端设备,如图1所示POS终端自动测试方法可以包括以下步骤:Referring to Fig. 1, Fig. 1 is an implementation flowchart of a POS terminal automatic test method provided by an embodiment of the present invention, and the method is applied to a terminal device, and the POS terminal automatic test method shown in Fig. 1 may include the following steps:

S101,使用远程过程调用XML-RPC协议,从基于web的用例管理系统 TESTLINK上下载用例;S101, use the remote procedure call XML-RPC protocol to download use cases from the web-based use case management system TESTLINK;

其中,S101,具体为:Among them, S101, specifically:

获取服务器地址、用户名和密钥,根据服务器地址、用户名和密钥,连接基于web的用例管理系统TESTLINK;Obtain the server address, user name and key, and connect to the web-based use case management system TESTLINK according to the server address, user name and key;

根据选择的获取项目、计划和版本,使用远程过程调用XML-RPC协议,从TESTLINK上下载指定的用例。XML-RPC协议是XML Remote Procedure Call,即远程过程调用。According to the selected acquisition project, plan and version, use the remote procedure call XML-RPC protocol to download the specified use case from TESTLINK. XML-RPC protocol is XML Remote Procedure Call, that is, remote procedure call.

S102,获取选择的测试属性,根据选择的测试属性,在下载的用例中筛选出要执行的用例;S102, obtain the selected test attribute, and filter out the use case to be executed from the downloaded use cases according to the selected test attribute;

其中,获取选择的测试属性,根据选择的测试属性,在下载的用例中筛选出要执行的用例,具体为:Among them, the selected test attributes are obtained, and the use cases to be executed are filtered out of the downloaded use cases according to the selected test attributes, specifically:

显示测试属性列表,所述测试属性列表包括测试模式、优先级、测试类型、测试时间、执行状态中的至少一种测试属性;Displaying a test attribute list, the test attribute list includes at least one test attribute in test mode, priority, test type, test time, and execution state;

根据选择操作,获取选择的测试属性;According to the selection operation, get the selected test attribute;

根据选择的测试属性,在下载的用例中筛选出用例。Use cases are filtered out of the downloaded use cases based on the selected test attribute.

根据选择的测试属性,对下载的用例进行过滤,筛选出要执行的用例。According to the selected test attributes, the downloaded use cases are filtered to filter out the use cases to be executed.

其中,S103 , 在要执行的用例中选择关键词进行排序,得到执行顺序,具体为:Among them, S103, select keywords in the use cases to be executed for sorting, and obtain the execution order, specifically:

选择关键词;select keywords;

采用选择的关键词以及多级排序方式,对要执行的用例进行排序,得到执行顺序,并显示排序后的用例。Use selected keywords and multi-level sorting methods to sort the use cases to be executed, get the execution order, and display the sorted use cases.

S104,根据执行顺序,控制POS终端批处理或单个执行所述用例,执行结束后,上传测试结果。S104, according to the execution sequence, control the POS terminal to execute the use case in batch or individually, and upload the test result after the execution ends.

其中,根据执行顺序,采用多线程协调通讯的方式,控制POS终端批处理或单个执行所述用例,执行结束后,上传测试结果,所述多线程包括主线程、控制线程、测试运行线程和串口线程。Among them, according to the execution order, the multi-thread coordinated communication method is used to control the POS terminal batch processing or single execution of the use case, and after the execution is completed, upload the test result, and the multi-thread includes the main thread, the control thread, the test running thread and the serial port. thread.

使用XML-RPC协议,向TESTLINK上传测试结果。Upload test results to TESTLINK using XML-RPC protocol.

其中,S104有两种实施方式,详述如下:Among them, S104 has two implementations, which are detailed as follows:

第一种实施方式,根据执行顺序,通过串口通讯协议或并口通讯协议,向 POS终端发送执行用例的指令,等待POS终端执行完要执行的用例后,获取测试结果,上传测试结果到TESTLINK上。In the first embodiment, according to the execution sequence, the command to execute the use case is sent to the POS terminal through the serial port communication protocol or the parallel port communication protocol, and after the POS terminal executes the use case to be executed, the test result is obtained, and the test result is uploaded to TESTLINK.

第二种实施方式,采用心跳检测,判断自身和POS终端的通信链路是否正常连接;The second embodiment adopts heartbeat detection to determine whether the communication link between itself and the POS terminal is normally connected;

正常连接后,根据执行顺序,通过串口通讯协议,向POS终端发送执行用例的指令,利用串口线程监听POS终端数据;After the normal connection, according to the execution sequence, through the serial port communication protocol, send the command to execute the use case to the POS terminal, and use the serial port thread to monitor the POS terminal data;

当监听到POS终端数据到来时,通知所述测试运行线程接收并处理POS 终端数据,得到测试结果后,通知控制运行线程记录测试结果;When monitoring the arrival of POS terminal data, notify the test running thread to receive and process the POS terminal data, and after obtaining the test result, notify the control running thread to record the test result;

记录完毕后,根据执行顺序增加下一条要执行的用例,依次往复;After the recording is completed, add the next use case to be executed according to the execution order, and repeat in sequence;

等待POS终端执行完要执行的用例后,获取测试结果,上传测试结果到 TESTLINK上。After waiting for the POS terminal to execute the use case to be executed, obtain the test result and upload the test result to TESTLINK.

为便于说明,以下为POS终端自动测试方法较佳的应用流程,详述如下:For the convenience of description, the following is the preferred application process of the POS terminal automatic test method, which is described in detail as follows:

1.从TESTLINK上下载指定的用例,设置使用远程过程调用XML-RPC协议,从基于web的用例管理系统TESTLINK上下载用例的协议内容,获取要执行的用例信息,ATC软件使用JAVA的表格控件展示,并提供右键支持;1. Download the specified use case from TESTLINK, set up the use of remote procedure call XML-RPC protocol, download the protocol content of the use case from the web-based use case management system TESTLINK, and obtain the use case information to be executed, ATC software uses JAVA form control display , and provide right-click support;

2.接着进行过滤,提供模块以及各种测试属性,这里使用JAVA的下拉列表和按钮控制实现,过滤的数据展示仍旧使用表格控件,但定制了一列控件,支持复选框功能,可以细化筛选动作;2. Then filter to provide modules and various test properties. Here, the drop-down list and button control of JAVA are used. The filtered data display still uses the table control, but a column of controls is customized to support the checkbox function, which can be refined and filtered. action;

3.筛选过后进入排序,使用一项高级功能,支持多级排序,排序完成后进入执行,由于考虑GUI的及时响应性,执行用例时,启动一个工作线程执行,保证GUI界面的友好性,执行用例支持批处理,可以运行全部的用例,也可以暂停后,继续执行用例,也支持单个用例,这是多线程协调通讯的结果;3. Enter the sorting after screening, use an advanced function to support multi-level sorting, and enter the execution after the sorting is completed. Considering the timely responsiveness of the GUI, when executing the use case, a worker thread is started to execute to ensure the friendliness of the GUI interface. Execution The use case supports batch processing, which can run all the use cases, or continue to execute the use cases after a pause, and also supports a single use case, which is the result of multi-threaded coordinated communication;

4.执行用例时,通过串口通讯协议发送执行用例的指令,等待POS执行结束后,获取测试结果,上传测试结果到TESTLINK上。4. When executing the use case, send the command to execute the use case through the serial communication protocol, wait for the completion of the POS execution, obtain the test results, and upload the test results to TESTLINK.

本发明实施例的有益效果在于以下几个方面:The beneficial effects of the embodiments of the present invention lie in the following aspects:

第一方面,使用XML-RPC协议通过远程来操作TESTLINK,实现用例的下载和结果的上传;First, use the XML-RPC protocol to remotely operate TESTLINK to download use cases and upload results;

第二方面,使用可靠的协议和POS终端通讯,控制POS终端上的用例执行,实现自动测试的目的,提高了测试效率;Second, use reliable protocols to communicate with the POS terminal to control the execution of use cases on the POS terminal, achieve the purpose of automatic testing, and improve the testing efficiency;

第三方面,提供各种过滤、排序、批处理或单个执行用例,大大方便了测试人员按需执行用例,减少了人力资源投入;In the third aspect, various filtering, sorting, batch processing or single execution use cases are provided, which greatly facilitates testers to execute use cases on demand and reduces human resource investment;

第四方面,采用JAVA实现的POS终端自动测软件能兼容所有windows 系列系统,并支持32bit和64bit平台,易于移植。Fourth, the POS terminal automatic testing software realized by JAVA can be compatible with all windows series systems, and supports 32bit and 64bit platforms, which is easy to transplant.

实施例二Embodiment 2

参考图2,图2是本发明实施例提供的POS终端自动测试方法中使用远程过程调用XML-RPC协议,从基于web的用例管理系统TESTLINK上下载用例并显示的实现流程图,该POS终端自动测试方法应用于终端设备,如图2所示,包括以下步骤:Referring to Fig. 2, Fig. 2 is an implementation flow chart of downloading a use case and displaying it from a web-based use case management system TESTLINK using a remote procedure call XML-RPC protocol in the POS terminal automatic testing method provided by the embodiment of the present invention. The POS terminal automatically The test method is applied to terminal equipment, as shown in Figure 2, including the following steps:

S201,选择项目、计划、版本;S201, select project, plan, version;

S202,点击DownloadCase按钮;S202, click the DownloadCase button;

S203,检查连接是否成功;S203, check whether the connection is successful;

S204,开始使用远程过程调用XML-RPC协议,从基于web的用例管理系统TESTLINK上下载用例;S204, start using the remote procedure call XML-RPC protocol to download use cases from the web-based use case management system TESTLINK;

S205,使用远程过程调用XML-RPC协议,从基于web的用例管理系统 TESTLINK上下载用例完成后,进入用例显示界面,等待下载完成;S205, use the remote procedure call XML-RPC protocol to download the use case from the web-based use case management system TESTLINK, enter the use case display interface, and wait for the download to complete;

S206,主线程进入用例显示界面;S206, the main thread enters the use case display interface;

S207,后台线程继续把下载的用例写入文件。S207, the background thread continues to write the downloaded use case into the file.

在本发明实施例中,根据服务器地址、用户名和密钥,连接到TESTLINK,如果成功,则继续获取项目、计划和版本,选择指定测试的版本后,进行用例下载,等待用例下载完成后,为了提高效率,使用文件缓冲的技术,避免了出现多次从服务器重复下载,带来不必要的网络负载的情况。In the embodiment of the present invention, connect to TESTLINK according to the server address, user name and key, if successful, continue to obtain the project, plan and version, select the version of the specified test, download the use case, wait for the download of the use case to complete, in order to Improve efficiency and use file buffering technology to avoid repeated downloads from the server many times, which will bring unnecessary network load.

参考图3,图3是本发明实施例提供的POS终端自动测试方法中过滤用例和排序的实现流程图,该POS终端自动测试方法应用于终端设备,如图3所示,包括以下步骤:Referring to Fig. 3, Fig. 3 is the realization flow chart of filtering use cases and sorting in the POS terminal automatic testing method provided by the embodiment of the present invention, this POS terminal automatic testing method is applied to terminal equipment, as shown in Fig. 3, comprises the following steps:

S301,选择模块;S301, select a module;

S302,选择模块的API;S302, select the API of the module;

S303,选择测试模式,优先级,测试类型,测试成本,执行状态;S303, select the test mode, priority, test type, test cost, and execution state;

S304,点击Filter按钮;S304, click the Filter button;

S305,判断用例是否符合筛选条件,是则执行S306,否则结束;S305, determine whether the use case meets the screening conditions, if yes, execute S306, otherwise end;

S306,过滤出来的用例默认全部选中;S306, all the filtered use cases are selected by default;

S307,可以继续勾选掉不想测试的用例;S307, you can continue to check out the use cases that you do not want to test;

S308,最后点击Next完成筛选;S308, and finally click Next to complete the screening;

S309,选择排序关键字,有5个优先级属性;S309, select the sorting key, there are 5 priority attributes;

S310,点击排序按钮,进行排序;S310, click the sort button to sort;

S311,删除原来显示的数据,展示新排序的数据。S311 , delete the originally displayed data, and display the newly sorted data.

在本发明实施例中,模块包括API接口,API接口又包含测试用例,测试用例本身包括测试模式、优先级、测试类型、测试时间、执行状态属性等等,过滤功能就使用这些特性进行过滤,筛选出需要的用例,由于这些用例需要通过JAVA的表格控件展示,每行展示一条用例,每行中包含一列复选框,因此可以做进一步的筛选动作,最终选择出要执行的用例,针对选择的用例可以选择5个关键字进行排序,执行多级排序算法,以实现用例的排序功能。In the embodiment of the present invention, the module includes an API interface, and the API interface includes test cases. The test cases themselves include test mode, priority, test type, test time, execution status attribute, etc. The filtering function uses these characteristics to filter, Filter out the required use cases. Since these use cases need to be displayed through the JAVA table control, each row displays one use case, and each row contains a column of checkboxes, so further filtering actions can be performed, and finally the use cases to be executed are selected. The use case can select 5 keywords for sorting, and execute a multi-level sorting algorithm to realize the sorting function of the use case.

实施例三Embodiment 3

参考图4,图4是本发明实施例提供的POS终端自动测试方法中执行测试的应用流程图,该方法应用于终端设备,如图4所示,该方法可以包括以下步骤:Referring to FIG. 4, FIG. 4 is an application flow chart of performing a test in a POS terminal automatic test method provided by an embodiment of the present invention. The method is applied to a terminal device. As shown in FIG. 4, the method may include the following steps:

1.发送执行测试用例指令;1. Send the instruction to execute the test case;

2.发送PC执行指令;2. Send PC execution instructions;

3.执行完PC指令;3. After executing the PC command;

4.执行完测试用例指令。4. Execute the test case instruction.

在本发明实施例中,执行用例需要和POS终端机进行串口通信,PC发送按照约定的协议指令给POS终端,POS终端接收到指令后执行指令,执行用例过程中如果需要PC修改POS终端测试的环境,POS终端则发送指令让PC执行,PC执行后返回给POS终端,POS终端继续执行用例,执行完成后返回结果给PC。In this embodiment of the present invention, the execution of the use case requires serial communication with the POS terminal, the PC sends an instruction according to the agreed protocol to the POS terminal, and the POS terminal executes the instruction after receiving the instruction. environment, the POS terminal sends an instruction to the PC to execute, the PC returns to the POS terminal after execution, the POS terminal continues to execute the use case, and returns the result to the PC after the execution is completed.

在本发明实施例中,针对ATC软件实现,在嵌入上述流程后,为了保证通讯可靠,以及响应性等方面,增加了比如心跳检测,例如串口发送数据前,先进行心跳检测,判断链路是否通顺;最重要的是多线程实现,包含四个线程,分别为主线程处理界面响应,控制线程、测试运行线程和串口线程合作进行用例执行,串口线程主要进行数据监听,当监听到POS端数据到来时,通知测试运行线程接收并处理数据,处理结束后,通知控制运行线程记录结果信息,然后开始增加下一条用例,测试运行线程检测到后进行执行,依次往复,直观的说明请参考图5,图5是本发明实施例提供的POS终端自动测试方法中线程的序列图,该方法应用于终端设备,如图5所示:In the embodiment of the present invention, for the ATC software implementation, after the above process is embedded, in order to ensure reliable communication and responsiveness, for example, heartbeat detection is added. For example, before the serial port sends data, heartbeat detection is performed to determine whether the link is Smooth; the most important thing is multi-thread implementation, including four threads, which are respectively the main thread to process the interface response, the control thread, the test running thread and the serial port thread to cooperate to execute the use case. The serial port thread mainly performs data monitoring. When it arrives, notify the test running thread to receive and process the data. After the processing, notify the control running thread to record the result information, and then start adding the next use case. After the test running thread detects it, it will be executed, and it will reciprocate in turn. Please refer to Figure 5 for an intuitive description. , Fig. 5 is the sequence diagram of the thread in the POS terminal automatic test method provided by the embodiment of the present invention, this method is applied to terminal equipment, as shown in Fig. 5:

主线程启动测试队列中的开始线程TestQueue.start;The main thread starts the start thread TestQueue.start in the test queue;

测试运行线程执行测试队列中的判空函数TestQueue.isEmpty,等待Wait;The test running thread executes the empty function TestQueue.isEmpty in the test queue and waits for Wait;

串口线程开始监听数据;The serial port thread starts to monitor data;

主线程接收到启动按钮点击的消息;The main thread receives the message of the start button click;

控制线程执行测试结果队列中的判空函数TestQueue.isEmpty,等待Wait;The control thread executes the empty function TestQueue.isEmpty in the test result queue and waits for Wait;

控制线程执行测试队列中的增加队列函数addLast,通知测试运行线程开始测试(notify),并等待Wait,正常流程循环;The control thread executes the increase queue function addLast in the test queue, notifies the test running thread to start the test (notify), and waits for Wait, the normal process loop;

测试运行线程执行测试队列中的判空函数TestQueue.isEmpty,发送执行测试命令sendDoTestCmd,连接并等待connection Wait;The test running thread executes the empty function TestQueue.isEmpty in the test queue, sends the execution test command sendDoTestCmd, connects and waits for connection Wait;

串品线程向测试运行线程发送通知串口数据到来的消息;The serial port thread sends a message notifying the arrival of serial port data to the test running thread;

测试运行线程接受结果并处理,等待Wait;The test running thread accepts the result and processes it, waiting for Wait;

测试运行线程向控制线程发送通知接收结果的消息;The test running thread sends a message to the control thread notifying the received result;

控制线程接收结果消息,返回控制线程执行测试队列中的增加队列函数addLast,直接测试完队列函数addLast中的测试项。The control thread receives the result message, returns the control thread to execute the add queue function addLast in the test queue, and directly tests the test items in the queue function addLast.

在本发明实施例中,执行完用例后,开始进行结果上传的工作,借助于 XML-RPC协议,把对应的结果数据上传到TESTLINK上,实现中考虑多种情况,例如是否连接上TESTLINK上,要上传的用例是否是指定项目、计划、版本中的用例,上传用例也分两步,先上传测试结果和备注,如果还有附件上传,先获取刚才上传的结果ID,然后再上传附件,参考图6,图6是本发明实施例提供的上传测试结果的应用流程图,该方法应用于终端设备,如图6所示,该方法可以包括以下步骤:In the embodiment of the present invention, after the use case is executed, the work of uploading the result starts. With the help of the XML-RPC protocol, the corresponding result data is uploaded to the TESTLINK. Various situations are considered in the implementation, such as whether to connect to the TESTLINK. Whether the use case to be uploaded is the use case in the specified project, plan, or version, uploading the use case is also divided into two steps. First upload the test results and remarks. If there are attachments to upload, first obtain the result ID just uploaded, and then upload the attachments. Refer to Figure 6, Figure 6 is an application flow chart of uploading test results provided by an embodiment of the present invention. The method is applied to a terminal device. As shown in Figure 6, the method may include the following steps:

S601,点击结果上传按钮;S601, click the result upload button;

S602,判断TESTLINK是否连接成功;S602, determine whether the TESTLINK connection is successful;

S603,判断是否上传到这个项目、计划、构建和上传用户;S603, determine whether to upload to the project, plan, build and upload user;

S604,如果导入界面,显示结果上传,则没有文件选择这个情况,如果直接导入,需要选择要上传的结果文件;S604, if the import interface displays the result upload, and there is no file to select, if it is directly imported, the result file to be uploaded needs to be selected;

S605,选择上传全部的结果数据,还是最新数据;S605, choose to upload all the result data or the latest data;

S606,显示结果上传界面,并展示导入的结果数据;S606, displaying the result uploading interface, and displaying the imported result data;

S607,点击确认是否上传,是则执行S608,否则结束;S607, click to confirm whether to upload, if yes, execute S608, otherwise end;

S608,从TESTLINK获取用例,比对上传结果的数据;S608, obtain the use case from TESTLINK, and compare the data of the uploaded result;

S609,上传的数据正确,是则执行S610,否则跳转至S614;S609, the uploaded data is correct, if yes, execute S610, otherwise, jump to S614;

S610,开始上传测试结果和备注;S610, start uploading test results and remarks;

S611,判断上传是否成功,是则执行S612,否则跳转至S614;S611, judge whether the upload is successful, if yes, execute S612, otherwise, jump to S614;

S612,上传结果成功,检测是否有附件,如果有继续上传附件;S612, the upload result is successful, check whether there is an attachment, and continue to upload the attachment if there is;

S613,判断附件上传是否成功,是则结束,否则执行S614;S613, determine whether the upload of the attachment is successful, if yes, end, otherwise, execute S614;

S614,提示错误返回。S614, prompting error return.

本发明实施例在实施例一、二的基础上增加了执行用例和上传测试结果的流程,通过多线程通讯方式,能保证终端设备和POS终端的通讯可靠,POS终端能及时响应,利用提高测试效率。On the basis of the first and second embodiments, the embodiments of the present invention increase the process of executing use cases and uploading test results. Through the multi-threaded communication method, the communication between the terminal device and the POS terminal can be guaranteed to be reliable, the POS terminal can respond in time, and the use of improved test efficiency.

应理解,上述实施例一、二、三中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above-mentioned first, second, and third embodiments does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, rather than the implementation of the embodiments of the present invention. The process constitutes any qualification.

实施例四Embodiment 4

对应于上文实施例一、二、三所述的方法,参考图7,图7是本发明实施例提供的POS终端自动测试装置的结构框图,应用于终端设备,终端设备包括但不限于计算机、移动电话、口袋计算机(Pocket Personal Computer,PPC)、掌上电脑、笔记本电脑、个人数字助理(Personal Digital Assistant,PDA)、 MP4、MP3。为便于说明,仅示出了与本实施例相关的部分。为了便于说明,仅示出了与本实施例相关的部分。Corresponding to the methods described in Embodiments 1, 2, and 3 above, referring to FIG. 7 , FIG. 7 is a structural block diagram of the POS terminal automatic testing device provided by the embodiment of the present invention, which is applied to terminal equipment, and the terminal equipment includes but is not limited to a computer , mobile phone, pocket computer (Pocket Personal Computer, PPC), palmtop computer, notebook computer, personal digital assistant (Personal Digital Assistant, PDA), MP4, MP3. For convenience of description, only the parts related to this embodiment are shown. For convenience of explanation, only the parts related to this embodiment are shown.

参照图7,该POS终端自动测试装置包括:Referring to Figure 7, the POS terminal automatic test device includes:

下载模块71,用于使用远程过程调用XML-RPC协议,从基于web的用例管理系统TESTLINK上下载用例;The downloading module 71 is used for using the remote procedure call XML-RPC protocol to download the use case from the web-based use case management system TESTLINK;

筛选模块72,用于获取选择的测试属性,根据选择的测试属性,在下载的用例中筛选出要执行的用例;A screening module 72, configured to obtain the selected test attribute, and filter out the use case to be executed from the downloaded use cases according to the selected test attribute;

排序模块73,用于在要执行的用例中选择关键词进行排序,得到执行顺序;The sorting module 73 is used to select keywords in the use cases to be executed for sorting to obtain the execution order;

测试模块74,用于根据执行顺序,控制POS终端批处理或单个执行所述用例,执行结束后,上传测试结果。The test module 74 is configured to control the POS terminal to execute the use case in batch or individually according to the execution sequence, and upload the test result after the execution.

作为本实施例的一种实现方式,在该POS终端自动测试装置中,所述筛选模块,具体用于显示测试属性列表,所述测试属性列表包括测试模式、优先级、测试类型、测试时间、执行状态中的至少一种测试属性,根据选择操作,获取选择的测试属性,根据选择的测试属性,在下载的用例中筛选出用例;所述排序模块,具体用于选择关键词,采用选择的关键词以及多级排序方式,对要执行的用例进行排序,得到执行顺序,并显示排序后的用例。As an implementation of this embodiment, in the POS terminal automatic testing device, the screening module is specifically configured to display a test attribute list, where the test attribute list includes test mode, priority, test type, test time, At least one test attribute in the execution state, according to the selection operation, obtain the selected test attribute, and filter out the use case from the downloaded use cases according to the selected test attribute; the sorting module is specifically used for selecting keywords, using the selected test attribute. Keywords and multi-level sorting methods, sort the use cases to be executed, get the execution order, and display the sorted use cases.

作为本实施例的一种实现方式,在该POS终端自动测试装置中,所述测试模块,用于根据执行顺序,通过串口通讯协议或并口通讯协议,向POS终端发送执行用例的指令,等待POS终端执行完要执行的用例后,获取测试结果,上传测试结果到TESTLINK上;或者,As an implementation of this embodiment, in the POS terminal automatic test device, the test module is used to send an instruction for executing the use case to the POS terminal through a serial port communication protocol or a parallel port communication protocol according to the execution sequence, and wait for the POS terminal After the terminal executes the use case to be executed, obtain the test result and upload the test result to TESTLINK; or,

所述测试模块包括:The test module includes:

检测单元,用于采用心跳检测,判断自身和POS终端的通信链路是否正常连接;The detection unit is used for heartbeat detection to determine whether the communication link between itself and the POS terminal is normally connected;

监听单元,用于正常连接后,根据执行顺序,通过串口通讯协议,向POS 终端发送执行用例的指令,利用串口线程监听POS终端数据;The monitoring unit is used to send the instruction of executing the use case to the POS terminal through the serial port communication protocol according to the execution sequence after the normal connection, and use the serial port thread to monitor the data of the POS terminal;

记录单元,用于当监听到POS终端数据到来时,通知所述测试运行线程接收并处理POS终端数据,得到测试结果后,通知控制运行线程记录测试结果;The recording unit is used to notify the test operation thread to receive and process the POS terminal data when monitoring the arrival of the POS terminal data, and after obtaining the test result, notify the control operation thread to record the test result;

测试单元,用于记录完毕后,根据执行顺序增加下一条要执行的用例,依次往复;等待POS终端执行完要执行的用例后,获取测试结果,上传测试结果到TESTLINK上。The test unit is used to add the next use case to be executed according to the execution sequence after the recording is completed, and reciprocate in turn; after waiting for the POS terminal to complete the execution of the use case to be executed, obtain the test results and upload the test results to TESTLINK.

本发明实施例的有益效果在于两方面,一方面,通过测试属性,筛选出要执行的用例,实现了按需求执行用例,减少了人力资源投入,提高了测试效率,另一方面,通过使用可靠的协议和POS终端通讯,控制POS终端上的用例执行,实现了自动测试的目的。The beneficial effects of the embodiments of the present invention lie in two aspects. On the one hand, the use cases to be executed are screened out through the test attributes, which realizes the execution of use cases according to requirements, reduces the input of human resources, and improves the test efficiency. The protocol communicates with the POS terminal, controls the execution of the use case on the POS terminal, and realizes the purpose of automatic testing.

实施例五Embodiment 5

图8是本发明实施例提供的POS终端自动测试装置/终端设备的示意图。如图8所示,该实施例的POS终端自动测试装置/终端设备8包括:处理器80、存储器81以及存储在所述存储器81中并可在所述处理器80上运行的计算机程序82,例如POS终端自动测试程序。所述处理器80执行所述计算机程序82 时实现上述各个POS终端自动测试方法实施例中的步骤,例如图1所示的步骤 101至104。或者,所述处理器80执行所述计算机程序82时实现上述各装置实施例中各模块/单元的功能,例如图7所示模块71至74的功能。FIG. 8 is a schematic diagram of a POS terminal automatic testing apparatus/terminal device provided by an embodiment of the present invention. As shown in FIG. 8 , the POS terminal automatic testing device/terminal device 8 of this embodiment includes: a processor 80, a memory 81, and a computer program 82 stored in the memory 81 and running on the processor 80, Such as POS terminal automatic test program. When the processor 80 executes the computer program 82, it implements the steps in each of the above-mentioned embodiments of the automatic POS terminal testing method, for example, steps 101 to 104 shown in FIG. 1 . Alternatively, when the processor 80 executes the computer program 82 , the functions of the modules/units in the foregoing device embodiments, for example, the functions of the modules 71 to 74 shown in FIG. 7 , are implemented.

示例性的,所述计算机程序82可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器81中,并由所述处理器80执行,以完成本发明。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序82在所述POS终端自动测试装置/终端设备8中的执行过程。例如,所述计算机程序82可以被分割成下载模、筛选模块、排序模块、测试模块(虚拟装置中的模块),各模块具体功能如下:Exemplarily, the computer program 82 may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 81 and executed by the processor 80 to complete the this invention. The one or more modules/units may be a series of computer program instruction segments capable of accomplishing specific functions, and the instruction segments are used to describe the execution process of the computer program 82 in the POS terminal automatic testing device/terminal device 8 . For example, the computer program 82 can be divided into a download module, a screening module, a sorting module, and a testing module (modules in a virtual device), and the specific functions of each module are as follows:

下载模块,用于使用远程过程调用XML-RPC协议,从基于web的用例管理系统TESTLINK上下载用例;The download module is used to download use cases from the web-based use case management system TESTLINK using the remote procedure call XML-RPC protocol;

筛选模块,用于获取选择的测试属性,根据选择的测试属性,在下载的用例中筛选出要执行的用例;The filter module is used to obtain the selected test attributes, and filter out the use cases to be executed from the downloaded use cases according to the selected test attributes;

排序模块,用于在要执行的用例中选择关键词进行排序,得到执行顺序;The sorting module is used to select keywords in the use cases to be executed for sorting, and obtain the execution order;

测试模块,用于根据执行顺序,控制POS终端批处理或单个执行所述用例,执行结束后,上传测试结果。The test module is used to control the batch or single execution of the use case of the POS terminal according to the execution sequence, and upload the test result after the execution.

所述POS终端自动测试装置/终端设备8可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述POS终端自动测试装置/终端设备可包括,但不仅限于,处理器80、存储器81。本领域技术人员可以理解,图8 仅仅是POS终端自动测试装置/终端设备8的示例,并不构成对POS终端自动测试装置/终端设备8的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述POS终端自动测试装置/终端设备还可以包括输入输出设备、网络接入设备、总线等。The POS terminal automatic testing device/terminal device 8 may be computing devices such as a desktop computer, a notebook computer, a palmtop computer, and a cloud server. The POS terminal automatic testing device/terminal equipment may include, but is not limited to, a processor 80 and a memory 81 . Those skilled in the art can understand that FIG. 8 is only an example of the POS terminal automatic testing device/terminal device 8, and does not constitute a limitation on the POS terminal automatic testing device/terminal device 8, and may include more or less than shown in the figure. Components, or a combination of certain components, or different components, for example, the POS terminal automatic test device/terminal equipment may also include input and output devices, network access devices, buses, and the like.

所称处理器80可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 80 may be a central processing unit (Central Processing Unit, CPU), and may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.

所述存储器81可以是所述POS终端自动测试装置/终端设备8的内部存储单元,例如POS终端自动测试装置/终端设备8的硬盘或内存。所述存储器81 也可以是所述POS终端自动测试装置/终端设备8的外部存储设备,例如所述 POS终端自动测试装置/终端设备8上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card) 等。进一步地,所述存储器81还可以既包括所述POS终端自动测试装置/终端设备8的内部存储单元也包括外部存储设备。所述存储器81用于存储所述计算机程序以及所述POS终端自动测试装置/终端设备所需的其他程序和数据。所述存储器81还可以用于暂时地存储已经输出或者将要输出的数据。所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。The memory 81 may be an internal storage unit of the POS terminal automatic testing device/terminal device 8 , such as a hard disk or a memory of the POS terminal automatic testing device/terminal device 8 . The memory 81 may also be an external storage device of the POS terminal automatic testing device/terminal device 8, such as a plug-in hard disk equipped on the POS terminal automatic testing device/terminal device 8, a smart memory card (Smart Media Card). , SMC), secure digital (Secure Digital, SD) card, flash memory card (Flash Card) and so on. Further, the memory 81 may also include both an internal storage unit of the POS terminal automatic testing apparatus/terminal device 8 and an external storage device. The memory 81 is used for storing the computer program and other programs and data required by the POS terminal automatic testing device/terminal equipment. The memory 81 can also be used to temporarily store data that has been output or will be output. Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. Module completion, that is, dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated in one processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit, and the above-mentioned integrated units may adopt hardware. It can also be realized in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present application. For the specific working processes of the units and modules in the above-mentioned system, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the foregoing embodiments, the description of each embodiment has its own emphasis. For parts that are not described or described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the present invention.

在本发明所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided by the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other manners. For example, the apparatus/terminal device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units. Or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and 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 in this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.

所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括是电载波信号和电信信号。The integrated modules/units, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the methods of the above embodiments, and can also be completed by instructing relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, the steps of the foregoing method embodiments can be implemented. . Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable media may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer-readable media Excluded are electrical carrier signals and telecommunication signals.

所述装置/终端设备可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述装置/终端设备可包括,但不仅限于,处理器、存储器。本领域技术人员可以理解,所述示意图仅仅是装置/终端设备的示例,并不构成对装置/终端设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述装置/终端设备还可以包括输入输出设备、网络接入设备、总线等。The device/terminal device may be a computing device such as a desktop computer, a notebook computer, a palmtop computer, and a cloud server. The apparatus/terminal equipment may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that the schematic diagram is only an example of an apparatus/terminal device, and does not constitute a limitation to the apparatus/terminal device, and may include more or less components than those shown in the figure, or combine certain components, or Different components, such as the apparatus/terminal device, may also include input and output devices, network access devices, buses, and the like.

所称处理器可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等,所述处理器是所述装置/终端设备的控制中心,利用各种接口和线路连接整个装置/终端设备的各个部分。The processor may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf processors Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The processor is the control center of the device/terminal device, and uses various interfaces and lines to connect the entire device/terminal device. various parts.

所述存储器可用于存储所述计算机程序和/或模块,所述处理器通过运行或执行存储在所述存储器内的计算机程序和/或模块,以及调用存储在存储器内的数据,实现所述装置/终端设备的各种功能。所述存储器可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD) 卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory can be used to store the computer program and/or module, and the processor implements the apparatus by running or executing the computer program and/or module stored in the memory and calling the data stored in the memory / Various functions of the terminal device. The memory may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may store Data (such as audio data, phonebook, etc.) created according to the usage of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory such as hard disk, internal memory, plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card , a flash memory card (Flash Card), at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.

以上所述实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围,均应包含在本发明的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it is still possible to implement the foregoing implementations. The technical solutions described in the examples are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the within the protection scope of the present invention.

Claims (8)

1. A POS terminal automatic test method is characterized by comprising the following steps:
downloading a specified use case from a web-based use case management system TEST L INK by using a remote procedure call XM L-RPC protocol;
acquiring the selected test attribute, and screening out the use cases to be executed from the downloaded use cases according to the selected test attribute;
selecting keywords, selecting more than one keyword for sorting the use cases to be executed by adopting the selected keywords and a multi-level sorting mode to obtain an execution sequence, and displaying the sorted use cases, wherein the keywords have more than one priority attribute, and the obtained execution sequence is an execution sequence with newly sorted data obtained by deleting the originally displayed data according to the more than one priority attribute;
according to the execution sequence, a multi-thread coordinated communication mode is adopted to control the POS terminal to carry out batch processing or single execution of the use cases, and after the execution is finished, a test result is uploaded, wherein the multi-thread comprises a test running thread; if the testing environment of the POS terminal needs to be modified in the execution process, receiving an instruction sent by the POS terminal, and modifying according to the instruction;
the POS terminal is controlled to process the cases in batch or execute the cases singly according to the execution sequence, and after the execution is finished, the test result is uploaded, and the method specifically comprises the following steps:
judging whether a communication link between the communication link and the POS terminal is normally connected or not by adopting heartbeat detection;
after normal connection, according to an execution sequence, sending an instruction of executing a case to the POS terminal through a serial port communication protocol, and monitoring POS terminal data by using a serial port thread;
when the POS terminal data is monitored to arrive, informing the test operation thread to receive and process the POS terminal data, and after a test result is obtained, informing the control operation thread to record the test result;
after the recording is finished, adding the next use case to be executed according to the execution sequence, and reciprocating in sequence;
and after the POS terminal finishes executing the to-be-executed use case, acquiring a TEST result, and uploading the TEST result to TEST L INK.
2. The method of claim 1, wherein the obtaining of the selected test attributes, and the screening of the cases to be executed from the downloaded cases according to the selected test attributes, specifically:
displaying a test attribute list, wherein the test attribute list comprises at least one test attribute of a test mode, a priority, a test type, test time and an execution state;
acquiring the selected test attribute according to the selection operation;
and screening out the use cases from the downloaded use cases according to the selected test attributes.
3. The method according to claim 1 or 2, wherein the POS terminal is controlled to perform the batch processing or the single execution of the use cases according to the execution sequence, and after the execution is finished, the test result is uploaded, specifically:
according to the execution sequence, sending a command for executing the use case to the POS terminal through a serial communication protocol or a parallel communication protocol, obtaining a TEST result after the POS terminal finishes executing the use case to be executed, and uploading the TEST result to TEST L INK.
4. An automatic testing device for a POS terminal, comprising:
the download module is used for downloading the specified use case from a web-based use case management system TEST L INK by using a remote procedure call XM L-RPC protocol;
the screening module is used for acquiring the selected test attributes and screening the cases to be executed from the downloaded cases according to the selected test attributes;
the system comprises a sorting module, a display module and a display module, wherein the sorting module is used for selecting keywords, selecting more than one keyword for sorting the use cases to be executed by adopting the selected keywords and a multi-stage sorting mode to obtain an execution sequence and displaying the sorted use cases, the keywords have more than one priority attribute, and the obtained execution sequence is an execution sequence with newly sorted data obtained by deleting originally displayed data according to the more than one priority attribute;
the test module is used for controlling the POS terminal to carry out batch processing or single execution of the use cases in a multi-thread coordinated communication mode according to the execution sequence, and uploading a test result after the execution is finished, wherein the multi-thread comprises a test running thread; if the testing environment of the POS terminal needs to be modified in the execution process, receiving an instruction sent by the POS terminal, and modifying according to the instruction;
the TEST module comprises a detection unit, a monitoring unit, a recording unit, a TEST unit and a TEST unit, wherein the detection unit is used for judging whether a communication link between the detection unit and a POS terminal is normally connected or not by adopting heartbeat detection, the monitoring unit is used for sending an instruction of executing a case to the POS terminal through a serial port communication protocol according to an execution sequence after the normal connection and monitoring POS terminal data by using a serial port thread, the recording unit is used for informing a TEST operation thread to receive and process the POS terminal data when the POS terminal data arrives and informing a control operation thread to record a TEST result after the TEST result is obtained, the TEST unit is used for increasing the next case to be executed according to the execution sequence after the recording is finished and sequentially reciprocating, and the TEST result is obtained after the POS terminal finishes executing the case to be executed and is uploaded to TEST L INK.
5. The apparatus of claim 4, wherein the screening module is specifically configured to display a test attribute list, where the test attribute list includes at least one test attribute of a test mode, a priority, a test type, a test time, and an execution state, obtain the selected test attribute according to the selection operation, and screen the use case from the downloaded use cases according to the selected test attribute.
6. The apparatus of claim 4,
and the TEST module is used for sending a command for executing the use case to the POS terminal through a serial communication protocol or a parallel communication protocol according to the execution sequence, acquiring a TEST result after the POS terminal finishes executing the use case to be executed, and uploading the TEST result to TEST L INK.
7. A POS terminal automatic test equipment/terminal device comprising a memory, a processor and a computer program stored in said memory and executable on said processor, characterized in that said processor, when executing said computer program, implements the steps of the method according to any one of claims 1 to 3.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 3.
CN201710440337.8A 2017-06-12 2017-06-12 A kind of POS terminal automatic testing method and device Active CN107391361B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710440337.8A CN107391361B (en) 2017-06-12 2017-06-12 A kind of POS terminal automatic testing method and device
PCT/CN2017/095891 WO2018227735A1 (en) 2017-06-12 2017-08-03 Pos terminal automatic testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710440337.8A CN107391361B (en) 2017-06-12 2017-06-12 A kind of POS terminal automatic testing method and device

Publications (2)

Publication Number Publication Date
CN107391361A CN107391361A (en) 2017-11-24
CN107391361B true CN107391361B (en) 2020-07-28

Family

ID=60333288

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710440337.8A Active CN107391361B (en) 2017-06-12 2017-06-12 A kind of POS terminal automatic testing method and device

Country Status (2)

Country Link
CN (1) CN107391361B (en)
WO (1) WO2018227735A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110209590B (en) * 2019-06-05 2023-04-21 山东科技大学 Automatic testing method and system for intelligent robot
CN113778771B (en) * 2021-09-14 2023-07-18 百富计算机技术(深圳)有限公司 Method, system and storage medium for terminal testing
CN114328218A (en) * 2021-12-28 2022-04-12 宁夏隆基宁光仪表股份有限公司 A method for controlling the automatic execution of test program of intelligent instrument

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104866421A (en) * 2015-05-08 2015-08-26 深圳市新国都技术股份有限公司 Testing method and testing system of POS terminal
CN106598874A (en) * 2017-02-08 2017-04-26 郑州云海信息技术有限公司 Method and device for automatically testing software

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103106138B (en) * 2011-11-15 2016-03-09 阿里巴巴集团控股有限公司 The method that test case is synchronous with test script and device
CN104331360A (en) * 2013-07-23 2015-02-04 上海斐讯数据通信技术有限公司 Automatic testing platform
US9811480B2 (en) * 2014-03-14 2017-11-07 Google Inc. Universal serial bus emulation of peripheral devices

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104866421A (en) * 2015-05-08 2015-08-26 深圳市新国都技术股份有限公司 Testing method and testing system of POS terminal
CN106598874A (en) * 2017-02-08 2017-04-26 郑州云海信息技术有限公司 Method and device for automatically testing software

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
使用TestLink管理软件功能测试过程;祝尚元;《https://www.ibm.com/developerworks/cn/opensource/os-cn-testlink2/index.html》;20130704;第1-9页 *

Also Published As

Publication number Publication date
WO2018227735A1 (en) 2018-12-20
CN107391361A (en) 2017-11-24

Similar Documents

Publication Publication Date Title
US9977668B2 (en) Automatic updating of applications
US20090228868A1 (en) Batch configuration of multiple target devices
CN105409160B (en) System for remote control of electronic equipment and operation method thereof
CN110633032B (en) Icon display method and device for terminal equipment
CN105453032B (en) Extracting operating system specific characteristics via a communication interface
WO2018227736A1 (en) Test construction method and device
CN103218107A (en) Method and system to provide user interface with respect to multiple applications
CN112347048B (en) Electronic device and method for sharing data thereof
WO2020000445A1 (en) Method for browsing folder of application, and electronic device
CN107193598A (en) Application starting method, mobile terminal and computer readable storage medium
CN116265972B (en) Power consumption display method of mobile device and mobile device
CN107391361B (en) A kind of POS terminal automatic testing method and device
CN107943686A (en) A kind of test dispatching method, apparatus, server and storage medium
CN112330306A (en) Business Process-Based Business Processing Method and Device
CN109104481B (en) File integrity detection method, file integrity detection device and terminal equipment
CN105138383A (en) Application display method and device
CN109271266B (en) File transfer method, device and terminal device
CN109298956B (en) File transmission method and device and terminal equipment
WO2022237826A1 (en) User interface testing method and system, cluster, medium, and program product
CN114518984A (en) Reporting method and device of embedded point information, storage medium and terminal equipment
CN108021301A (en) A kind of volume adjusting method, terminal device and computer-readable recording medium
CN115098468B (en) Flexible data migration method and device, storage medium and electronic equipment
CN114896159A (en) Joint debugging test method, device, storage medium and electronic equipment
CN115525554A (en) Model automated testing method, system and storage medium
CN115965328A (en) An information processing method, device, equipment and medium

Legal Events

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