+

CN106961362B - Automated testing method and mobile cloud test system - Google Patents

Automated testing method and mobile cloud test system Download PDF

Info

Publication number
CN106961362B
CN106961362B CN201710138835.7A CN201710138835A CN106961362B CN 106961362 B CN106961362 B CN 106961362B CN 201710138835 A CN201710138835 A CN 201710138835A CN 106961362 B CN106961362 B CN 106961362B
Authority
CN
China
Prior art keywords
unit
container
mobile device
elements
page
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
CN201710138835.7A
Other languages
Chinese (zh)
Other versions
CN106961362A (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.)
Hangzhou Fanwen Technology Co., Ltd
Original Assignee
Hangzhou Copper Street Internet Financial Information Service 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 Hangzhou Copper Street Internet Financial Information Service Co Ltd filed Critical Hangzhou Copper Street Internet Financial Information Service Co Ltd
Priority to CN201710138835.7A priority Critical patent/CN106961362B/en
Publication of CN106961362A publication Critical patent/CN106961362A/en
Application granted granted Critical
Publication of CN106961362B publication Critical patent/CN106961362B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • 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/3698Environments for analysis, debugging or testing of software
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/06Generation of reports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/14Arrangements for monitoring or testing data switching networks using software, i.e. software packages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本发明提供了一种自动化测试方法和移动云测试系统,其中,自动化测试方法包括以下步骤:在在线移动设备列表的移动设备上安装并启动待测试应用软件;获取应用软件首页的所有元素存储在容器中,并将该容器置为当前容器,创建根节点;在当前容器中,选择符合元素规则的有效元素生成自动化执行指令;获取移动设备执行指令后的当前页面的所有元素,将页面元素与当前容器内元素和已有容器内元素进行比对,确定是否为相似页面;若为不相似页面时,则创建新的容器并新增子节点;再选取当前容器中下一有效元素继续执行相似判断,直到用例树模块中的所有有效元素都执行完成,分析后生成测试报告。本发明可远程控制在线共享移动设备进行自动化测试。

The present invention provides an automated testing method and a mobile cloud testing system, wherein the automated testing method includes the following steps: installing and starting an application software to be tested on a mobile device in the online mobile device list; acquiring all elements of the home page of the application software and storing them in container, and set the container as the current container to create a root node; in the current container, select effective elements that meet the element rules to generate automatic execution instructions; obtain all elements of the current page after the mobile device executes the instruction, and combine the page elements with Compare the elements in the current container with the elements in the existing container to determine whether it is a similar page; if it is a dissimilar page, create a new container and add a new child node; then select the next valid element in the current container to continue the similar Judgment until all effective elements in the use case tree module are executed, and generate a test report after analysis. The invention can remotely control the online shared mobile device for automatic testing.

Description

自动化测试方法及移动云测试系统Automated testing method and mobile cloud testing system

技术领域technical field

本发明涉及信息技术领域,特别涉及一种自动化测试方法及移动云测试系统。The invention relates to the field of information technology, in particular to an automated testing method and a mobile cloud testing system.

背景技术Background technique

云测试基于云计算的一种新型测试方案。服务商提供多种平台,多种浏览器的平台,一般的用户在本地把自动化测试脚本编写好,然后上传到他们网站,然后就可以在他们的平台上运行自动化脚本。用云测试方式,极大地减少了测试环境搭建时间,如机器和网络准备、操作系统安装、各种测试工具软件安装等都将节省,只需提前将需要的配置环境告之云测试服务商,到时间直接使用即可。由于是基于网络上的应用,当测试中遇到软件使用上等问题时,亦可获得云测试服务商远程快速支持,而很少会出现停滞甚至停止测试现象。Cloud testing is a new testing solution based on cloud computing. Service providers provide multiple platforms and platforms for multiple browsers. General users write automated test scripts locally, upload them to their websites, and then run automated scripts on their platforms. Using the cloud test method greatly reduces the time for setting up the test environment, such as machine and network preparation, operating system installation, and various test tool software installations, etc. will be saved. You only need to inform the cloud test service provider of the required configuration environment in advance. It can be used directly when the time comes. Because it is an application based on the network, when you encounter problems such as software use during the test, you can also obtain remote and fast support from the cloud test service provider, and rarely stagnate or even stop the test.

现有云测试平台主要是通过提供真机测试服务来实现自动化测试等功能,需要提供平台的服务商自主购买大量移动设备(真机),连接到专用设备上,用以提供测试服务。并且,现有云测试平台提供的适配测试或者深度遍历测试,仅体现为页面的monkey测试上,而功能自动化测试,则需要用户按照相关开发语言规范,录制或编写对应的自动化执行脚本,通过回放来实现功能自动化测试。因此,现有云测试平台存在以下问题:移动设备更新换代快,大量的真机采购,费用较高;移动设备的运行维护成本高;移动设备的系统升级频繁,无法做到同一机型的不同系统版本的真机都具备;移动设备需要连接到专用设备机柜中,集中管理;monkey测试相对较浅显,随机性太大,无法达到预期深度遍历的目的;功能自动化测试,首先需要会编写特定脚本及调试,调试成功后,才能回放,且调试和维护自动化脚本的投入成本较高。Existing cloud testing platforms mainly realize functions such as automated testing by providing real-device testing services. Service providers who provide the platform need to independently purchase a large number of mobile devices (real devices) and connect them to dedicated devices to provide testing services. Moreover, the adaptation test or in-depth traversal test provided by the existing cloud test platform is only reflected in the monkey test of the page, while the functional automation test requires the user to record or write the corresponding automated execution script according to the relevant development language specifications. Playback to realize functional automation testing. Therefore, the existing cloud test platform has the following problems: mobile devices are updated quickly, a large number of real devices are purchased, and the cost is high; the operation and maintenance costs of mobile devices are high; the system upgrades of mobile devices are frequent, and different models of the same model cannot be achieved. All system versions are available on real machines; mobile devices need to be connected to special equipment cabinets for centralized management; monkey tests are relatively simple and too random, and cannot achieve the desired purpose of in-depth traversal; functional automation tests first need to be able to write specific scripts And debugging, after the debugging is successful, it can be played back, and the investment cost of debugging and maintaining the automation script is relatively high.

发明内容Contents of the invention

本发明的目的是提供一种自动化测试方法及移动云测试系统,解决上述的问题。The purpose of the present invention is to provide an automated testing method and a mobile cloud testing system to solve the above problems.

为解决上述问题,本发明实施例提供一种自动化测试方法,包括以下步骤:In order to solve the above problems, an embodiment of the present invention provides an automated testing method, including the following steps:

获取已授权的在线移动设备列表、待测试应用软件及待测试应用软件的自动化测试关键字表单;Obtain the list of authorized online mobile devices, the application software to be tested and the automated test keyword list of the application software to be tested;

在选中的若干在线移动设备列表中的移动设备上安装并启动该应用软件后,获取应用软件首页的所有元素存储在容器中,并将该容器置为当前容器,创建根节点;After installing and starting the application software on the mobile devices in the selected online mobile device list, obtain all elements of the home page of the application software and store them in the container, and set the container as the current container to create a root node;

在当前容器中,选择符合元素规则的一个有效元素或一组有效元素,生成自动化执行指令;In the current container, select a valid element or a group of valid elements that meet the element rules, and generate automatic execution instructions;

获取移动设备执行自动化执行指令后的当前页面的所有元素,将页面元素与当前容器内元素和已有容器内元素进行比对,确定是否为相似页面;Get all the elements of the current page after the mobile device executes the automated execution command, compare the page elements with the elements in the current container and the elements in the existing container, and determine whether they are similar pages;

若为不相似页面时,创建新的容器存储该页面的所有元素,并置为新的当前容器,新增子节点;If it is a dissimilar page, create a new container to store all the elements of the page, set it as the new current container, and add a new child node;

再选取当前容器中下一有效元素,生成自动化执行指令,继续执行相似判断,直至当前容器中的有效元素均已执行;Then select the next valid element in the current container, generate an automatic execution command, and continue to execute similar judgments until all valid elements in the current container have been executed;

选取上一级容器以上述方式执行相似判断,直至所有容器中的有效元素都执行完成;Select the upper-level container to perform similar judgments in the above-mentioned manner until all valid elements in all containers are executed;

根据所有执行节点轨迹及执行结果进行分析,生成测试报告。Analyze and generate test reports based on all execution node trajectories and execution results.

