[go: up one dir, main page]

CN114546740A - Touch screen testing method, device and system and storage medium - Google Patents

Touch screen testing method, device and system and storage medium Download PDF

Info

Publication number
CN114546740A
CN114546740A CN202210099863.3A CN202210099863A CN114546740A CN 114546740 A CN114546740 A CN 114546740A CN 202210099863 A CN202210099863 A CN 202210099863A CN 114546740 A CN114546740 A CN 114546740A
Authority
CN
China
Prior art keywords
control
touch screen
operated
image data
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210099863.3A
Other languages
Chinese (zh)
Inventor
李海霞
兰瑶
杨静
李玉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yizhi Times Technology Co ltd
Original Assignee
Shenzhen Yizhi Times Technology 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 Shenzhen Yizhi Times Technology Co ltd filed Critical Shenzhen Yizhi Times Technology Co ltd
Priority to CN202210099863.3A priority Critical patent/CN114546740A/en
Publication of CN114546740A publication Critical patent/CN114546740A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/2221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test input/output devices or peripheral units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

本发明提供一种触摸屏测试方法、装置、系统及存储介质,该方法包括:实时获取显示于待测设备的触摸屏中的第一图像数据;根据测试任务的配置信息,获取待操作控件的特征数据,并根据特征数据确定第一图像数据中是否存在待操作控件;确定第一图像数据中存在待操作控件,则根据该操作控件的图像坐标获取对应的控件实际坐标;控制机械臂的执行末端移动至控件实际坐标,对待测设备的触摸屏执行第一操作;获取显示于待测设备的触摸屏中的第二图像数据,根据第二图像数据确定测试任务的测试结果。本发明不依赖于UI控件属性,而通过机器视觉实时对触摸屏界面的控件进行精准定位,模拟人工操作的同时提高了测试效率。

Figure 202210099863

The invention provides a touch screen testing method, device, system and storage medium. The method includes: acquiring first image data displayed on a touch screen of a device to be tested in real time; acquiring feature data of a control to be operated according to configuration information of a test task , and determine whether there is a control to be operated in the first image data according to the feature data; determine that there is a control to be operated in the first image data, then obtain the actual coordinates of the corresponding control according to the image coordinates of the operation control; control the execution end of the robotic arm to move To the actual coordinates of the control, perform the first operation on the touch screen of the device under test; acquire second image data displayed on the touch screen of the device under test, and determine the test result of the test task according to the second image data. The present invention does not depend on the attributes of UI controls, and accurately locates the controls of the touch screen interface in real time through machine vision, which improves test efficiency while simulating manual operations.

Figure 202210099863

Description

触摸屏测试方法、装置、系统及存储介质Touch screen testing method, device, system and storage medium

技术领域technical field

本发明涉及产品测试技术领域,尤其涉及一种触摸屏测试方法、装置、系统及存储介质。The invention relates to the technical field of product testing, in particular to a touch screen testing method, device, system and storage medium.

背景技术Background technique

目前,市面上的触摸屏类电子产品种类繁多,功能丰富,其系统版本迭代更新速度快。对这类触摸屏类产品进行自动化测试,通常是通过获取UI控件属性进行操作或者通过测试指令来操控UI控件。但这一方法存在以下缺陷:有时会出现无法获取到控件属性,导致无法操作UI界面,例如:第三方定制化应用不支持用户获取控件属性或Android系统升级后部分控件无法获取属性。At present, there are a wide variety of touch-screen electronic products on the market with rich functions, and their system versions are iteratively updated quickly. Automated testing of such touch screen products is usually performed by obtaining properties of UI controls or manipulating UI controls through test instructions. However, this method has the following defects: sometimes the control properties cannot be obtained, resulting in the inability to operate the UI interface. For example, third-party customized applications do not support users to obtain control properties or some controls cannot obtain properties after the Android system is upgraded.

发明内容SUMMARY OF THE INVENTION

本发明旨在至少解决现有技术中存在的技术问题之一。为此,本发明实施例提出一种触摸屏测试方法、装置、系统及存储介质。The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, embodiments of the present invention provide a touch screen testing method, device, system, and storage medium.

一方面,本发明实施例提供一种触摸屏测试方法,包括:实时获取显示于待测设备的触摸屏中的第一图像数据;根据测试任务的配置信息,获取待操作控件的特征数据,并根据所述特征数据确定所述第一图像数据中是否存在所述待操作控件;若确定存在所述待操作控件,则获取所述待操作控件在所述第一图像数据中的图像坐标,并根据所述图像坐标获取对应的控件实际坐标,所述控件实际坐标用于表征所述待操作控件在所述待测设备的触摸屏侧的位置;控制机械臂的执行末端移动至所述控件实际坐标,对所述待测设备的触摸屏执行第一操作,其中所述第一操作由所述测试任务的配置确定;获取显示于所述待测设备的触摸屏中的第二图像数据,根据所述第二图像数据确定所述测试任务的测试结果;所述第二图像数据用于表征执行所述第一操作后所述待测设备的触摸屏的显示图像。On the one hand, an embodiment of the present invention provides a touch screen testing method, including: acquiring first image data displayed on a touch screen of a device under test in real time; acquiring feature data of a control to be operated according to configuration information of a test task, and The feature data determines whether the to-be-operated control exists in the first image data; if it is determined that the to-be-operated control exists, acquire the image coordinates of the to-be-operated control in the first image data, and according to the The image coordinates are used to obtain the corresponding actual coordinates of the control, and the actual coordinates of the control are used to represent the position of the control to be operated on the touch screen side of the device under test; control the execution end of the robotic arm to move to the actual coordinates of the control. The touch screen of the device under test performs a first operation, wherein the first operation is determined by the configuration of the test task; acquires second image data displayed on the touch screen of the device under test, according to the second image The data determines the test result of the test task; the second image data is used to represent the display image of the touch screen of the device under test after the first operation is performed.

根据本发明实施例的触摸屏测试方法,至少具有如下有益效果:通过对待测设备的触控屏进行实时拍摄,识别出测试任务中对应的待操作控件,通过该待操作控件的图像坐标获取对应的控件实际坐标,将机械臂的执行末端移动至控件实际坐标,对触摸屏上的待操作控件进行相应的操作,并获取待测设备响应的显示图像,生成相应的测试结果;不依赖于UI控件属性,而通过机器视觉实时对触摸屏界面的控件进行精准定位,控制机械手对触摸屏类产品进行UI界面控件操作,模拟人工操作的同时提高了测试效率,避免了绕过触摸屏使用命令或者串口等方式进行操作,与用户实际操作不一致而导致的测试误差。The touch screen testing method according to the embodiment of the present invention has at least the following beneficial effects: by performing real-time photography on the touch screen of the device to be tested, the corresponding control to be operated in the test task is identified, and the corresponding control to be operated is obtained through the image coordinates of the control to be operated. The actual coordinates of the control, move the execution end of the robotic arm to the actual coordinates of the control, perform corresponding operations on the control to be operated on the touch screen, and obtain the display image of the response of the device to be tested, and generate the corresponding test results; independent of UI control properties , and through machine vision, the controls of the touch screen interface are accurately positioned in real time, and the manipulator is controlled to operate the UI interface controls on the touch screen products, which simulates the manual operation and improves the test efficiency, avoiding the use of commands or serial ports bypassing the touch screen. , the test error caused by the inconsistency with the actual operation of the user.

根据本发明的一些实施例,所述待操作控件的特征数据包括所述待操作控件的第三图像数据;所述根据所述特征数据确定所述第一图像数据中是否存在所述待操作控件,包括:通过图像识别,获取匹配结果,所述匹配结果用于表征所述第一图像数据中是否存在与所述第三图像数据匹配的区域;若所述匹配结果为存在与所述第三图像数据匹配的区域,则确定所述第一图像数据中存在所述待操作控件。According to some embodiments of the present invention, the feature data of the to-be-operated control includes third image data of the to-be-operated control; the determining whether the to-be-operated control exists in the first image data according to the feature data , including: obtaining a matching result through image recognition, where the matching result is used to represent whether there is an area matching the third image data in the first image data; if the matching result is that there is an area matching the third image data; If the image data matches the area, it is determined that the control to be operated exists in the first image data.