作为一种实施方式,所述获取已授权的在线移动设备列表,包括以下步骤:As an implementation manner, the obtaining the authorized online mobile device list includes the following steps:

当检测到移动设备连接或已连接的移动设备状态发生变更时,获取连接信息;Obtain connection information when a mobile device connection is detected or the status of a connected mobile device changes;

整合所有的移动设备的连接信息,根据用户权限将该用户可用的在线移动设备筛选出来生成当前用户可用的在线移动设备列表。Integrate the connection information of all mobile devices, filter out the online mobile devices available to the user according to user permissions, and generate a list of online mobile devices available to the current user.

作为一种实施方式,所述在当前容器中,选择符合元素规则的一个有效元素或一组有效元素,生成自动化执行指令,包括以下步骤:As an implementation manner, in the current container, selecting an effective element or a group of effective elements conforming to element rules, and generating an automatic execution instruction includes the following steps:

在当前容器中,选择一个元素或一组元素,将选择的元素与元素规则进行匹配;In the current container, select an element or a group of elements, and match the selected element with the element rule;

若匹配成功,则生成自动化执行指令;If the matching is successful, an automated execution instruction is generated;

若匹配不成功,则按容器中元素顺序,选择第一个元素生成自动化执行指令。If the matching is unsuccessful, the first element is selected according to the order of the elements in the container to generate an automatic execution instruction.

作为一种实施方式,所述获取移动设备执行自动化执行指令后的当前页面的所有元素,与当前容器内元素和已有容器进行比对,确定是否为相似页面,包括以下步骤:As an implementation, the acquisition of all the elements of the current page after the mobile device executes the automatic execution instruction is compared with the elements in the current container and the existing container to determine whether it is a similar page, including the following steps:

当移动设备执行自动化执行指令后,将当前容器中生成所述自动化执行指令的元素标记为已执行;After the mobile device executes the automatic execution instruction, mark the element generating the automatic execution instruction in the current container as executed;

再次获取待测试应用软件的当前页面的所有元素,将获取的页面元素与当前容器的元素进行比对,判断是否为相同或相似页面;Obtain all the elements of the current page of the application software to be tested again, compare the acquired page elements with the elements of the current container, and determine whether they are the same or similar pages;

若与当前容器不相同或不相似,再判断是否与过往已存储的容器为相同或相似页面,若与过往容器仍不相同,则新建容器存储该当前页面元素,并将新建容器设置为当前容器;若与过往容器相同或相似,将该过往容器设置为当前容器,并在上一节点下新增子节点,将新增子节点关联当前容器;If it is not the same or similar to the current container, then judge whether it is the same or similar page with the container that has been stored in the past. If it is still different from the previous container, create a new container to store the current page element, and set the new container as the current container ; If it is the same as or similar to the previous container, set the previous container as the current container, and add a new child node under the previous node, and associate the new child node with the current container;

若与当前容器相同或相似,则更新当前容器中的该元素为无效元素。If it is the same or similar to the current container, update the element in the current container as an invalid element.

作为一种实施方式,所述再选取当前容器中下一有效元素,生成自动化执行指令,继续执行相似判断,直至当前容器中的有效元素均已执行;选取上一级容器以上述方式执行相似判断,直至所有容器中的有效元素都执行完成,还包括以下步骤:As an implementation, the next effective element in the current container is selected, an automatic execution instruction is generated, and the similarity judgment is continued until all effective elements in the current container have been executed; the upper-level container is selected to perform the similarity judgment in the above-mentioned manner , until all valid elements in the container are executed, the following steps are also included:

每执行完一次自动化执行指令,确认当前容器后,继续在当前容器中选择一个未执行过的元素,重复之前的步骤;Each time the automatic execution command is executed, after confirming the current container, continue to select an unexecuted element in the current container, and repeat the previous steps;

直到当前容器中的元素都已执行,返回到上一页面,定位该页面的容器,继续重复之前的步骤,直到所有容器中的元素都已执行。Until all the elements in the current container have been executed, return to the previous page, locate the container of this page, and continue to repeat the previous steps until all the elements in the container have been executed.

作为一种实施方式,所述根据所有执行节点轨迹及执行结果进行分析,生成测试报告,包括以下步骤:As an implementation, the analysis according to all execution node trajectories and execution results to generate a test report includes the following steps:

按所有执行节点轨迹分析整理出节点间关系、对应页面、所执行的页面元素及测试日志生成测试报告;Analyze and sort out the relationship between nodes, corresponding pages, executed page elements and test logs according to the trajectory analysis of all execution nodes to generate test reports;

同时,输出自动化执行脚本。At the same time, the output automation execution script.

本发明实施例还提供一种移动云测试系统,包括管理平台、联网设备库和智能自动化测试平台,所述管理平台用于管理测试任务、待测应用软件及整合若干移动设备的连接信息,管理平台包括联网设备整合单元,联网设备库包括设备监控单元、设备通信单元和自动化执行单元,所述智能自动化测试平台包括自动化设置单元、自动化测试处理单元和CAT发送接收单元;The embodiment of the present invention also provides a mobile cloud test system, including a management platform, a networked device library, and an intelligent automated test platform. The management platform is used to manage test tasks, application software to be tested, and integrate connection information of several mobile devices. The platform includes a networked device integration unit, the networked device library includes a device monitoring unit, a device communication unit, and an automated execution unit, and the intelligent automated test platform includes an automated setting unit, an automated test processing unit, and a CAT sending and receiving unit;

其中,所述设备监控单元,用于实时检测连接至联网设备库的移动设备,并将若干已连接的移动设备的连接信息上传至联网设备整合单元;Wherein, the device monitoring unit is used to detect mobile devices connected to the networked device library in real time, and upload connection information of several connected mobile devices to the networked device integration unit;

所述联网设备整合单元,用于接收所有所述设备监控单元发送的连接信息,将若干连接信息整合生成在线移动设备列表发送至自动化执行单元;The networked device integration unit is used to receive all the connection information sent by the device monitoring unit, integrate several connection information to generate an online mobile device list and send it to the automatic execution unit;

所述自动化设置单元,用于设置待测试应用软件的相关关键字表单和提供元素规则库;The automatic setting unit is used to set the relevant keyword form of the application software to be tested and provide an element rule library;

所述自动化测试处理单元,用于响应所述自动化设置单元的关键字表单,根据元素规则库的规则生成启动应用指令和自动化执行指令,并接收所述CAT发送接收单元发送的移动设备测试指令执行后的信息,根据执行后的信息分析生成测试报告;The automated test processing unit is configured to respond to the keyword form of the automated setting unit, generate an application startup instruction and an automated execution instruction according to the rules of the element rule base, and receive the execution of the mobile device test instruction sent by the CAT sending and receiving unit Generate the test report according to the post-execution information analysis;

所述设备通信单元,用于接收启动应用指令和自动化执行指令交给自动化执行单元,并将自动化执行单元返回的信息发送给CAT发送接收单元;The device communication unit is used to receive the startup application instruction and the automatic execution instruction to the automatic execution unit, and send the information returned by the automatic execution unit to the CAT sending and receiving unit;

所述自动化执行单元,用于控制移动设备执行指令对应的操作,当接收到启动应用指令时,控制在线移动设备列表中的移动设备安装并启动待测试的应用软件,当接收到自动化执行指令时,驱动移动设备执行指令,并获取移动设备执行后的相关结果信息。The automatic execution unit is used to control the mobile device to execute the operation corresponding to the instruction. When receiving the start application instruction, control the mobile device in the online mobile device list to install and start the application software to be tested. When the automatic execution instruction is received , to drive the mobile device to execute the instruction, and obtain relevant result information after the execution of the mobile device.

作为一种实施方式,所述自动化测试处理单元包括页面元素采集器、相似度匹配模块、用例树模块、元素容器模块和检测判断模块;As an implementation, the automated test processing unit includes a page element collector, a similarity matching module, a use case tree module, an element container module, and a detection and judgment module;

其中,所述页面元素采集器,用于获取待测试应用软件启动后的首页的所有元素和获取待测试应用软件执行自动化测试指令后的页面的所有元素;Wherein, the page element collector is used to obtain all elements of the home page after the application software to be tested is started and obtain all elements of the page after the application software to be tested executes the automated test instruction;

所述相似度匹配模块,用于接收所述页面元素采集器获取的首页元素和页面元素,当接收到首页元素时,将首页元素与关键字表单比对判断启动的应用软件与自动化设置单元的关键字表单匹配,当接收到页面元素时,将获取的页面元素与当前容器的元素进行比对判断是否为相同或相似页面,此外,在页面元素与当前容器的元素匹配后将页面元素与过往容器进行匹配;The similarity matching module is used to receive the home page elements and page elements obtained by the page element collector, and when receiving the home page elements, compare the home page elements with the keyword form to determine the starting application software and the automatic setting unit Keyword form matching, when receiving a page element, compare the obtained page element with the element of the current container to determine whether it is the same or similar page, in addition, after the page element matches the element of the current container, compare the page element with the previous container to match;

所述用例树模块,用于根据所述相似度匹配模块的匹配结果记录自动化测试执行轨迹,当首页元素与关键字表单匹配成功后,创建本次执行用例树根节点,当页面元素与当前容器及过往容器的元素匹配后,新增子节点;The use case tree module is used to record the execution track of the automated test according to the matching result of the similarity matching module. When the home page element matches the keyword form successfully, create the root node of the use case tree for this execution. When the page element matches the current container After matching with the elements of the previous container, a new child node is added;

所述元素容器模块,用于建立容器存储页面元素、元素执行状态,并标记元素和节点关联;The element container module is used to establish a container to store page elements, element execution status, and mark the association between elements and nodes;

所述检测判断模块,用于检测所述元素容器模块关联后当前容器是否还有未标记节点的元素和在所有元素标记节点后判断当前容器是否为标记根节点的容器;The detection and judgment module is used to detect whether the current container has elements of unmarked nodes after the association of the element container module and judge whether the current container is a container of the root node after all elements mark the nodes;

所述自动化测试处理单元,还用于根据应用当前容器中元素状态、元素规则及所述检测判断模块的判断结果,生成下一步自动化测试执行指令。The automated test processing unit is further configured to generate a next-step automated test execution instruction according to the state of elements in the current container of the application, the element rules, and the judgment result of the detection and judgment module.

作为一种实施方式,还包括前端入口和存储平台,所述前端入口包括用户单元、应用软件上传单元,所述管理平台包括用户管理单元、应用软件权限单元;As an embodiment, it also includes a front-end entrance and a storage platform, the front-end entrance includes a user unit, an application software upload unit, and the management platform includes a user management unit and an application software authority unit;

其中,所述用户单元,用于有应用软件测试需求的用户登入;Wherein, the user unit is used for user login with application software testing requirements;

所述用户管理单元,用于所述用户单元登入的用户权限设置;The user management unit is used for setting the user authority of the user unit login;

所述应用软件上传单元,用于通过用户权限设置后的用户将待测试的应用软件上传;The application software uploading unit is used for uploading the application software to be tested by the user after setting the user authority;

所述应用软件权限单元,用于所述应用软件上传单元上传的应用软件权限的和状态设置,及应用软件的信息显示;The application software authority unit is used for setting the application software authority and status uploaded by the application software upload unit, and displaying the information of the application software;

所述存储平台,用于对所述应用软件上传单元上传的应用软件进行有序化存储,并将应用软件存储地址反馈至应用软件权限单元。The storage platform is used for orderly storing the application software uploaded by the application software uploading unit, and feeding back the storage address of the application software to the application software authority unit.

作为一种实施方式,所述前端入口还包括移动设备列表单元、发布测试任务单元、云众测线下流程单元、报告中心单元,所述管理平台还包括设备中心单元、联网设备库的服务端和任务中心单元,联网设备库还包括授权服务单元、设备信息存储单元,所述智能自动化测试平台还包括报告工厂单元;As an implementation, the front-end entrance also includes a mobile device list unit, a release test task unit, a cloud public test offline process unit, and a report center unit, and the management platform also includes a device center unit and a server end of a networked device library And the task center unit, the networked device library also includes an authorized service unit, a device information storage unit, and the intelligent automated test platform also includes a report factory unit;

其中,所述授权服务单元,用于对连接的移动设备进行授权/连接服务,生成验证成功信号;Wherein, the authorization service unit is configured to perform authorization/connection service on the connected mobile device and generate a verification success signal;

所述设备监控单元,用于响应所述授权服务单元生成的验证成功信号监控所有连接的移动设备的状态情况;The device monitoring unit is used to monitor the status of all connected mobile devices in response to the verification success signal generated by the authorization service unit;

所述设备信息存储单元,用于响应所述授权服务单元生成的验证成功信号将移动设备的设备信息存储在所述联网设备库的Cache/DB上,并由所述设备监控单元实时更新给所述联网设备整合单元进行实时整合生成在线移动设备列表,所述联网设备整合单元将在线移动设备列表发送至设备中心单元;The device information storage unit is used to store the device information of the mobile device on the Cache/DB of the networked device library in response to the verification success signal generated by the authorization service unit, and update the device information to all the devices in real time by the device monitoring unit. The networked device integration unit performs real-time integration to generate an online mobile device list, and the networked device integration unit sends the online mobile device list to the device central unit;

所述设备中心单元,用于接收所述联网设备整合单元的在线移动设备列表按权限筛选供当前用户使用的在线移动设备列表并在所述移动设备列表单元中显示;The device center unit is used to receive the online mobile device list of the networked device integration unit and filter the online mobile device list for the current user according to the authority and display it in the mobile device list unit;

所述发布测试任务单元,用于对所述设备中心单元展示的移动设备列表中的移动设备选择待检测应用软件的测试类型和测试任务;The release test task unit is used to select the test type and test task of the application software to be tested for the mobile devices in the mobile device list displayed by the device center unit;

所述任务中心单元,用于根据测试任务的信息,按测试任务分类发送众测任务至所述云众测线下流程单元或发送自动化测试任务至所述自动化设置单元;The task center unit is used to send the public test tasks to the cloud public test offline process unit according to the test task classification according to the test task information or send the automated test tasks to the automated setting unit;

所述云众测线下流程单元,用于将所述众测任务推送给系统内的其它用户及对外展示,众测任务执行后将若干用户提交的测试反馈生成众测报告;The cloud public test offline process unit is used to push the public test task to other users in the system and display it externally. After the public test task is executed, the test feedback submitted by several users is used to generate a public test report;

所述报告工厂单元,用于接收所述自动化测试处理单元的测试报告,将若干移动设备的测试报告汇总后发送至报告中心单元;The report factory unit is used to receive the test report of the automated test processing unit, and send the test reports of several mobile devices to the report center unit after summarizing;

所述报告中心单元,用于接收所述云众测线下流程单元的众测报告和所述报告工厂的测试报告。The report center unit is used to receive the public test report of the cloud public test offline process unit and the test report of the reporting factory.

本发明相比于现有技术的有益效果在于:解决了移动设备远程控制等相关技术,用户手机不需要安装任何应用,只需要开启USB数据连接,连接安装有联网设备库的客户端电脑或私有服务器后,即可对手机进行远程控制,实现真机云测试。企业私有云服务,通过系统权限及联网设备库的网络接入控制,可以对企业设备进行私有化保护。任何个人的或企业的测试设备,授权后,即可显示在联网设备库中,用户即可以共享该设备获取相应回报,也可以租用其他联网可用设备进行测试,有效实现联网设备库的设备资源整合,节省成本,支持企业或个人解决移动设备紧缺、测试流程管理、智能自动化测试,极大地减少了测试系统化搭建时间。本发明的自动化测试方法可在线编辑关键字表单,通过匹配关键字规则,实现智能深度遍历测试,突破了传统先录制调试再回放的自动化测试模式,而是根据智能规则遍历功能,生成用例树结构及执行结果。用户可以根据用例树结构进行二次修改,整理出有效功能自动化用例,也可修改智能规则,提高下次遍历的有效性。Compared with the prior art, the present invention has the beneficial effects that: it solves related technologies such as remote control of mobile devices, and the user's mobile phone does not need to install any application, but only needs to open the USB data connection, and connect to the client computer or private computer installed with the networked device library. After the server, the mobile phone can be remotely controlled to realize the real machine cloud test. Enterprise private cloud service, through system authority and network access control of networked equipment library, can protect enterprise equipment privately. Any personal or enterprise test equipment can be displayed in the networked equipment library after authorization, and users can share the equipment to obtain corresponding rewards, or rent other networked available equipment for testing, effectively realizing the integration of equipment resources in the networked equipment library , save costs, support enterprises or individuals to solve the shortage of mobile devices, test process management, intelligent automated testing, greatly reducing the time for building a test system. The automatic test method of the present invention can edit the keyword form online, realize the intelligent depth traversal test by matching the keyword rules, break through the traditional automatic test mode of first recording and debugging and then playback, and generate a use case tree structure according to the intelligent rule traversal function and execution results. Users can make secondary modifications according to the use case tree structure to sort out effective functional automation use cases, and can also modify smart rules to improve the effectiveness of the next traversal.