根据本发明的一些实施例,所述待操作控件的特征数据包括第一文字,所述第一文字用于表征所述待操作控件显示的文字信息;所述根据所述特征数据确定所述第一图像数据中是否存在所述待操作控件,包括:获取所述第一图像数据的文字识别结果;若所述文字识别结果中包括所述第一文字,则确定所述第一图像数据中存在所述待操作控件。According to some embodiments of the present invention, the feature data of the to-be-operated control includes a first character, and the first character is used to represent text information displayed by the to-be-operated control; the first image is determined according to the feature data Whether the to-be-operated control exists in the data includes: acquiring the text recognition result of the first image data; if the text recognition result includes the first text, determining that the to-be-operated control exists in the first image data Action controls.

根据本发明的一些实施例,所述测试任务的配置信息包括:所述待操作控件的第一位置,所述第一位置用于表征所述待操作控件显示于所述待测设备的触摸屏时所在的分区信息;所述根据所述特征数据确定所述第一图像数据中是否存在所述待操作控件包括:根据所述第一位置,从所述第一图像数据中获取相应的识别区域图像;根据所述特征数据确定所述识别区域图像中是否存在所述待操作控件。According to some embodiments of the present invention, the configuration information of the test task includes: a first position of the control to be operated, where the first position is used to represent when the control to be operated is displayed on the touch screen of the device under test The partition information where it is located; the determining whether the control to be operated exists in the first image data according to the feature data includes: obtaining a corresponding recognition area image from the first image data according to the first position ; Determine whether the control to be operated exists in the recognition area image according to the feature data.

根据本发明的一些实施例,所述根据所述图像坐标获取对应的所述控件实际坐标包括:根据所述待测设备的类型,获取相应的校准数据;所述校准数据用于表征对于所述待测设备的触摸屏,所述执行末端的实际移动距离与图像显示移动距离的映射关系;根据所述校准数据,将所述图像坐标转换为所述控件实际坐标。According to some embodiments of the present invention, the obtaining the corresponding actual coordinates of the control according to the image coordinates includes: obtaining corresponding calibration data according to the type of the device under test; the calibration data is used to represent The touch screen of the device under test, the mapping relationship between the actual movement distance of the execution end and the image display movement distance; according to the calibration data, the image coordinates are converted into the actual coordinates of the control.

根据本发明的一些实施例,所述校准数据的获取方法包括:通过交互界面显示对所述待测设备的触摸屏的实时拍摄图像;在所述实时拍摄图像中,将所述待测设备的触摸屏区域确定为第一区域,并在所述第一区域中确定第一校准点和第二校准点;控制所述执行末端从原点位置移动,以使所述执行末端在所述实时拍摄图像中与所述第一校准点对齐,得到所述执行末端的第一实际坐标;控制所述执行末端移动,以使所述执行末端在所述实时拍摄图像中与所述第二校准点对齐,得到所述执行末端的第二实际坐标;根据所述第一校准点的屏幕坐标、所述第一校准点的屏幕坐标、所述第一实际坐标和所述第二实际坐标,获取所述校准数据。According to some embodiments of the present invention, the method for acquiring the calibration data includes: displaying a real-time captured image of the touch screen of the device under test through an interactive interface; in the real-time captured image, the touch screen of the device under test is The area is determined as a first area, and a first calibration point and a second calibration point are determined in the first area; the execution end is controlled to move from the origin position, so that the execution end is in the real-time captured image with the The first calibration point is aligned to obtain the first actual coordinates of the execution end; the movement of the execution end is controlled so that the execution end is aligned with the second calibration point in the real-time captured image, and the execution end is obtained. obtaining the calibration data according to the screen coordinates of the first calibration point, the screen coordinates of the first calibration point, the first actual coordinates and the second actual coordinates.

根据本发明的一些实施例,所述方法还包括配置所述机械臂的水平面的轴向移动速度和触控延时;所述控制所述机械臂的执行末端移动至所述控件实际坐标,对所述待测设备的触摸屏执行第一操作包括:根据所述待测设备的厚度,调节所述执行末端的高度;根据所述机械臂的水平面的轴向移动速度,控制所述机械臂的执行末端移动至所述控件实际坐标;等待所述触控延时,对所述待测设备的触摸屏执行所述第一操作。According to some embodiments of the present invention, the method further includes configuring the axial movement speed and touch delay of the horizontal plane of the manipulator; the controlling the execution end of the manipulator to move to the actual coordinates of the control, Performing the first operation on the touch screen of the device under test includes: adjusting the height of the execution end according to the thickness of the device under test; controlling the execution of the robot arm according to the axial movement speed of the horizontal plane of the robot arm The terminal moves to the actual coordinates of the control; and after the touch delay is delayed, the first operation is performed on the touch screen of the device under test.

另一方面,本发明实施例提供一种触摸屏测试装置,包括:第一模块,用于实时获取显示于待测设备的触摸屏中的第一图像数据;第二模块,用于根据测试任务的配置信息,获取待操作控件的特征数据,并根据所述特征数据确定所述第一图像数据中是否存在所述待操作控件;第三模块,用于若确定存在所述待操作控件,则获取所述待操作控件在所述第一图像数据中的图像坐标,并根据所述图像坐标获取对应的控件实际坐标,所述控件实际坐标用于表征所述待操作控件在所述待测设备的触摸屏侧的位置;第四模块,用于控制机械臂的执行末端移动至所述控件实际坐标,对所述待测设备的触摸屏执行第一操作,其中所述第一操作由所述测试任务的配置确定;第五模块,用于获取显示于所述待测设备的触摸屏中的第二图像数据,根据所述第二图像数据确定所述测试任务的测试结果;所述第二图像数据用于表征执行所述第一操作后所述待测设备的触摸屏的显示图像。On the other hand, an embodiment of the present invention provides a touch screen testing device, including: a first module for acquiring first image data displayed on a touch screen of a device under test in real time; a second module for configuring according to a test task information, obtain the characteristic data of the control to be operated, and determine whether the control to be operated exists in the first image data according to the characteristic data; the third module is used for obtaining the control to be operated if it is determined that the control to be operated exists. The image coordinates of the control to be operated in the first image data, and the corresponding actual coordinates of the control are obtained according to the image coordinates, and the actual coordinates of the control are used to represent the control to be operated on the touch screen of the device under test. The fourth module is used to control the execution end of the robotic arm to move to the actual coordinates of the control, and perform a first operation on the touch screen of the device under test, wherein the first operation is determined by the configuration of the test task determine; the fifth module is used to acquire second image data displayed on the touch screen of the device under test, and determine the test result of the test task according to the second image data; the second image data is used to represent A display image of the touch screen of the device under test after the first operation is performed.

根据本发明实施例的触摸屏测试装置,至少具有如下有益效果:通过对待测设备的触控屏进行实时拍摄,识别出测试任务中对应的待操作控件,通过该待操作控件的图像坐标获取对应的控件实际坐标,将机械臂的执行末端移动至控件实际坐标,对触摸屏上的待操作控件进行相应的操作,并获取待测设备响应的显示图像,生成相应的测试结果;不依赖于UI控件属性,而通过机器视觉实时对触摸屏界面的控件进行精准定位,控制机械手对触摸屏类产品进行UI界面控件操作,模拟人工操作的同时提高了测试效率,避免了绕过触摸屏使用命令或者串口等方式进行操作,与用户实际操作不一致而导致的测试误差。The touch screen testing device according to the embodiment of the present invention has at least the following beneficial effects: by performing real-time photography on the touch screen of the device to be tested, the corresponding control to be operated in the test task is identified, and the corresponding control to be operated is obtained through the image coordinates of the control to be operated. The actual coordinates of the control, move the execution end of the robotic arm to the actual coordinates of the control, perform corresponding operations on the control to be operated on the touch screen, and obtain the display image of the response of the device to be tested, and generate the corresponding test results; independent of UI control properties , and through machine vision, the controls of the touch screen interface are accurately positioned in real time, and the manipulator is controlled to operate the UI interface controls on the touch screen products, which simulates the manual operation and improves the test efficiency, avoiding the use of commands or serial ports bypassing the touch screen. , the test error caused by the inconsistency with the actual operation of the user.

另一方面,本发明实施例提供一种触摸屏测试系统,包括:机械臂,通过串口与计算机设备连接,用于接收计算机设备的指令控制执行末端移动,对待测设备的触摸屏执行触控操作;摄像装置,架设于所述待测设备的上方,用于对显示于所述待测设备的触摸屏的图像进行实时拍摄;计算机设备,包括至少一个处理器,和,用于存储至少一个程序的至少一个存储器,当所述至少一个程序被所述至少一个处理器执行,使得所述至少一个处理器实现如上所述的触摸屏测试方法。On the other hand, an embodiment of the present invention provides a touch screen testing system, including: a robotic arm, connected to a computer device through a serial port, for receiving an instruction from the computer device to control the execution of terminal movement, and to perform a touch operation on the touch screen of the device to be tested; a camera; The device is erected above the device to be tested, and is used for real-time shooting of images displayed on the touch screen of the device to be tested; computer equipment, including at least one processor, and at least one for storing at least one program The memory, when the at least one program is executed by the at least one processor, enables the at least one processor to implement the above-described touch screen testing method.