附图说明Description of drawings

图1为本发明的自动化测试方法的流程图;Fig. 1 is the flowchart of automated testing method of the present invention;

图2为本发明的移动云测试系统的结构图;Fig. 2 is the structural diagram of mobile cloud testing system of the present invention;

图3为本发明的智能自动化测试平台的结构框图。Fig. 3 is a structural block diagram of the intelligent automated test platform of the present invention.

附图标注:1、前端入口;11、用户单元;12、应用软件上传单元;13、移动设备列表单元;14、发布测试任务单元;15、云众测线下流程单元;16、报告中心单元;2、管理平台;21、用户管理单元;22、应用软件权限单元;23、设备中心单元;24、联网设备整合单元;25、任务中心单元;3、存储平台;4、联网设备库;41、授权服务单元;42、设备监控单元;43、设备通信单元;44、自动化执行单元;5、智能自动化测试平台;51、CAT发送接收单元;52、自动化测试处理单元;521、应用安装启动模块;522、自动化操作模块;523、页面元素采集器;524、相似度匹配模块;525、用例树模块;526、元素容器模块;527、检测判断模块;53、自动化设置单元;54、报告工厂单元。Drawings: 1. Front-end entrance; 11. User unit; 12. Application software upload unit; 13. Mobile device list unit; 14. Publish test task unit; 15. Cloud test offline process unit; 16. Report center unit 2. Management platform; 21. User management unit; 22. Application software authority unit; 23. Device center unit; 24. Networked device integration unit; 25. Task center unit; 3. Storage platform; 4. Networked device library; 41 . Authorization service unit; 42. Equipment monitoring unit; 43. Equipment communication unit; 44. Automation execution unit; 5. Intelligent automation test platform; 51. CAT sending and receiving unit; 52. Automation test processing unit; ;522, automatic operation module; 523, page element collector; 524, similarity matching module; 525, use case tree module; 526, element container module; 527, detection and judgment module; 53, automatic setting unit; 54, report factory unit .

具体实施方式Detailed ways

以下结合附图,对本发明上述的和另外的技术特征和优点进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明的部分实施例,而不是全部实施例。The above and other technical features and advantages of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Apparently, the described embodiments are only some of the embodiments of the present invention, not all of them.

如图1所示,一种自动化测试方法,具体包括以下步骤:As shown in Figure 1, an automated testing method specifically includes the following steps:

S101:获取已授权的在线移动设备列表、待测试应用软件及待测试应用软件的自动化测试关键字表单,关键字表单包括待测试应用软件首页的关键字元素和首页上的一级菜单的关键字元素,其中,在本实施中,应用软件的首页是指启动应用软件后,去除引导页及广告等非功能性页面后,进入主体功能的第一个页面,该步骤用以确定应用软件的测试起点;S101: Obtain the authorized online mobile device list, the application software to be tested and the automated test keyword form of the application software to be tested, the keyword form includes the keyword elements of the homepage of the application software to be tested and the keywords of the first-level menu on the homepage element, where, in this implementation, the home page of the application software refers to the first page that enters the main function after the application software is started and non-functional pages such as guide pages and advertisements are removed. This step is used to determine the application software test starting point;

步骤101中,获取已授权的在线移动设备列表包括以下步骤:In step 101, obtaining the list of authorized online mobile devices includes the following steps:

S201:当检测到移动设备连接或已连接的移动设备状态发生变更时,获取连接信息;S201: Obtain connection information when it is detected that the mobile device is connected or the state of the connected mobile device changes;

S202:整合所有的移动设备的连接信息,根据用户权限将该用户可用的在线移动设备筛选出来生成当前用户可用的在线移动设备列表。S202: Integrate the connection information of all mobile devices, and filter out the online mobile devices available to the user according to user permissions to generate a list of online mobile devices available to the current user.

S102:在选中的若干在线移动设备列表中的移动设备上安装该应用软件并启动;S102: Install and start the application software on the mobile devices in the selected online mobile device list;

S103:应用软件启动后获取首页所有元素;S103: Obtain all elements of the home page after the application software is started;

S104:将获取的首页元素与关键字表单进行匹配,若不匹配,则中断结束,重新设置关键字表单;S104: Match the acquired homepage elements with the keyword form, if not, end the interruption and reset the keyword form;

S105:若匹配成功,则创建本次执行用例树根节点,并存储页面元素到一个页面容器中,将页面容器置位当前容器;S105: If the matching is successful, create the root node of the execution use case tree, store the page elements in a page container, and set the page container as the current container;

S106:在当前容器中,调用元素规则库,根据定义的元素规则,选择符合规则的一个有效元素或一组有效元素,生成自动化执行指令;S106: In the current container, call the element rule library, select an effective element or a group of effective elements that meet the rules according to the defined element rules, and generate an automatic execution instruction;

步骤106还包括:Step 106 also includes:

S301:在当前容器中,若选择的元素与元素规则不匹配,若匹配不成功,则按容器中元素顺序,选择第一个元素生成自动化执行指令。S301: In the current container, if the selected element does not match the element rule, if the match is unsuccessful, select the first element according to the order of the elements in the container to generate an automatic execution instruction.

S107:根据自动化执行指令使移动设备执行测试任务,获取移动设备执行指令操作后当前页面的所有元素,并将获取的页面元素与当前容器的元素和已有容器内元素进行比对判断是否为相同或相似页面,其中,所有元素为页面元素的XML,比对内容包括XML结构、页面title及元素信息等;S107: Make the mobile device execute the test task according to the automated execution instruction, obtain all elements of the current page after the mobile device executes the instruction operation, and compare the obtained page elements with the elements of the current container and the elements in the existing container to determine whether they are the same or similar pages, where all elements are XML of page elements, and the comparison content includes XML structure, page title and element information, etc.;

S108:若获取的页面元素与当前容器元素为不同页面,则判断是否与过往容器页面相同或相似;S108: If the obtained page element is different from the current container element, then determine whether it is the same or similar to the previous container page;

S109:若获取的页面元素与过往容器元素为相同或相似页面,则新增子节点并标记元素关联,并将该过往容器置为当前容器,完成该步骤后执行步骤S112;S109: If the obtained page element is the same or similar to the previous container element, add a child node and mark the element association, and set the previous container as the current container, and execute step S112 after completing this step;

S110:若获取的页面元素与过往容器元素为不同页面,则新增子节点,并标记当前容器中该元素已关联了该子节点,同时,存储当前页面元素到一个新的页面容器中,并将新容器标记为当前容器,完成该步骤后返回至步骤106;S110: If the obtained page element is a different page from the previous container element, add a new child node, and mark that the element in the current container is associated with the child node, and at the same time, store the current page element in a new page container, and Mark the new container as the current container, and return to step 106 after completing this step;

S111:若获取的页面元素与当前容器元素为相同或相似页面,则标记当前容器中的该元素为无效元素;S111: If the obtained page element is the same or similar to the current container element, mark the element in the current container as an invalid element;

S112:判断当前容器是否还有未标记节点的有效元素,若是则返回至步骤106;S112: Determine whether the current container has valid elements of unmarked nodes, and if so, return to step 106;

S113:若不存在未标记节点的有效元素,则判断当前容器是否为标记根节点的容器,若否,则返回上一级容器,将该上一级容器设置为当前容器,返回至步骤S112;S113: If there is no effective element of the unmarked node, judge whether the current container is a container marked with the root node, if not, return to the upper-level container, set the upper-level container as the current container, and return to step S112;

S114:若当前容器是标记为根节点的容器,则结束本次测试,按所有执行节点轨迹分析整理出节点间关系、对应页面、所执行的页面元素及测试日志生成测试报告;同时,输出自动化执行脚本。S114: If the current container is a container marked as the root node, the test is ended, and the relationship between nodes, corresponding pages, executed page elements and test logs are analyzed and sorted out according to the trajectory of all execution nodes to generate a test report; at the same time, the output is automated Execute the script.