另一方面,本一种计算机可读存储介质,所述存储介质内存储有程序指令,所述程序指令被处理器执行时实现上述的触摸屏测试方法。On the other hand, a computer-readable storage medium of the present invention stores program instructions in the storage medium, and when the program instructions are executed by a processor, the above-mentioned touch screen testing method is implemented.

本发明的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。Additional aspects and advantages of the present invention will be set forth, in part, from the following description, and in part will be apparent from the following description, or may be learned by practice of the invention.

附图说明Description of drawings

本发明的上述和/或附加的方面和优点从结合下面附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of embodiments taken in conjunction with the accompanying drawings, wherein:

图1是本发明实施例提供的触控屏测试方法的步骤流程图。FIG. 1 is a flow chart of steps of a touch screen testing method provided by an embodiment of the present invention.

图2是本发明实施例中校准数据的获取方法的步骤流程图。FIG. 2 is a flowchart of steps of a method for acquiring calibration data in an embodiment of the present invention.

图3是本发明实施例中针对不同类型的测试设备将图像坐标转为实际坐标的示意图。3 is a schematic diagram of converting image coordinates into actual coordinates for different types of testing equipment in an embodiment of the present invention.

图4是本发明实施例提供的触控屏测试装置的模块示意图。FIG. 4 is a schematic block diagram of a touch screen testing device provided by an embodiment of the present invention.

图5是本发明实施例提供的触控屏测试系统中各设备的连接示意图。FIG. 5 is a schematic diagram of the connection of each device in the touch screen test system provided by the embodiment of the present invention.

具体实施方式Detailed ways

下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。在后续的描述中,使用用于表示元件的诸如“模块”、“部件”或“单元”的后缀仅为了有利于本发明的说明,其本身没有特有的意义。因此,“模块”、“部件”或“单元”可以混合地使用。“第一”、“第二”等只是用于区分技术特征为目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量或者隐含指明所指示的技术特征的先后关系。在本后续的描述中,对方法步骤的连续标号是为了方便审查和理解,结合本发明的整体技术方案以及各个步骤之间的逻辑关系,调整步骤之间的实施顺序并不会影响本发明技术方案所达到的技术效果。下面通过参考附图描述的实施例是示例性的,仅用于解释本发明,而不能理解为对本发明的限制。The following describes in detail the embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. In the ensuing description, suffixes such as 'module', 'component' or 'unit' used to represent elements are used only to facilitate the description of the present invention, and have no specific meaning per se. Thus, "module", "component" or "unit" may be used interchangeably. "First", "second", etc. are only used for the purpose of distinguishing technical features, and should not be understood as indicating or implying relative importance, or implicitly indicating the number of indicated technical features or implicitly indicating the indicated technical features. successive relationship. In the following description, the consecutive numbers on the method steps are for the convenience of review and understanding. Combined with the overall technical solution of the present invention and the logical relationship between the various steps, adjusting the execution order of the steps will not affect the technology of the present invention. The technical effect achieved by the program. The embodiments described below with reference to the accompanying drawings are exemplary, only used to explain the present invention, and should not be construed as a limitation of the present invention.

目前,对于触摸屏类产品进行自动化测试的方法,主要是通过获取UI控件属性对控件进行操作或者通过测试命令等进行操作。但这种试方法均存在一定的缺陷。例如,采用Uiautomator、Appium、Airtest等自动化测试框架,获取UI界面控件属性,对控件进行操作的自动化测试。会存在两方面的缺陷。一方面,有时会出现无法获取到控件属性,导致无法操作对应的UI界面控件,例如:第三方定制化应用不支持用户获取控件属性,或者,Android系统升级后部分控件无法获取属性。另一方面,通过测试命令进行测试的方法,脱离了用户的实际使用场景,可能因此而存在一定的测试偏差。At present, the method for automated testing of touch screen products is mainly to operate the control by obtaining the properties of the UI control or to operate the control through a test command or the like. However, this test method has certain defects. For example, using automated test frameworks such as Uiautomator, Appium, and Airtest to obtain the properties of UI interface controls, and perform automated tests on controls. There are two flaws. On the one hand, sometimes the control attributes cannot be obtained, resulting in the inability to operate the corresponding UI interface controls. For example, third-party customized applications do not support users to obtain control attributes, or some controls cannot obtain attributes after the Android system is upgraded. On the other hand, the method of testing through the test command is out of the actual usage scenario of the user, and there may be a certain test deviation due to this.

为此,本发明提供一种触控屏测试方法,能够通过机器视觉对触摸屏界面的控件进行精准定位,控制机械手对触摸屏类产品进行UI界面控件操作,以模拟用户实际使用场景。由于本发明不依赖于UI界面控件属性的获取,因此也就可以避免依赖于产品的操作系统的编程,降低对测试人员的技术要求而提高测试效率。To this end, the present invention provides a touch screen testing method, which can accurately locate the controls of the touch screen interface through machine vision, and control the manipulator to operate the UI interface controls on the touch screen products, so as to simulate the actual use scene of the user. Since the present invention does not depend on the acquisition of UI interface control attributes, it can also avoid programming dependent on the operating system of the product, reduce technical requirements for testers and improve test efficiency.

参照图1,本实施例公开了一种触控屏测试方法,可对具有触控屏的待测设备进行测试,包括但不限于以下步骤S100至S500。Referring to FIG. 1 , this embodiment discloses a touch screen testing method, which can test a device under test with a touch screen, including but not limited to the following steps S100 to S500 .

步骤S100,实时获取显示于待测设备的触摸屏中的第一图像数据。Step S100, acquiring the first image data displayed on the touch screen of the device under test in real time.

具体地,将摄像装置架设于待测设备的上方,对包括待测设备的触摸屏的区域进行拍摄,以实时获取待测设备的触摸屏中的显示画面,作为第一图像数据。该摄像装置可以通过USB线发送拍摄的第一图像数据。Specifically, the camera device is erected above the device to be tested, and the area including the touch screen of the device to be tested is photographed, so as to obtain the display screen on the touch screen of the device to be tested in real time as the first image data. The camera device can send the captured first image data through a USB cable.

步骤S200,根据测试任务的配置信息,获取待操作控件的特征数据,并根据特征数据确定第一图像数据中是否存在待操作控件。Step S200: Acquire characteristic data of the control to be operated according to the configuration information of the test task, and determine whether the control to be operated exists in the first image data according to the characteristic data.

本实施例中,测试任务可以测试脚本的方式存在。测试任务中可以包括至少一个测试用例,每个测试用例可以对至少一个待操作控件进行操作。测试任务的配置信息,包括至少一个待操作控件的相关信息,每个待操作控件的相关信息中包括例如:待操作控件的特征数据、第一操作、预期结果等。其中,待操作控件的特征数据用于查找定位待操作控件的位置。第一操作用于对待操作控制执行相应的触控操作,比如:点击,拖曳等。预期结果可以是执行第一操作得到的响应画面,也可以该响应画面的图像特征或文字特征。In this embodiment, the test task may exist in the form of a test script. The test task may include at least one test case, and each test case may operate at least one control to be operated. The configuration information of the test task includes relevant information of at least one control to be operated, and the relevant information of each control to be operated includes, for example, characteristic data of the control to be operated, the first operation, the expected result, and the like. The feature data of the control to be operated is used to find and locate the position of the control to be operated. The first operation is used to perform a corresponding touch operation on the control to be operated, such as clicking, dragging, and the like. The expected result may be a response picture obtained by performing the first operation, or may be an image feature or a text feature of the response picture.

示例性地,待操作控件的特征数据可以包括以下至少一种:第三图像数据,或者,第一文字。第三图像数据中包括有该待操作控制的图像。第一文字用于表征该待操作控件显示的文字信息,例如:该待操作控件上显示的文字的全部或者部分。Exemplarily, the characteristic data of the control to be operated may include at least one of the following: third image data, or, first text. The third image data includes the image to be operated and controlled. The first text is used to represent text information displayed by the control to be operated, for example: all or part of the text displayed on the control to be operated.