如图2至3所示,一种移动云测试系统,包括前端入口1、管理平台2、存储平台3、联网设备库4和智能自动化测试平台5,其中,前端入口1包括用户单元11、应用软件上传单元12、移动设备列表单元13、发布测试任务单元14、云众测线下流程单元15、报告中心单元16;管理平台2包括用户管理单元21、应用软件权限单元22、设备中心单元23、联网设备整合单元24、任务中心单元25;联网设备库4还包括授权服务单元41、设备监控单元42、设备通信单元43、自动化执行单元44(即Appium);智能自动化测试平台5包括自动化设置单元53、自动化测试处理单元52、CAT发送接收单元51,自动化设置单元53包括首页关键字模块、菜单关键字模块以及元素规则库。As shown in Figures 2 to 3, a mobile cloud test system includes a front-end entrance 1, a management platform 2, a storage platform 3, a networked device library 4, and an intelligent automated test platform 5, wherein the front-end entrance 1 includes a user unit 11, an application Software upload unit 12, mobile device list unit 13, release test task unit 14, cloud public test offline process unit 15, report center unit 16; management platform 2 includes user management unit 21, application software authority unit 22, device center unit 23 , networked device integration unit 24, task center unit 25; networked device storehouse 4 also includes authorized service unit 41, device monitoring unit 42, device communication unit 43, automated execution unit 44 (i.e. Appium); intelligent automated test platform 5 includes automated settings The unit 53, the automated test processing unit 52, the CAT sending and receiving unit 51, and the automated setting unit 53 include a home page keyword module, a menu keyword module and an element rule library.

工作流程如下:用户通过用户单元11登入移动云测试系统,用户管理单元21确认身份权限后,用户可通过应用软件上传单元12上传待检测的应用软件,应用软件权限单元22对上传的应用软件进行权限设置,设置权限后的应用软件会存储至存储平台3会并生成对应的存储地址,并将该存储地址信息发送至任务中心单元25。同时个人或企业(将移动设备资源共享的群体)将移动设备通过数据线连接至可连通联网设备库4的电脑或服务器上,通过授权服务单元41对连接的移动设备进行授权连接服务,此时,即可将连接的移动设备接入到设备中心单元23。对授权后的移动设备则开启设备监控单元42、设备通信单元43。设备监控单元42实时检测连接入网的移动设备及其设备连接情况,联网设备整合单元24将所有连接入网移动设备的设备信息整合后发送至设备中心单元23。系统会按用户权限从设备中心中筛选出符合当前用户的可用移动设备,在移动设备列表单元13中进行展示。然后,用户在发布测试任务单元14发布针对上传的待测试应用软件的测试任务和选择测试类型,任务中心单元25接收并根据发布测试任务单元14的信息,推送众测任务至云众测线下流程单元15给可见用户或发布自动化测试任务至智能自动化测试平台5的自动设置单元。自动化设置单元53在接收到自动化测试任务后,用户在自动化设置单元53中填写关键字表单及选择当前用户的可用移动设备列表中的若干用于测试的移动设备,自动化测试处理单元52在接收到关键字表单后开始进行自动化测试,生成自动化执行指令,CAT发送接收单元51将自动化执行指令给联网设备库4的设备通信单元43,设备通信单元43将自动化执行指令发送至自动化执行单元44执行测试任务,测试任务完后将数据通过设备通信单元43和CAT发送接收单元51发送至自动化测试处理单元52,自动化测试处理单元52会根据当前返回结果,生成下一指令,直至自动化遍历完成,再分析测试数据生成测试报告,移动设备列单中的每一移动设备均会完成测试任务并生成测试报告,若干测试报告经报告工厂单元54(对执行日志进行归类分析统计,按html格式输出,生成高阅读性测试报告)汇总后在报告中心单元16进行展示。如果任务中心单元25发布的是众测任务,则会将众测任务发送至云众测线下流程单元15推送给系统内的其他用户,由其它用户来执行线下众测流程,并反馈测试报告到报告中心。The work flow is as follows: the user logs in the mobile cloud test system through the user unit 11, and after the user management unit 21 confirms the identity authority, the user can upload the application software to be detected by the application software upload unit 12, and the application software authority unit 22 performs a check on the uploaded application software. Permission setting, the application software after the permission is set will be stored in the storage platform 3 and a corresponding storage address will be generated, and the storage address information will be sent to the task center unit 25 . At the same time, individuals or enterprises (groups sharing mobile device resources) connect mobile devices to computers or servers that can be connected to the networked device library 4 through data lines, and perform authorized connection services to connected mobile devices through the authorized service unit 41. At this time , the connected mobile device can be connected to the device central unit 23 . For authorized mobile devices, the device monitoring unit 42 and the device communication unit 43 are turned on. The device monitoring unit 42 detects the mobile devices connected to the network and their connection conditions in real time, and the networked device integration unit 24 integrates the device information of all mobile devices connected to the network and sends it to the device central unit 23 . The system will filter out the available mobile devices matching the current user from the device center according to the user rights, and display them in the mobile device list unit 13 . Then, the user releases the test task and selects the test type for the uploaded application software to be tested in the release test task unit 14, and the task center unit 25 receives and pushes the public test task to the cloud public test line according to the information released by the test task unit 14 The process unit 15 is an automatic setting unit for visible users or for issuing automated testing tasks to the intelligent automated testing platform 5 . After the automation setting unit 53 receives the automation test task, the user fills in the keyword form and selects some mobile devices for testing in the available mobile device list of the current user in the automation setting unit 53, and the automation test processing unit 52 receives Start automated testing after the keyword form, generate automated execution instructions, CAT sending and receiving unit 51 sends the automated execution instructions to the device communication unit 43 of the networked device library 4, and the device communication unit 43 sends the automated execution instructions to the automated execution unit 44 to execute the test Task, after the test task is completed, the data will be sent to the automated test processing unit 52 through the device communication unit 43 and the CAT sending and receiving unit 51, and the automated test processing unit 52 will generate the next instruction according to the current return result until the automatic traversal is completed, and then analyze The test data generates a test report, and each mobile device in the mobile device list will complete the test task and generate a test report. Several test reports are passed through the report factory unit 54 (classifying, analyzing and counting the execution logs, outputting them in html format, and generating High-readability test report) is displayed in the report center unit 16 after being summarized. If the task center unit 25 publishes a public test task, it will send the public test task to the cloud public test offline process unit 15 and push it to other users in the system, and other users will execute the offline public test process and feedback the test Report to Report Center.

除上述之外,联网设备库4集成了轻量级开发环境工具SDKabd命令和Xcode,SDKabd命令和Xcode用于获取IOS或Android的移动设备的系统信息。管理平台2还包括联网设备库4的服务端、设备信息存储单元和协议翻译单元,设备信息存储单元用于响应授权服务单元41生成的验证成功信号将移动设备的设备信息存储在Cache/DB上,协议翻译单元用于将自定义格式协议内容翻译成Appium协议,Appium协议供自动化执行单元44识别。In addition to the above, the networked device library 4 integrates the lightweight development environment tools SDKabd command and Xcode, SDKabd command and Xcode are used to obtain the system information of IOS or Android mobile devices. The management platform 2 also includes a service end of the networked device library 4, a device information storage unit and a protocol translation unit, and the device information storage unit is used to store the device information of the mobile device on the Cache/DB in response to the verification success signal generated by the authorization service unit 41 , the protocol translation unit is used for translating the custom format protocol content into the Appium protocol, and the Appium protocol is recognized by the automatic execution unit 44 .

移动设备授权的具体步骤如下:当移动设备通过数据线连接至联网数据库时,开启授权服务,此时,发送TCP/IP协议给服务端,使已连接移动设备与联网数据库建立双向通道。TCP/IP协议包含的信息为当前联网设备库4的session(计算机语言,称为“会话控制”),服务端接收session通过验证后开启设备监控服务。The specific steps of mobile device authorization are as follows: when the mobile device is connected to the networked database through the data line, the authorization service is started. At this time, the TCP/IP protocol is sent to the server to establish a two-way channel between the connected mobile device and the networked database. The information contained in the TCP/IP protocol is the session (computer language, called "session control") of the current networked device library 4, and the server starts the device monitoring service after receiving the session through verification.