当待操作控件的特征数据为第三图像数据时,通过图像识别,从第一图像数据中获取与第三图像数据匹配的区域。若存在与第三图像数据匹配的区域,则确定第一图像数据中存在该待操作控件。进行图像识别时,可以配置识别阈值,当第一图像数据中存在图像区域与第三图像数据的匹配度大于该识别阈值时,则确定第一图像数据中存在该待操作控件,获取该待操作控制在第一图像数据中的图像坐标。本实施例中,还可以设置图像识别是否为灰度识别或者色彩识别。当为灰度识别时,则将第一图像数据与第三图像数据转化为灰度图后进行匹配;当为色彩识别时,在匹配时还会比较匹配区域的色彩与第三图像数据的色彩是否在误差范围内。第三图像数据可以在测试实施前,对待操作控件进行截图,并保存在相应的地址;在测试任务中配置该地址。When the characteristic data of the to-be-operated control is the third image data, an area matching the third image data is acquired from the first image data through image recognition. If there is an area matching the third image data, it is determined that the to-be-operated control exists in the first image data. When performing image recognition, a recognition threshold can be configured. When the matching degree between the image area in the first image data and the third image data is greater than the recognition threshold, it is determined that the to-be-operated control exists in the first image data, and the to-be-operated control is obtained. Controls the image coordinates in the first image data. In this embodiment, it is also possible to set whether the image recognition is grayscale recognition or color recognition. When it is grayscale recognition, the first image data and the third image data are converted into grayscale images for matching; when it is color recognition, the color of the matching area and the color of the third image data are compared during matching. is within the margin of error. Before the implementation of the test, the third image data can take a screenshot of the control to be operated, and save it in a corresponding address; configure the address in the test task.

当待操作控件的特征数据为第一文字时,通过文字识别,获取第一图像数据的文字识别结果,在该文字识别结果中查找该第一文字。若查找到该第一文字,则确定该第一图像数据中存在相应的待操作控件,获取该待操作控制在第一图像数据中的图像坐标。When the characteristic data of the control to be operated is the first character, the character recognition result of the first image data is obtained through character recognition, and the first character is searched in the character recognition result. If the first text is found, it is determined that there is a corresponding control to be operated in the first image data, and the image coordinates of the control to be operated in the first image data are acquired.

在本实施例中,还可以将待测设备的触摸屏划分为多个分区,并在测试任务中配置待操作控件的第一位置,该第一位置用于表征该待操作控件显示于哪一个分区中。该待操作控制的定位过程如下:根据第一位置,从第一图像数据中获取对应分区的图像数据作为识别区域图像;根据该待操作控件的特征数据确定该识别区域图像中是否存在该待操作控件。若存在该待操作控件,则获取该待操作控件在第一图像数据中的图像坐标。通过屏幕分区识别,可以防止控件定位误判,提高识别精度。In this embodiment, the touch screen of the device under test can also be divided into multiple partitions, and the first position of the control to be operated is configured in the test task, and the first position is used to indicate which partition the control to be operated is displayed in middle. The positioning process of the to-be-operated control is as follows: according to the first position, the image data of the corresponding partition is obtained from the first image data as the identification area image; according to the characteristic data of the to-be-operated control, it is determined whether the to-be-operated image exists in the identification area image controls. If the to-be-operated control exists, the image coordinates of the to-be-operated control in the first image data are acquired. Screen partition recognition can prevent misjudgment of control positioning and improve recognition accuracy.

在本实施例中,当第一图像数据中不存在对应的待操作控件,则记录匹配失败的信息,例如:待测设备的操作类型、匹配失败的时间等。并且,在匹配失败时,中止该待操作控件的测试,或者,暂停该待操作控件的测试,等待一段时间后重试,当重试超过一定次数时,中止该待操作控件的测试。中止该待操作控件的测试后,可以对下一待操作控件进行测试,直到测试任务中的所有待操作控件的均被执行完成。In this embodiment, when there is no corresponding control to be operated in the first image data, the information of the matching failure is recorded, such as the operation type of the device to be tested, the time of the matching failure, and the like. And, when the matching fails, the test of the to-be-operated control is suspended, or the test of the to-be-operated control is suspended, and the test of the to-be-operated control is suspended after waiting for a period of time to retry, and when the retry exceeds a certain number of times, the test of the to-be-operated control is suspended. After the test of the to-be-operated control is terminated, the next to-be-operated control may be tested until all the to-be-operated controls in the test task are executed.

步骤S300,若确定存在待操作控件,则获取待操作控件在第一图像数据中的图像坐标,并根据图像坐标获取对应的控件实际坐标。Step S300, if it is determined that there is a to-be-operated control, obtain the image coordinates of the to-be-operated control in the first image data, and obtain the corresponding actual coordinates of the control according to the image coordinates.

其中,控件实际坐标用于表征待操作控件在待测设备的触摸屏侧的位置。The actual coordinates of the control are used to represent the position of the control to be operated on the touch screen side of the device under test.

具体地,根据待测设备的类型,获取相应的校准数据;根据该校准数据,将图像坐标转换为控件实际坐标。校准数据用于表征对于待测设备的触摸屏,机械臂的执行末端的实际移动距离与图像显示移动距离的映射关系。通过将图像坐标转换为控件实际坐标,便于控制机械臂的执行末端移动至待测设备的触摸屏的待操作控件进行相应的操作。Specifically, according to the type of the device to be tested, the corresponding calibration data is obtained; according to the calibration data, the image coordinates are converted into the actual coordinates of the control. The calibration data is used to characterize the mapping relationship between the actual movement distance of the execution end of the robotic arm and the image display movement distance for the touch screen of the device under test. By converting the image coordinates into the actual coordinates of the controls, it is convenient to control the execution end of the robotic arm to move to the controls to be operated on the touch screen of the device under test to perform corresponding operations.

参照图2,校准数据的获取方法包括但不限于步骤S710至S750。Referring to FIG. 2 , the method for acquiring calibration data includes but is not limited to steps S710 to S750.

步骤S710,通过交互界面显示对待测设备的触摸屏的实时拍摄图像。Step S710, displaying a real-time captured image of the touch screen of the device under test through an interactive interface.

例如,通过摄像装置对待测设备的触摸屏进行实时拍摄,并将获取的图像显示于与摄像装置相连的终端的显示界面中。For example, the touch screen of the device under test is photographed in real time by the camera device, and the acquired image is displayed on the display interface of the terminal connected to the camera device.

步骤S720,在实时拍摄图像中,将待测设备的触摸屏区域确定为第一区域,并在第一区域中确定第一校准点和第二校准点。In step S720, in the real-time captured image, the touch screen area of the device under test is determined as the first area, and the first calibration point and the second calibration point are determined in the first area.

可以通过交互界面将待测设备的触摸屏区域确定为第一区域,也可以利用触摸屏显示时亮度与周围不同,通过软件程序来标定第一区域。第一校准点和第二校准点可以是待测设备的触摸屏上的任意两个不同的点。在本实施例中,如图3所示,B’为待测试设备的第一区域,以左上角的点(x1,y1)为第一校准点,并以右下角的点(x2,y2)为第二校准点。The touch screen area of the device to be tested can be determined as the first area through the interactive interface, or the first area can be demarcated by a software program by using the different brightness when the touch screen is displayed. The first calibration point and the second calibration point may be any two different points on the touch screen of the device under test. In this embodiment, as shown in FIG. 3 , B' is the first area of the device to be tested, the point (x1, y1) in the upper left corner is the first calibration point, and the point (x2, y2) in the lower right corner is the first calibration point. is the second calibration point.

步骤S730,控制执行末端从原点位置移动,以使执行末端在实时拍摄图像中与第一校准点对齐,得到执行末端的第一实际坐标。In step S730, the execution end is controlled to move from the origin position, so that the execution end is aligned with the first calibration point in the real-time captured image, and the first actual coordinates of the execution end are obtained.