本发明的移动云测试系统针对自动化测试方法在自动化测试处理单元52内设置有以下模块:应用安装启动模块521、自动化操作模块522、页面元素采集器523、用例树模块525、元素容器模块526、相似度匹配模块524、检测判断模块527。自动化设置单元53包括首页关键字模块、菜单关键字模块和元素规则库,其中,首页关键字模块用于进入应用软件首页的操作步骤及确定应用软件首页的关键字元素;菜单关键字模块用于确定首页上的一级菜单的关键字,确定应用软件自动化的测试起点;元素规则库包括若干元素的处理规则,用于判断页面元素的选择及操作标准。The mobile cloud test system of the present invention is provided with the following modules in the automated test processing unit 52 for the automated test method: an application installation startup module 521, an automated operation module 522, a page element collector 523, a use case tree module 525, an element container module 526, A similarity matching module 524 and a detection and judgment module 527 . The automatic setting unit 53 comprises a homepage keyword module, a menu keyword module and an element rule base, wherein the homepage keyword module is used to enter the operation steps of the application software homepage and determine the keyword elements of the application software homepage; the menu keyword module is used for Determine the keywords of the first-level menu on the home page, and determine the starting point of application software automation testing; the element rule library includes processing rules for several elements, which are used to judge the selection and operation standards of page elements.

本发明的自动化测试方法在本发明的移动云测试系统中的工作流程如下:从应用软件上传单元12获取用户上传的待测试应用软件,从移动设备列表获取资源共享的可用在线移动设备列表,在自动化设置单元53中设置待测试应用软件的关键字表单,其中,首页关键字模块设置待测试应用软件首页的关键字元素,菜单关键字模块设置首页上的一级菜单的关键字元素。应用安装启动模块521响应测试任务生成启动应用指令,CAT发生接收模块将指令发送给选中的移动设备的客户端的设备通信单元43,自动化执行单元44响应启动应用指令在若干选中的移动设备上安装并启动该应用软件。通过页面元素采集器523获取首页所有元素,相似度匹配模块524在接收到首页的所有元素后,将获取的首页元素与关键字表单进行匹配,若不匹配,则中断结束,重新设置关键字表单;若匹配成功,则通过用例树模块525创建本次执行用例树根节点,并存储页面元素到元素容器中的一个页面容器当中,将该页面容器置为当前容器。在当前容器中,调用元素规则库,根据定义的元素规则,选择符合规则的一个有效元素或一组有效元素,通过自动化操作模块522生成自动化执行指令,设备通信单元43或自动化执行单元44响应自动化执行指令后驱动移动设备执行测试任务,测试完成后,通过页面元素采集器523获取当前页面的所有元素,通过相似度匹配模块524将获取的页面元素与当前容器的元素进行比对判断是否为相同或相似页面,若获取的页面元素与当前容器元素为不同页面,则判断是否与过往容器页面相同或相似,若获取的页面元素与过往容器元素为相同或相似页面,则通过用例树模块525新增子节点并标记元素关联,并将该过往容器置位当前容器,完成该步骤后执行判断是否还有为标记节点的元素,若获取元素与过往容器元素为不同页面,则通过用例树模块525新增子节点,并标记当前容器中该元素已关联了子节点,同时,存储当前页面元素到元素容器模块526中的一个新的页面容器当中,并将新容器标记为当前容器,完成该步骤后重新调用元素规则库;若获取的页面元素与当前容器元素为相同或相似页面,则标记当前容器中的该元素为无效元素。完成上述步骤后,通过检测判断模块527判断是否当前容器还有未标记节点的元素,若是则重新调用元素规则库,再选取当前容器中下一有效元素,生成自动化执行指令,继续执行相似判断,直至当前容器中的有效元素均已执行;若否,则通过检测判断模块527判断当前容器是否为标记根节点的容器,若当前容器不是标记根节点的容器,则返回到用例树模块525中的上一级容器,重新驱动移动设备执行上一级容器中每个有效元素的测试任务,直至用例树模块525中所有容器的有效元素都执行完成;若当前容器为标记根节点的容器,则结束本次测试,按所有执行节点轨迹分析整理出节点间关系、对应页面、所执行的页面元素及测试日志生成测试报告,同时,输出自动化执行脚本。The workflow of the automated testing method of the present invention in the mobile cloud test system of the present invention is as follows: obtain the application software to be tested uploaded by the user from the application software upload unit 12, obtain the available online mobile device list for resource sharing from the mobile device list, and The keyword form of the application software to be tested is set in the automation setting unit 53, wherein the homepage keyword module sets the keyword elements of the homepage of the application software to be tested, and the menu keyword module sets the keyword elements of the primary menu on the homepage. The application installation and starting module 521 responds to the test task to generate the starting application instruction, and the CAT generation receiving module sends the instruction to the device communication unit 43 of the client of the selected mobile device, and the automatic execution unit 44 responds to the starting application instruction and installs it on several selected mobile devices. Start the application software. Obtain all the elements of the home page by the page element collector 523, after receiving all the elements of the home page, the similarity matching module 524 matches the obtained home page elements with the keyword form, if not matched, the interruption ends, and the keyword form is reset ; If the match is successful, the use case tree module 525 is used to create the root node of the execution use case tree, and store the page element into a page container in the element container, and set the page container as the current container. In the current container, call the element rule library, select an effective element or a group of effective elements that meet the rules according to the defined element rules, and generate an automatic execution instruction through the automatic operation module 522, and the device communication unit 43 or the automatic execution unit 44 responds to the automatic After the instruction is executed, the mobile device is driven to perform the test task. After the test is completed, all elements of the current page are obtained by the page element collector 523, and the obtained page elements are compared with the elements of the current container by the similarity matching module 524 to determine whether they are the same or a similar page, if the obtained page element is different from the current container element, then judge whether it is the same or similar to the previous container page, if the obtained page element is the same or similar page as the previous container element, then pass the use case tree module 525 new Add child nodes and mark element associations, and set the previous container as the current container. After completing this step, execute to determine whether there are elements that are marked nodes. Add a new child node, and mark that the element in the current container has been associated with a child node, and at the same time, store the current page element in a new page container in the element container module 526, and mark the new container as the current container, and complete this step Then re-call the element rule library; if the obtained page element is the same or similar to the current container element, mark the element in the current container as an invalid element. After completing the above steps, judge whether the current container has elements of unmarked nodes by the detection and judgment module 527, if so, call the element rule library again, and then select the next valid element in the current container to generate an automatic execution instruction, and continue to perform similar judgments. Until the effective elements in the current container have been executed; if not, then judge whether the current container is the container of the mark root node by the detection judgment module 527, if the current container is not the container of the mark root node, then return to the use case tree module 525 The upper-level container, re-drive the mobile device to execute the test task of each effective element in the upper-level container, until the effective elements of all containers in the use case tree module 525 are executed; if the current container is the container marked with the root node, then end In this test, the relationship between nodes, corresponding pages, executed page elements, and test logs are analyzed and sorted out according to the trajectory of all execution nodes to generate a test report, and at the same time, an automated execution script is output.

本发明相比于现有技术的有益效果在于:解决了移动设备远程控制等相关技术,用户手机不需要安装任何应用,只需要开启USB数据连接,连接安装有联网设备库4的客户端电脑或私有服务器后,即可对手机进行远程控制,实现真机云测试。企业私有云服务,通过系统权限及联网设备库4的网络接入控制,可以对企业设备进行私有化保护。任何个人的或企业的测试设备,授权后,即可显示在联网设备库4中,用户即可以共享该设备获取相应回报,也可以租用其他联网可用设备进行测试,有效实现联网设备库4的设备资源整合,节省成本,支持企业或个人解决移动设备紧缺、测试流程管理、智能自动化测试,极大地减少了测试系统化搭建时间。本发明的自动化测试方法可在线编辑关键字表单,通过匹配关键字规则,实现智能深度遍历测试,突破了传统先录制调试再回放的自动化测试模式,而是根据智能规则遍历功能,生成用例树结构及执行结果。用户可以根据用例树结构进行二次修改,整理出有效功能自动化用例,也可修改智能规则,提高下次遍历的有效性。Compared with the prior art, the present invention has the beneficial effects of solving related technologies such as remote control of mobile devices, and the mobile phone of the user does not need to install any application, but only needs to open the USB data connection, and connect to the client computer or computer with the networked device library 4 installed After the private server is installed, the mobile phone can be remotely controlled to realize the real machine cloud test. Enterprise private cloud service, through system permissions and network access control of networked device library 4, can protect enterprise equipment privately. Any personal or corporate test equipment can be displayed in the networked equipment library 4 after authorization, and users can share the equipment to obtain corresponding rewards, or rent other networked available equipment for testing, effectively realizing the equipment of the networked equipment library 4 Resource integration, cost saving, support for enterprises or individuals to solve the shortage of mobile devices, test process management, intelligent automated testing, greatly reducing the time for building a test system. The automatic test method of the present invention can edit the keyword form online, realize the intelligent depth traversal test by matching the keyword rules, break through the traditional automatic test mode of first recording and debugging and then playback, and generate a use case tree structure according to the intelligent rule traversal function and execution results. Users can make secondary modifications according to the use case tree structure to sort out effective functional automation use cases, and can also modify smart rules to improve the effectiveness of the next traversal.

以上所述的具体实施例,对本发明的目的、技术方案和有益效果进行了进一步的详细说明,应当理解,以上所述仅为本发明的具体实施例而已,并不用于限定本发明的保护范围。特别指出,对于本领域技术人员来说,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The specific embodiments described above have further described the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above descriptions are only specific embodiments of the present invention and are not intended to limit the protection scope of the present invention. . In particular, for those skilled in the art, any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims (10)

1. a kind of automated testing method, which is characterized in that include the following steps:
The automatic test for obtaining the online mobile device list, application software to be tested and the application software to be tested that have authorized closes Key word list;
After the application software is installed and activated in several mobile devices in line mobile device list chosen, application is obtained The container in a reservoir, and is set to current container by all elements storage of software home page, creates root node;
In current container, selection meets an effective element or one group of effective element for element rule, generates automated execution Instruction;
The all elements for obtaining the current page that mobile device executes after automated execution instruction, by page elements and current container Interior element and existing container interior element are compared, it is determined whether are similar pages;
When if the dissimilar page, all elements of the new container storage page are created, and are set to new current container, are increased newly Child node;
Next effective element in current container is chosen again, automated execution instruction is generated, continues to execute similar judgement, until current The equal executed of effective element in container;
It chooses upper level container and executes similar judgement in the above described manner, until the effective element in all containers is carried out completion;
It is analyzed according to all execution node-locus and implementing result, generates test report.
2. according to the automated testing method described in claim 1, which is characterized in that described to obtain the online movement authorized List of devices includes the following steps:
When detecting that mobile device connection or the mobile device status having connected are changed, link information is obtained;
The link information for integrating all mobile devices filters out the available online mobile device of the user according to user right To generate the available online mobile device list of active user.
3. according to the automated testing method described in claim 1, which is characterized in that described in current container, selector The effective element or one group of effective element of element rule are closed, automated execution instruction is generated, includes the following steps:
In current container, an element or one group of element are selected, the element of selection is matched with element rule;
If successful match, automated execution instruction is generated;
If matching is unsuccessful, by order of elements in container, first Element generation automated execution instruction is selected.
4. according to the automated testing method described in claim 1, which is characterized in that the acquisition mobile device executes automatic The all elements for changing the current page after executing instruction, are compared with current container interior element and existing container, it is determined whether For similar pages, include the following steps:
After mobile device executes automated execution instruction, the element mark of the automated execution instruction will be generated in current container It is denoted as executed;
The all elements for obtaining the current page of application software to be tested again, by the member of the page elements of acquisition and current container Element is compared, and determines whether the same or similar page;
If being differed with current container or dissimilar, then judge whether that with passing stored container be the same or similar page, If still being differed with passing container, the newly-built container storage current page elements, and set newly-built container to current container; If same or similar with passing container, it sets the passing container to current container, and increase child node newly under a upper node, it will Newly-increased child node is associated with current container;
If same or similar with current container, it is inactive elements to update the element in current container.
5. according to the automated testing method described in claim 1, which is characterized in that it is described choose again it is next in current container Effective element generates automated execution instruction, continues to execute similar judgement, until the effective element in current container has been held Row;It chooses upper level container and executes similar judgement in the above described manner, until the effective element in all containers is carried out completion, also Include the following steps:
An automated execution instruction has often been executed, after confirming current container, has continued the selection one in current container and is not carried out The element crossed, repeat before the step of;
Until all executeds of the element in current container, previous page is returned to, the container of the page is positioned, before continuing repetition The step of, until all executeds of the element in all containers.
6. according to the automated testing method described in claim 1, which is characterized in that described according to all execution node-locus And implementing result is analyzed, and is generated test report, is included the following steps:
By relationship, corresponding page, performed page elements and test day between all execution node-locus analysis and arrangement egress Will generates test report;
Meanwhile exporting automated execution script.
7. a kind of mobile cloud tests system, which is characterized in that flat including the test of management platform, networked devices library and intelligent automation Platform, the management platform are used to manage test assignment, application software to be measured and the link information for integrating several mobile devices, management Platform includes networked devices integral unit, and networked devices library includes monitoring of tools unit, equipment communication unit and automated execution Unit, the intelligent automation test platform include that automated setting unit, automatic test processing unit and CAT are transmitted and received Unit;
Wherein, the monitoring of tools unit has connected for detecting the mobile device for being connected to networked devices library in real time, and by several The link information of the mobile device connect is uploaded to networked devices integral unit;
The networked devices integral unit, the link information sent for receiving all monitoring of tools units, if by involvement It connects the online mobile device list of information integration generation and is sent to automated execution unit;
The automated setting unit, the related keyword list for application software to be tested to be arranged and offer element rule Library;
The automatic test processing unit, the keyword list for responding the automated setting unit, is advised according to element Then the rule in library, which generates, starts application instruction and automated execution instruction, and receives the CAT and transmit and receive the shifting that unit is sent Information after dynamic device test instruction execution, test report is generated according to the information analysis after execution;
The equipment communication unit gives automated execution unit for receiving to start using instruction and automated execution instruction, And the information that automated execution unit returns is sent to CAT and transmits and receives unit;
The automated execution unit executes instruction corresponding operation for controlling mobile device, refers to when receiving startup application When enabling, application software to be tested is installed and activated in the mobile device controlled in online mobile device list, automatic when receiving When change executes instruction, driving mobile device executes instruction, and obtains the correlated results information after mobile device executes.
8. testing system according to the mobile cloud described in claim 7, which is characterized in that the automatic test processing unit packet Include page elements collector, similarity mode module, use-case tree module, element container module and detection judgment module;
Wherein, the page elements collector, for obtain it is to be tested it is application software initiated after homepage all elements and obtain Application software to be tested is taken to execute all elements of the page after automatic test instructs;
The similarity mode module, the homepage element and page elements obtained for receiving the page elements collector, when When receiving homepage element, application software and automated setting unit that homepage element and key table list contrast judgement are started Keyword list matching, when receiving page elements, the page elements of acquisition are compared with the element of current container The same or similar page is determined whether, in addition, by page elements and mistake after the Match of elemental composition of page elements and current container It is matched toward container;
The use-case tree module executes rail for recording automatic test according to the matching result of the similarity mode module Mark creates this and executes use-case root vertex after homepage element and keyword list successful match, when page elements and currently After the Match of elemental composition of container and passing container, child node is increased newly;
The element container module, for establishing container storage page elements, element executes state, and labelled element and node close Connection;
Whether the detection judgment module also has unmarked node for current container after detecting the element container module relation Element and judge after all elements flag node current container whether be mark root node container;
The automatic test processing unit is additionally operable to according to elementary state, element rule and the inspection in application current container The judging result of judgment module is surveyed, next step automatic test is generated and executes instruction.
9. testing system according to the mobile cloud described in claim 7, which is characterized in that further include that front end inlet and storage are flat Platform, the front end inlet include subscriber unit, application software upload unit, and the management platform includes service management unit, answers With software permission unit;
Wherein, the subscriber unit, for there is the user of application software testing demand to login;
The service management unit, the user authority setting logined for the subscriber unit;
The application software upload unit, for by the user after user authority setting by application software upload to be tested;
The application software permission unit, the permission and state of the application software for application software upload unit upload are set It sets and the presentation of information of application software;
The storage platform, the application software for being uploaded to the application software upload unit carry out ordering storage, and will Application software storage address feeds back to application software permission unit.
10. testing system according to the mobile cloud described in claim 9, which is characterized in that the front end inlet further includes movement Flow elements, Reporting Center's unit under list of devices unit, publication test assignment unit, cloud crowd's survey line, the management platform is also Including equipment center unit, the server-side in networked devices library and task center cell, networked devices library further includes authorization service list Member, device information storage unit, the intelligent automation test platform further include report factory unit;
Wherein, the authorization service unit for the mobile device to connection carries out that/Connection Service, generation is authorized to be proved to be successful Signal;
The monitoring of tools unit is proved to be successful all connections of signal monitoring for respond that the authorization service unit generates The state status of mobile device;
The device information storage unit is proved to be successful signal by mobile device for respond that the authorization service unit generates Facility information be stored on the Cache/DB in the networked devices library, and by the monitoring of tools unit real-time update to described Networked devices integral unit carries out real-time integration and generates online mobile device list, and the networked devices integral unit will move online Dynamic list of devices is sent to equipment center unit;
The equipment center unit, the online mobile device list for receiving the networked devices integral unit are screened by permission The online mobile device list that is used for active user is simultaneously shown in the mobile device list cell;
The publication test assignment unit, the mobile device in mobile device list for being shown to the equipment center unit Select the test-types and test assignment of application software to be detected;
The task center cell sends crowd's survey tasks to described for according to the information of test assignment by test assignment classification Under cloud crowd's survey line flow elements or automatic test task is sent to the automated setting unit;
Flow elements under the cloud crowd survey line, other users for being pushed to many survey tasks in system and to abduction Show, crowd surveys after task execution the test feedback generation crowd that several users submit observing and predicting announcement;
Report factory unit, the test report for receiving the automatic test processing unit, by several mobile devices Test report summarize after be sent to Reporting Center's unit;
Reporting Center's unit, the crowd for receiving flow elements under the cloud crowd survey line, which observes and predicts, to be accused and the report factory Test report.
CN201710138835.7A 2017-03-09 2017-03-09 Automated testing method and mobile cloud test system Active CN106961362B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710138835.7A CN106961362B (en) 2017-03-09 2017-03-09 Automated testing method and mobile cloud test system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710138835.7A CN106961362B (en) 2017-03-09 2017-03-09 Automated testing method and mobile cloud test system