具体地,可以通过发送移动指令给机械臂,以控制机械臂在第一区域内进行X轴向和Y轴向的移动,并存储已发送的移动指令。移动指令可以是以脉冲的形式发送给机械臂的,例如,发送1000个脉冲使机械臂沿X轴前进5mm。根据机械臂的执行末端从原点位置移动至与第一校准点对齐这一过程中所发送的移动指令,可以得出执行末端距离原点的第一移动数据。该第一移动数据包括X轴向和Y轴向的移动数据。进而,可以根据该第一移动数据得到执行末端的第一实际坐标。例如,若原点位置的坐标为(0,0),第一移动数据为(87mm,52mm),显然,第一实际坐标为(87,52)(单位:mm)。Specifically, by sending a movement command to the robot arm, the robot arm can be controlled to move in the X axis and the Y axis in the first region, and the sent movement command is stored. The movement command can be sent to the robot arm in the form of pulses, for example, sending 1000 pulses makes the robot arm advance 5mm along the X axis. According to the movement instruction sent during the process of moving the execution end of the manipulator from the origin position to being aligned with the first calibration point, the first movement data of the execution end from the origin can be obtained. The first movement data includes movement data in the X-axis and the Y-axis. Furthermore, the first actual coordinates of the execution end can be obtained according to the first movement data. For example, if the coordinates of the origin position are (0, 0) and the first movement data is (87mm, 52mm), obviously, the first actual coordinates are (87, 52) (unit: mm).

步骤S740,控制执行末端移动,以使执行末端在实时拍摄图像中与第二校准点对齐,得到执行末端的第二实际坐标。In step S740, the execution end is controlled to move, so that the execution end is aligned with the second calibration point in the real-time captured image, and the second actual coordinates of the execution end are obtained.

具体地,可以控制执行末端从原点位置移动至与第二校准点对齐,也可以控制执行末端从第一校准点移动至第二校准点。Specifically, the execution end can be controlled to move from the origin position to be aligned with the second calibration point, and the execution end can also be controlled to move from the first calibration point to the second calibration point.

步骤S750,根据第一校准点的屏幕坐标、第一校准点的屏幕坐标、第一实际坐标和第二实际坐标,获取校准数据。Step S750: Acquire calibration data according to the screen coordinates of the first calibration point, the screen coordinates of the first calibration point, the first actual coordinates and the second actual coordinates.

参照图3,机械臂的坐标单位为毫米(mm),其原点位置为Machine_0,机械臂的坐标系的X轴和Y轴分别表示为Machine_X和Machine_Y。Referring to FIG. 3 , the coordinate unit of the robotic arm is millimeters (mm), its origin position is Machine_0, and the X-axis and Y-axis of the coordinate system of the robotic arm are represented as Machine_X and Machine_Y, respectively.