Publications (2)

Publication Number Publication Date
CN106961362A CN106961362A (en) 2017-07-18
CN106961362B true CN106961362B (en) 2018-08-07

Family

ID=59470089

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710138835.7A Active CN106961362B (en) 2017-03-09 2017-03-09 Automated testing method and mobile cloud test system

Country Status (1)

Country Link
CN (1) CN106961362B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11520685B2 (en) * 2021-03-01 2022-12-06 Fmr Llc Systems and methods for an end-to-end automation framework

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107678939A (en) * 2017-08-29 2018-02-09 苏州惠邦科信息技术有限公司 Android terminal emulation test system
CN107943687B (en) * 2017-10-30 2021-07-30 北京奇虎科技有限公司 Device sharing method, device, server and storage medium
CN108572913A (en) * 2018-02-26 2018-09-25 挖财网络技术有限公司 Method, apparatus and the application of App homepages are positioned in Android client UI automation processes
CN108540558A (en) * 2018-04-16 2018-09-14 深圳市智云方圆科技有限公司 A kind of automatic test equipment and method of band cloud service function product
CN108845949A (en) * 2018-07-24 2018-11-20 浙江数链科技有限公司 A kind of performance test methods and platform
CN109491901A (en) * 2018-11-01 2019-03-19 郑州云海信息技术有限公司 A kind of the test execution progress metrics system and equipment of various dimensions
CN109359052A (en) * 2018-12-03 2019-02-19 北京车智赢科技有限公司 Mobile terminal automated testing method and system based on UI
CN109634856B (en) * 2018-12-04 2021-12-17 北京云测信息技术有限公司 IOS intelligent terminal remote real machine debugging system and method based on cloud service
CN111290940B (en) * 2018-12-10 2023-04-28 中国移动通信集团江西有限公司 Automated testing method, device, equipment and medium for APP
CN110708210B (en) * 2019-08-30 2022-05-03 深圳壹账通智能科技有限公司 Cloud test configuration method and device, computer equipment and storage medium
CN110569198A (en) * 2019-09-18 2019-12-13 北京搜狐新媒体信息技术有限公司 Method and device for automated testing of business functions
CN111090577B (en) * 2019-10-12 2024-04-09 平安壹钱包电子商务有限公司 Multi-terminal synchronous test method and device, computer equipment and storage medium
CN111061956B (en) 2019-12-24 2022-08-16 北京百度网讯科技有限公司 Method and apparatus for generating information
CN111340392B (en) * 2020-03-24 2025-01-28 广州帛铎工程技术咨询有限公司 An information processing module of a crowd-testing system
CN112612690B (en) * 2020-11-30 2024-05-14 北京达佳互联信息技术有限公司 User interface information processing method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101175285A (en) * 2006-11-01 2008-05-07 联想移动通信科技有限公司 Automatic testing method and system for mobile phone software
CN102541740A (en) * 2012-01-04 2012-07-04 广东欧珀移动通信有限公司 Android-based automatic test method for mobile phone notes

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9317410B2 (en) * 2013-03-15 2016-04-19 International Business Machines Corporation Testing functional correctness and idempotence of software automation scripts

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101175285A (en) * 2006-11-01 2008-05-07 联想移动通信科技有限公司 Automatic testing method and system for mobile phone software
CN102541740A (en) * 2012-01-04 2012-07-04 广东欧珀移动通信有限公司 Android-based automatic test method for mobile phone notes

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11520685B2 (en) * 2021-03-01 2022-12-06 Fmr Llc Systems and methods for an end-to-end automation framework

Also Published As

Publication number Publication date
CN106961362A (en) 2017-07-18

Similar Documents

Publication Publication Date Title
CN106961362B (en) Automated testing method and mobile cloud test system
US7640459B2 (en) Performing computer application trace with other operations
CN110928774A (en) Automatic test system based on node formula
CN112597014B (en) Automatic test method and device based on data driving, medium and electronic equipment
CN104539053B (en) Power dispatching automation polling robot and method based on reptile technology
US20080098359A1 (en) Manipulation of trace sessions based on address parameters
CN113706110B (en) FPGA test tool integrated test management platform
CN104123227A (en) Method for automatically generating testing cases
CN103281410B (en) Broadcast television network intelligent obstacle pretreatment method and system
CN112738230B (en) Automatic network gate testing system and working method thereof
CN102141962A (en) Safety distributed test framework system and test method thereof
CN102521700A (en) Electrical network informatization evaluation rapid test system
CN104639653A (en) Self-adaptive method and system based on cloud architecture
CN109560996B (en) Automatic testing system and method for terminal of Internet of things
CN113127356A (en) Pressure measurement method and device, electronic equipment and storage medium
CN111222034A (en) Data mobile display method and device and cloud server
CN101090295A (en) Test system and method for ASON network
CN104425001A (en) System for simultaneously burning multiple switches, method thereof and corresponding switches
CN111211934B (en) Cluster remote communication test method and system
CN111130922A (en) Airborne information safety automatic test method and test platform
CN102999424B (en) Parallel remote automated testing method
CN110750453B (en) HTML 5-based intelligent mobile terminal testing method, system, server and storage medium
CN111290937B (en) Extensible mobile application automation test platform based on hybrid cloud
CN111427710A (en) Communication method, device, equipment and storage medium of components in application program
CN104967667A (en) Software stability test remote monitoring system based on cloud service

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200508

Address after: No. 1902, 19th floor, building a, Huaxing Times Square, No. 478, Wensan Road, Xihu District, Hangzhou, Zhejiang Province, 310000

Patentee after: Tongjin Institute (Hangzhou) Network Technology Co., Ltd

Address before: 310000, Zhejiang Province, Xihu District, Wensanlu Road No. 478, Huaxing Times Square, block A, 23, Hangzhou

Patentee before: HANGZHOU TONGBANJIE INTERNET FINANCIAL INFORMATION SERVICES Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20211112

Address after: 310000 room c802, building 1, Huifeng international business center, Xihu District, Hangzhou City, Zhejiang Province

Patentee after: Hangzhou Fanwen Technology Co., Ltd

Address before: 310000 room 1902, 19th floor, tower a, Huaxing Times Square, No. 478, Wensan Road, Xihu District, Hangzhou, Zhejiang Province

Patentee before: Tongjinsuo (Hangzhou) Network Technology Co., Ltd

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载