在本实施例中,显示界面为PC显示界面,因此,图3中将显示界面对应的坐标原点标记为PC_0,显示界面的坐标系的X轴和Y轴分别表示为PC_X和PC_Y,坐标单位为像素(pixel),框出的第一区域(B’区域)单位也为像素(pixel)。In this embodiment, the display interface is a PC display interface. Therefore, in FIG. 3, the coordinate origin corresponding to the display interface is marked as PC_0, the X axis and the Y axis of the coordinate system of the display interface are respectively represented as PC_X and PC_Y, and the coordinate unit is Pixel (pixel), the unit of the framed first area (B' area) is also pixel (pixel).

图3中,(x1,y1)和(x2,y2)分别为第一校准点和第二校准点的屏幕坐标。机械臂的执行终端对应的第一区域(B’区域)的两个校准点的实际坐标分别为(Xadj1,Yadj1)和(Xadj2,Yadj2)。其中,(Xadj1,Yadj1)与(x1,y1)对应,(Xadj2,Yadj2)与(x2,y2)对应。In FIG. 3 , (x1, y1) and (x2, y2) are the screen coordinates of the first calibration point and the second calibration point, respectively. The actual coordinates of the two calibration points in the first area (B' area) corresponding to the execution terminal of the robotic arm are (Xadj1, Yadj1) and (Xadj2, Yadj2) respectively. Among them, (Xadj1, Yadj1) corresponds to (x1, y1), and (Xadj2, Yadj2) corresponds to (x2, y2).

通过图3,可以获得校准数据,该校准数据包括:执行末端的X轴的实际移动距离与显示移动距离的映射关系X_scale,和,执行末端的X轴的实际移动距离与显示移动距离的映射关系Y_scale。图3中,校准数据可以被理解为在X轴方向和Y轴方向,机械臂每移动一单位(毫米)对应的显示界面上多少个像素的比例关系。即有:Through FIG. 3, calibration data can be obtained, and the calibration data includes: the mapping relationship X_scale between the actual moving distance of the X-axis of the execution end and the displayed moving distance, and the mapping relationship between the actual moving distance of the X-axis of the execution end and the displayed moving distance Y_scale. In FIG. 3, the calibration data can be understood as the proportional relationship of the number of pixels on the display interface corresponding to each unit (millimeter) movement of the robotic arm in the X-axis direction and the Y-axis direction. That is:

X_scale=(x2-x1)/(Xadj2-Xadj1)X_scale=(x2-x1)/(Xadj2-Xadj1)

Y_scale=(y2-y1)/(Yadj2-Yadj1)Y_scale=(y2-y1)/(Yadj2-Yadj1)

若待操作控件对应的图像坐标点为(x,y),则可以通过以下方式计算出该待操作控件对应的控件实际坐标(Xm,Ym),计算方法如下:If the image coordinate point corresponding to the control to be operated is (x, y), the actual coordinates (Xm, Ym) of the control corresponding to the control to be operated can be calculated in the following ways. The calculation method is as follows:

Xm=Xadj1+(x-x1)/X_scaleXm=Xadj1+(x-x1)/X_scale

Ym=Yadj1+(y-y1)/Y_scaleYm=Yadj1+(y-y1)/Y_scale

由于摄像头一般架在待操作设备的上方,对于架设高度一定的摄像装置,其视野中的同一物体处于离摄像头不同的距离时,在摄像头预览中或成像中显示的大小会不一样。也就是说,待测设备的厚度会导致摄像头获取的成像大小不一,进而导致机械臂的控制出现误差。相较于平板电脑、智能手机等较薄的移动设备而言,在对考勤机等厚度较大的设备进行控件操作的测试时,因成像的差异会导致极大的误差从而使对控件的自动化测试几乎无法进行。Since the camera is generally installed above the equipment to be operated, for a camera device with a certain height, when the same object in the field of view is at different distances from the camera, the size displayed in the camera preview or in the imaging will be different. That is to say, the thickness of the device to be tested will cause the images obtained by the camera to be different in size, which will lead to errors in the control of the robotic arm. Compared with thinner mobile devices such as tablet computers and smart phones, when testing the control operation of thicker devices such as attendance machines, the difference in imaging will lead to great errors, which makes the automation of the controls possible. Testing is almost impossible.

本实施例通过对于不同类型的待测试设备,在该待测试设备的触摸屏区域选取两个校准点,进行校准,获取校准数据,依据校准数据将待操作控制的图像坐标转换为机械臂执行末端的实际坐端,能提高机械臂针对不同厚度的待操作设备的控制精度,以达到精准触控待操作设备屏幕中的控件的目的。In this embodiment, for different types of equipment to be tested, two calibration points are selected in the touch screen area of the equipment to be tested, calibration is performed, calibration data is obtained, and the coordinates of the image to be operated and controlled are converted into the coordinates of the execution end of the robotic arm according to the calibration data. The actual sitting side can improve the control accuracy of the robotic arm for the equipment to be operated with different thicknesses, so as to achieve the purpose of precisely touching the controls on the screen of the equipment to be operated.

步骤S400,控制机械臂的执行末端移动至控件实际坐标,对待测设备的触摸屏执行第一操作。Step S400, controlling the execution end of the robotic arm to move to the actual coordinates of the control, and performing the first operation on the touch screen of the device under test.

其中,第一操作由测试任务的配置确定。The first operation is determined by the configuration of the test task.

本实施例中,还会配置机械臂的相应参数,以三轴机械臂为例,包括水平面的两个轴向(即X轴和Y轴)的移动速度、与水平面垂直的Z轴方向的移动速度、触控延时、以及机械臂每次操作完成是否返回原点等。In this embodiment, the corresponding parameters of the manipulator are also configured. Taking a three-axis manipulator as an example, it includes the movement speed of the two axes of the horizontal plane (that is, the X-axis and the Y-axis), and the movement in the Z-axis direction perpendicular to the horizontal plane. Speed, touch delay, and whether the robotic arm returns to the origin after each operation is completed.

具体地,根据待测设备的厚度,调节机械臂执行末端的高度;然后,根据机械臂的水平面的轴向移动速度,机械臂的执行末端移动至控件实际坐标;等待触控延时,对待测设备的触摸屏执行第一操作。Specifically, according to the thickness of the device to be tested, the height of the execution end of the manipulator is adjusted; then, according to the axial movement speed of the horizontal plane of the manipulator, the execution end of the manipulator moves to the actual coordinates of the control; The touch screen of the device performs the first operation.

步骤S500,获取显示于待测设备的触摸屏中的第二图像数据,根据第二图像数据确定测试任务的测试结果。Step S500, acquiring second image data displayed on the touch screen of the device under test, and determining a test result of the test task according to the second image data.

其中,第二图像数据用于表征执行第一操作后待测设备的触摸屏的显示图像。The second image data is used to represent the display image of the touch screen of the device under test after the first operation is performed.

本实施例中,还可以根据测试任务的测试结果,生成相应的测试报告,该报告中例如包括:待测设备的类型、测试任务的执行起止时间(包括开始时间和结束时间)、测试用例总数量、操作控件总数量、通过/失败项数量以及每条测试用例的运行结果。In this embodiment, a corresponding test report can also be generated according to the test result of the test task, and the report includes, for example, the type of the device to be tested, the execution start and end time of the test task (including the start time and the end time), and the total number of test cases. Quantity, total number of action controls, number of pass/fail items, and the running result of each test case.

本实施例不依赖于UI界面控件属性的获取,能够通过机器视觉对触摸屏界面的控件进行精准定位,控制机械手对触摸屏类产品进行UI界面控件操作,以模拟用户实际使用场景。避免依赖于产品的操作系统的编程,降低对测试人员的技术要求,并且提高测试效率。This embodiment does not depend on the acquisition of UI interface control attributes, and can accurately locate the touch screen interface controls through machine vision, and control the manipulator to perform UI interface control operations on touch screen products, so as to simulate the actual use scenario of the user. Avoid programming dependent on the product's operating system, reduce technical requirements for testers, and improve test efficiency.

参照图4,本实施例公开了一种触控屏测试装置400,包括但不限于第一模块410、第二模块420、第三模块430、第四模块440和第五模块450。4 , the present embodiment discloses a touch screen testing device 400 , including but not limited to a first module 410 , a second module 420 , a third module 430 , a fourth module 440 and a fifth module 450 .

第一模块410,用于实时获取显示于待测设备的触摸屏中的第一图像数据。第二模块420,用于根据测试任务的配置信息,获取待操作控件的特征数据,并根据特征数据确定第一图像数据中是否存在待操作控件。第三模块430,用于若确定存在待操作控件,则获取待操作控件在第一图像数据中的图像坐标,并根据图像坐标获取对应的控件实际坐标。其中,控件实际坐标用于表征待操作控件在待测设备的触摸屏侧的位置。第四模块440,用于控制机械臂的执行末端移动至控件实际坐标,对待测设备的触摸屏执行第一操作,其中第一操作由测试任务的配置确定。第五模块450,用于获取显示于待测设备的触摸屏中的第二图像数据,根据第二图像数据确定测试任务的测试结果。其中,第二图像数据用于表征执行第一操作后待测设备的触摸屏的显示图像。The first module 410 is configured to acquire the first image data displayed on the touch screen of the device under test in real time. The second module 420 is configured to acquire characteristic data of the control to be operated according to the configuration information of the test task, and determine whether the control to be operated exists in the first image data according to the characteristic data. The third module 430 is configured to acquire the image coordinates of the to-be-operated control in the first image data if it is determined that there is a to-be-operated control, and to acquire the corresponding actual coordinates of the control according to the image coordinates. The actual coordinates of the control are used to represent the position of the control to be operated on the touch screen side of the device under test. The fourth module 440 is used to control the execution end of the robotic arm to move to the actual coordinates of the control, and perform a first operation on the touch screen of the device under test, where the first operation is determined by the configuration of the test task. The fifth module 450 is configured to acquire the second image data displayed on the touch screen of the device under test, and determine the test result of the test task according to the second image data. The second image data is used to represent the display image of the touch screen of the device under test after the first operation is performed.

图4所示的触控屏测试装置与图1所示的触控屏测试方法基于相同发明构思,因此,该情绪识别装置在上述模块的协同作用下,至少具有与图1所示的触控屏测试方法同样的有益效果。The touch screen test device shown in FIG. 4 and the touch screen test method shown in FIG. 1 are based on the same inventive concept. Therefore, under the synergistic effect of the above-mentioned modules, the emotion recognition device at least has the same touch screen as the touch screen test method shown in FIG. 1 . The same beneficial effect of the screen test method.

参照图5,本实施例提供一种触摸屏测试系统,包括:机械臂510、摄像装置520和计算机设备530。如图5所示地,机械臂510通过串口与计算机设备530连接,接收计算机设备的指令控制执行末端移动,对待测设备的触摸屏执行触控操作。摄像装置520,架设于待测设备的上方,用于对显示于待测设备的触摸屏的图像进行实时拍摄,并将获取的图像发送给计算机设备530。计算机设备530,包括至少一个处理器,和,用于存储至少一个程序的至少一个存储器,当至少一个程序被至少一个处理器执行,使得至少一个处理器实现如上所述的触摸屏测试方法。其中,处理器还可以称为CPU(Central Processing Unit,中央处理单元)。处理器可以是一种集成电路芯片,具有信号的处理能力。处理器还可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器,或者,通用处理器还可以是任何常规的处理器等。存储器可包括各种组件(例如,机器可读介质),包括但不限于随机存取存储器组件、只读组件及其任意组合。希望理解的是,为了避免赘述,本实施例未涉及的内容可参照本实施例未涉及的内容可参照上述的触控屏测试方法。Referring to FIG. 5 , this embodiment provides a touch screen testing system, including: a robotic arm 510 , a camera device 520 and a computer device 530 . As shown in FIG. 5 , the robotic arm 510 is connected to the computer device 530 through a serial port, receives an instruction from the computer device to control the movement of the execution end, and performs touch operations on the touch screen of the device under test. The camera device 520 is erected above the device under test, and is used for real-time shooting of the image displayed on the touch screen of the device under test, and sends the acquired image to the computer device 530 . The computer device 530 includes at least one processor, and at least one memory for storing at least one program, when the at least one program is executed by the at least one processor, the at least one processor implements the touch screen testing method as described above. The processor may also be referred to as a CPU (Central Processing Unit, central processing unit). The processor may be an integrated circuit chip with signal processing capability. The processor may also be a general purpose processor, digital signal processor (DSP), application specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. A general-purpose processor may be a microprocessor, or, a general-purpose processor may be any conventional processor, or the like. The memory may include various components (eg, machine-readable media) including, but not limited to, random access memory components, read-only components, and any combination thereof. It should be understood that, in order to avoid redundant description, for the content not involved in this embodiment, reference may be made to the content not involved in this embodiment, and reference may be made to the above-mentioned touch screen testing method.

本实施例提供计算机可读存储介质,该存储介质内存储有程序指令,程序指令被处理器执行时实现能够实现上述的触控屏测试方法。希望理解的是,为了避免赘述,本实施例未涉及的内容可参照上述的触控屏测试方法。This embodiment provides a computer-readable storage medium, where program instructions are stored in the storage medium, and when the program instructions are executed by the processor, the above-mentioned touch screen testing method can be implemented. It is hoped to be understood that, in order to avoid redundant description, reference may be made to the above-mentioned touch screen testing method for the content not involved in this embodiment.

本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、设备中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。Those of ordinary skill in the art can understand that all or some steps in the methods disclosed above, and functional modules/units in the device can be implemented as software, firmware, hardware, and appropriate combinations thereof.

在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质(简称存储介质)上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机可读介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical components Components execute cooperatively. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit . Such software may be distributed on computer-readable media (storage media for short), which may include computer storage media (or non-transitory media) and communication media (or transitory media). As known to those of ordinary skill in the art, the term computer-readable medium includes both volatile and non-transitory media implemented in any method or technology for storage of information, such as computer-readable instructions, data structures, program modules or other data. volatile, removable and non-removable media. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices, or may Any other medium used to store desired information and which can be accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and can include any information delivery media, as is well known to those of ordinary skill in the art .

以上参照附图说明了本发明的优选实施例,并非因此局限本发明的权利范围。本领域技术人员不脱离本发明的范围和实质内所作的任何修改、等同替换和改进,均应在本发明的权利范围之内。The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, but are not intended to limit the scope of the rights of the present invention. Any modifications, equivalent substitutions and improvements made by those skilled in the art without departing from the scope and spirit of the present invention shall fall within the right scope of the present invention.

Claims (10)

1.一种触摸屏测试方法,其特征在于,包括:1. a touch screen testing method, is characterized in that, comprises: 实时获取显示于待测设备的触摸屏中的第一图像数据;Acquire the first image data displayed on the touch screen of the device under test in real time; 根据测试任务的配置信息,获取待操作控件的特征数据,并根据所述特征数据确定所述第一图像数据中是否存在所述待操作控件;According to the configuration information of the test task, obtain characteristic data of the control to be operated, and determine whether the control to be operated exists in the first image data according to the characteristic data; 若确定存在所述待操作控件,则获取所述待操作控件在所述第一图像数据中的图像坐标,并根据所述图像坐标获取对应的控件实际坐标,所述控件实际坐标用于表征所述待操作控件在所述待测设备的触摸屏侧的位置;If it is determined that the to-be-operated control exists, the image coordinates of the to-be-operated control in the first image data are obtained, and the corresponding actual coordinates of the control are obtained according to the image coordinates, and the actual coordinates of the control are used to represent all the controls. the position of the control to be operated on the touch screen side of the device to be tested; 控制机械臂的执行末端移动至所述控件实际坐标,对所述待测设备的触摸屏执行第一操作,其中所述第一操作由所述测试任务的配置确定;Controlling the execution end of the robotic arm to move to the actual coordinates of the control, and performing a first operation on the touch screen of the device under test, wherein the first operation is determined by the configuration of the test task; 获取显示于所述待测设备的触摸屏中的第二图像数据,根据所述第二图像数据确定所述测试任务的测试结果;所述第二图像数据用于表征执行所述第一操作后所述待测设备的触摸屏的显示图像。Acquire second image data displayed on the touch screen of the device under test, and determine the test result of the test task according to the second image data; the second image data is used to represent the result of performing the first operation. The display image of the touch screen of the device under test. 2.根据权利要求1所述的触摸屏测试方法,其特征在于,所述待操作控件的特征数据包括所述待操作控件的第三图像数据;所述根据所述特征数据确定所述第一图像数据中是否存在所述待操作控件,包括:2 . The touch screen testing method according to claim 1 , wherein the characteristic data of the control to be operated comprises third image data of the control to be operated; and the first image is determined according to the characteristic data. 3 . Whether the control to be operated exists in the data, including: 通过图像识别,获取匹配结果,所述匹配结果用于表征所述第一图像数据中是否存在与所述第三图像数据匹配的区域;Obtain a matching result through image recognition, where the matching result is used to represent whether there is an area matching the third image data in the first image data; 若所述匹配结果为存在与所述第三图像数据匹配的区域,则确定所述第一图像数据中存在所述待操作控件。If the matching result is that there is an area matching the third image data, it is determined that the to-be-operated control exists in the first image data. 3.根据权利要求1或2所述的触摸屏测试方法,其特征在于,所述待操作控件的特征数据包括第一文字,所述第一文字用于表征所述待操作控件显示的文字信息;所述根据所述特征数据确定所述第一图像数据中是否存在所述待操作控件,包括:3. The touch screen testing method according to claim 1 or 2, wherein the characteristic data of the control to be operated comprises a first character, and the first character is used to represent the text information displayed by the control to be operated; the Determining whether the control to be operated exists in the first image data according to the feature data includes: 获取所述第一图像数据的文字识别结果;obtaining the character recognition result of the first image data; 若所述文字识别结果中包括所述第一文字,则确定所述第一图像数据中存在所述待操作控件。If the character recognition result includes the first character, it is determined that the control to be operated exists in the first image data. 4.根据权利要求1所述的触摸屏测试方法,其特征在于,所述测试任务的配置信息包括:所述待操作控件的第一位置,所述第一位置用于表征所述待操作控件显示于所述待测设备的触摸屏时所在的分区信息;所述根据所述特征数据确定所述第一图像数据中是否存在所述待操作控件包括:4 . The touch screen testing method according to claim 1 , wherein the configuration information of the test task comprises: a first position of the to-be-operated control, and the first position is used to represent the display of the to-be-operated control. 5 . The partition information where the touch screen of the device under test is located; the determining whether the control to be operated exists in the first image data according to the feature data includes: 根据所述第一位置,从所述第一图像数据中获取相应的识别区域图像;obtaining a corresponding recognition area image from the first image data according to the first position; 根据所述特征数据确定所述识别区域图像中是否存在所述待操作控件。Whether the control to be operated exists in the image of the recognition area is determined according to the feature data. 5.根据权利要求1所述的触摸屏测试方法,其特征在于,所述根据所述图像坐标获取对应的所述控件实际坐标包括:5. The touch screen testing method according to claim 1, wherein the obtaining the corresponding actual coordinates of the control according to the image coordinates comprises: 根据所述待测设备的类型,获取相应的校准数据;所述校准数据用于表征对于所述待测设备的触摸屏,所述执行末端的实际移动距离与图像显示移动距离的映射关系;Acquire corresponding calibration data according to the type of the device under test; the calibration data is used to represent the mapping relationship between the actual movement distance of the execution terminal and the image display movement distance for the touch screen of the device under test; 根据所述校准数据,将所述图像坐标转换为所述控件实际坐标。According to the calibration data, the image coordinates are converted into the actual coordinates of the control. 6.根据权利要求5所述的触摸屏测试方法,其特征在于,所述校准数据的获取方法包括:6. The touch screen testing method according to claim 5, wherein the method for acquiring the calibration data comprises: 通过交互界面显示对所述待测设备的触摸屏的实时拍摄图像;Display the real-time captured image of the touch screen of the device under test through the interactive interface; 在所述实时拍摄图像中,将所述待测设备的触摸屏区域确定为第一区域,并在所述第一区域中确定第一校准点和第二校准点;In the real-time captured image, the touch screen area of the device under test is determined as a first area, and a first calibration point and a second calibration point are determined in the first area; 控制所述执行末端从原点位置移动,以使所述执行末端在所述实时拍摄图像中与所述第一校准点对齐,得到所述执行末端的第一实际坐标;controlling the execution end to move from the origin position, so that the execution end is aligned with the first calibration point in the real-time captured image, to obtain the first actual coordinates of the execution end; 控制所述执行末端移动,以使所述执行末端在所述实时拍摄图像中与所述第二校准点对齐,得到所述执行末端的第二实际坐标;controlling the movement of the execution end so that the execution end is aligned with the second calibration point in the real-time captured image to obtain the second actual coordinates of the execution end; 根据所述第一校准点的屏幕坐标、所述第一校准点的屏幕坐标、所述第一实际坐标和所述第二实际坐标,获取所述校准数据。The calibration data is acquired according to the screen coordinates of the first calibration point, the screen coordinates of the first calibration point, the first actual coordinates and the second actual coordinates. 7.根据权利要求1所述的触摸屏测试方法,其特征在于,所述方法还包括配置所述机械臂的水平面的轴向移动速度和触控延时;所述控制所述机械臂的执行末端移动至所述控件实际坐标,对所述待测设备的触摸屏执行第一操作包括:7 . The touch screen testing method according to claim 1 , wherein the method further comprises configuring the axial movement speed and touch delay of the horizontal plane of the robotic arm; the control of the execution end of the robotic arm. 8 . Moving to the actual coordinates of the control, performing the first operation on the touch screen of the device under test includes: 根据所述待测设备的厚度,调节所述执行末端的高度;Adjust the height of the execution end according to the thickness of the device to be tested; 根据所述机械臂的水平面的轴向移动速度,控制所述机械臂的执行末端移动至所述控件实际坐标;Controlling the execution end of the robotic arm to move to the actual coordinates of the control according to the axial movement speed of the horizontal plane of the robotic arm; 等待所述触控延时,对所述待测设备的触摸屏执行所述第一操作。After waiting for the touch delay, perform the first operation on the touch screen of the device under test. 8.一种触摸屏测试装置,其特征在于,包括:8. A touch screen testing device, comprising: 第一模块,用于实时获取显示于待测设备的触摸屏中的第一图像数据;The first module is used to acquire the first image data displayed in the touch screen of the device under test in real time; 第二模块,用于根据测试任务的配置信息,获取待操作控件的特征数据,并根据所述特征数据确定所述第一图像数据中是否存在所述待操作控件;a second module, configured to acquire characteristic data of the control to be operated according to the configuration information of the test task, and determine whether the control to be operated exists in the first image data according to the characteristic data; 第三模块,用于若确定存在所述待操作控件,则获取所述待操作控件在所述第一图像数据中的图像坐标,并根据所述图像坐标获取对应的控件实际坐标,所述控件实际坐标用于表征所述待操作控件在所述待测设备的触摸屏侧的位置;The third module is configured to acquire the image coordinates of the to-be-operated control in the first image data if it is determined that the to-be-operated control exists, and obtain the corresponding actual coordinates of the control according to the image coordinates, and the control The actual coordinates are used to represent the position of the control to be operated on the touch screen side of the device under test; 第四模块,用于控制机械臂的执行末端移动至所述控件实际坐标,对所述待测设备的触摸屏执行第一操作,其中所述第一操作由所述测试任务的配置确定;a fourth module, configured to control the execution end of the robotic arm to move to the actual coordinates of the control, and perform a first operation on the touch screen of the device under test, wherein the first operation is determined by the configuration of the test task; 第五模块,用于获取显示于所述待测设备的触摸屏中的第二图像数据,根据所述第二图像数据确定所述测试任务的测试结果;所述第二图像数据用于表征执行所述第一操作后所述待测设备的触摸屏的显示图像。The fifth module is used for acquiring the second image data displayed on the touch screen of the device under test, and determining the test result of the test task according to the second image data; the second image data is used to represent the execution The display image of the touch screen of the device under test after the first operation. 9.一种触摸屏测试系统,其特征在于,包括:9. A touch screen test system, comprising: 机械臂,通过串口与计算机设备连接,用于接收计算机设备的指令控制执行末端移动,对待测设备的触摸屏执行触控操作;The robotic arm is connected to the computer equipment through the serial port, and is used to receive instructions from the computer equipment to control the movement of the terminal, and to perform touch operations on the touch screen of the device to be tested; 摄像装置,架设于所述待测设备的上方,用于对显示于所述待测设备的触摸屏的图像进行实时拍摄;a camera device, erected above the device to be tested, and used for real-time shooting of images displayed on the touch screen of the device to be tested; 计算机设备,包括至少一个处理器,和,用于存储至少一个程序的至少一个存储器,当所述至少一个程序被所述至少一个处理器执行,使得所述至少一个处理器实现如权利要求1至7中任一项所述的触摸屏测试方法。Computer device, comprising at least one processor, and, at least one memory for storing at least one program that, when executed by the at least one processor, causes the at least one processor to implement the at least one processor as claimed in claims 1 to The touch screen test method described in any one of 7. 10.一种计算机可读存储介质,所述存储介质内存储有程序指令,所述程序指令被处理器执行时实现如权利要求1至7中任意一项所述的触摸屏测试方法。10 . A computer-readable storage medium, wherein program instructions are stored in the storage medium, and when the program instructions are executed by a processor, the touch screen testing method according to any one of claims 1 to 7 is implemented.
CN202210099863.3A 2022-01-27 2022-01-27 Touch screen testing method, device and system and storage medium Pending CN114546740A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210099863.3A CN114546740A (en) 2022-01-27 2022-01-27 Touch screen testing method, device and system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210099863.3A CN114546740A (en) 2022-01-27 2022-01-27 Touch screen testing method, device and system and storage medium

Publications (1)

Publication Number Publication Date
CN114546740A true CN114546740A (en) 2022-05-27

Family

ID=81674251

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210099863.3A Pending CN114546740A (en) 2022-01-27 2022-01-27 Touch screen testing method, device and system and storage medium

Country Status (1)

Country Link
CN (1) CN114546740A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116955207A (en) * 2023-09-18 2023-10-27 中国兵器装备集团兵器装备研究所 Identify test cases to complete automated testing methods, systems and media for software and hardware
CN118981272A (en) * 2024-10-14 2024-11-19 共达地创新技术(深圳)有限公司 Touch device control method, device, computer equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103235661A (en) * 2013-04-13 2013-08-07 北京汇冠新技术股份有限公司 Positioning clicking device and method and touch display screen calibration system and method
CN103472953A (en) * 2013-09-25 2013-12-25 成都吉锐触摸技术股份有限公司 Calibration method of touch display screen
CN104252410A (en) * 2013-06-27 2014-12-31 阿里巴巴集团控股有限公司 Method and equipment for testing control in page
CN109815947A (en) * 2018-12-14 2019-05-28 深圳壹账通智能科技有限公司 Applied test methods, apparatus and computer equipment
CN110908922A (en) * 2019-12-31 2020-03-24 京东数字科技控股有限公司 Application program testing method and device
CN111015695A (en) * 2019-12-10 2020-04-17 深圳市优必选科技股份有限公司 Mechanical arm zero setting method and device and desktop-level mechanical arm
CN111858356A (en) * 2020-07-23 2020-10-30 北京首汽智行科技有限公司 UI automatic testing method based on image recognition technology
CN112916515A (en) * 2021-03-15 2021-06-08 西安唐人电子科技有限公司 Mechanical arm posture self-adaptive adjusting method for laser paint removal
CN113341258A (en) * 2021-06-18 2021-09-03 科大讯飞股份有限公司 Screen test fixture, method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103235661A (en) * 2013-04-13 2013-08-07 北京汇冠新技术股份有限公司 Positioning clicking device and method and touch display screen calibration system and method
CN104252410A (en) * 2013-06-27 2014-12-31 阿里巴巴集团控股有限公司 Method and equipment for testing control in page
CN103472953A (en) * 2013-09-25 2013-12-25 成都吉锐触摸技术股份有限公司 Calibration method of touch display screen
CN109815947A (en) * 2018-12-14 2019-05-28 深圳壹账通智能科技有限公司 Applied test methods, apparatus and computer equipment
CN111015695A (en) * 2019-12-10 2020-04-17 深圳市优必选科技股份有限公司 Mechanical arm zero setting method and device and desktop-level mechanical arm
CN110908922A (en) * 2019-12-31 2020-03-24 京东数字科技控股有限公司 Application program testing method and device
CN111858356A (en) * 2020-07-23 2020-10-30 北京首汽智行科技有限公司 UI automatic testing method based on image recognition technology
CN112916515A (en) * 2021-03-15 2021-06-08 西安唐人电子科技有限公司 Mechanical arm posture self-adaptive adjusting method for laser paint removal
CN113341258A (en) * 2021-06-18 2021-09-03 科大讯飞股份有限公司 Screen test fixture, method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘淼: "《嵌入式系统接口设计与Linux驱动程序开发》", 31 May 2006, 《北京航空航天大学出版社》, pages: 101 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116955207A (en) * 2023-09-18 2023-10-27 中国兵器装备集团兵器装备研究所 Identify test cases to complete automated testing methods, systems and media for software and hardware
CN118981272A (en) * 2024-10-14 2024-11-19 共达地创新技术(深圳)有限公司 Touch device control method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
JP6960980B2 (en) Image-based tray alignment and tube slot positioning in visual systems
US9756261B2 (en) Method for synthesizing images and electronic device thereof
CN102902625B (en) Software performance test system and method
CN104346834A (en) Information processing devic and position designation method
CN109561257B (en) Picture focusing method, device, terminal and corresponding storage medium
CN114546740A (en) Touch screen testing method, device and system and storage medium
CN103377119A (en) Automatic nonstandard control testing method and device
CN113172636B (en) Automatic hand-eye calibration method and device and storage medium
JP2015005181A (en) Information processor, determination method and determination program
CN109785444A (en) Recognition methods, device and the mobile terminal of real plane in image
CN105335288B (en) The localization method and device of Mobile solution page object
CN115469160A (en) Screen test method, system and device and electronic equipment
CN111240622B (en) Drawing method and device
CN110779460B (en) Offline guidance device, measurement control device, and storage medium
US11070716B2 (en) Image sensor system, image sensor, data generation method of image sensor in image sensor system, and non-transitory computer-readable recording medium
CN115922732B (en) FPC automatic assembly control method, device and system, and electronic equipment
US20210042204A1 (en) Testing apparatus, testing system, and non-transitory tangible machine-readable medium thereof for testing touch mobile devices
CN111611162A (en) A test method, device, electronic device and storage medium
US12154289B2 (en) Context aware measurement
CN115097976A (en) Method, apparatus, device and storage medium for image processing
CN112965651A (en) Optimization method for demonstrating video source output
CN114543669B (en) Mechanical arm calibration method, device, equipment and storage medium
US20160209989A1 (en) Record and replay of operations on graphical objects
CN110691239A (en) HDR display module detection method and device and electronic equipment
CN110018773B (en) Number writing method, system, device and readable storage 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