WO2023093137A1 - 一种应用app测试方法、装置、电子设备及存储介质 - Google Patents

一种应用app测试方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2023093137A1
WO2023093137A1 PCT/CN2022/112600 CN2022112600W WO2023093137A1 WO 2023093137 A1 WO2023093137 A1 WO 2023093137A1 CN 2022112600 W CN2022112600 W CN 2022112600W WO 2023093137 A1 WO2023093137 A1 WO 2023093137A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
tested
app
content
target
Prior art date
Application number
PCT/CN2022/112600
Other languages
English (en)
French (fr)
Inventor
郭明礼
张云飞
王胜昭
Original Assignee
中国银联股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中国银联股份有限公司 filed Critical 中国银联股份有限公司
Publication of WO2023093137A1 publication Critical patent/WO2023093137A1/zh

Links

Images

Classifications

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

Definitions

  • the present invention relates to the technical field of application APP testing, in particular to an application APP testing method, device, electronic equipment and storage medium.
  • the embodiment of the present invention provides an application APP testing method, device, electronic equipment and storage medium to solve the problems of the prior art that manual testing consumes human resources and costs, the accuracy of the test cannot be guaranteed, and the efficiency of the test is low. question.
  • An embodiment of the present invention provides an application APP testing method, the method comprising:
  • determining the target path corresponding to the node to be tested in the poco tree structure includes:
  • determining the path to which the target node belongs as the target path corresponding to the node to be tested includes:
  • the path between the non-Other node closest to the node to be tested and the node to be tested is taken as a target path.
  • comparing the displayed content of the node to be tested with the content in the file used to develop the APP, completing the test of the node to be tested includes:
  • determining the content corresponding to the target key value in the file used to develop the APP, comparing the content corresponding to the target key value with the display content of the node to be tested, and completing the Tests for the test node include:
  • Obtain the current language mode of the APP determine the content in the language mode in the content corresponding to the target key value in the file used to develop the APP, if the content in the language mode is consistent with the display content of the node to be tested If they are the same, it is determined that the test of the node to be tested is successful, and if the content in the language mode is different from the displayed content of the node to be tested, it is determined that the test of the node to be tested fails.
  • the method also includes:
  • the size of the node in each path in the poco tree structure and the positional relationship between the node and the node to be clicked determine the position of the node to be clicked on the screen, according to The position of the node to be clicked on the screen completes the click event on the node to be clicked.
  • an embodiment of the present invention provides an application APP testing device, the device comprising:
  • a determining module configured to determine the poco tree structure of the APP, and determine the target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP;
  • a test module configured to determine the display content of the node to be tested according to the target path, compare the display content of the node to be tested with the content in the file used to develop the APP, and complete the test of the node to be tested Node tests.
  • the determining module is specifically configured to determine the name attribute of the node to be tested in the APP, determine the target node in the poco tree structure that is the same as the name attribute, and determine the path to which the target node belongs is the target path corresponding to the node to be tested.
  • the determining module is specifically configured to determine the path to which the target node belongs as a candidate path corresponding to the node to be tested; if there is a parent other than the node to be tested in the candidate path node, the path between the nearest non-Other node to the node to be tested is taken as the target path.
  • the testing module is specifically configured to determine the target key value corresponding to the display content of the node to be tested according to the display content of the node to be tested and the preset correspondence between the display content and the key value; determine The content corresponding to the target key in the file used to develop the APP is compared with the display content of the node to be tested to complete the test of the node to be tested.
  • test module is specifically used to obtain the current language mode of the APP, and determine the content in the language mode in the content corresponding to the target key value in the file used to develop the APP, if the language mode is the same as the display content of the node to be tested, then it is determined that the test of the node to be tested is successful; if the content in the language mode is different from the display content of the node to be tested, then it is determined that the node to be tested is fail.
  • test module is also used to determine the selected node according to the screen size of the device on which the APP is installed, the size of the node in each path in the poco tree structure, and the positional relationship between the node and the node to be clicked.
  • the position of the node to be clicked on the screen is stated, and the click event on the node to be clicked is completed according to the position of the node to be clicked on the screen.
  • an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete mutual communication through the communication bus;
  • the processor is configured to implement the method steps described in any one of the above when executing the program stored in the memory.
  • an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps described in any one of the above are implemented. .
  • An embodiment of the present invention provides an application APP testing method, device, electronic equipment, and storage medium.
  • the method includes: determining the poco tree structure of the APP, and determining the poco tree structure of the APP according to the nodes to be tested in the APP.
  • the target path corresponding to the node to be tested determine the display content of the node to be tested according to the target path, compare the display content of the node to be tested with the content in the file used to develop the APP, and complete A test for the node to be tested.
  • the poco tree structure of the APP is first determined, and the target path corresponding to the node to be tested is determined from the poco tree structure for the node to be tested in the APP. Finally, determine the display content of the node to be tested according to the target path, compare the display content of the node to be tested with the content in the file used to develop the APP, and complete the test of the node to be tested. Based on the above scheme, the testing of each node in each language mode can be automatically completed, avoiding the problems of manual testing that consumes human resources and costs, the accuracy of testing cannot be guaranteed, and the testing efficiency is low.
  • FIG. 1 is a schematic diagram of the application APP testing process provided by the embodiment of the present invention.
  • Fig. 2 is a schematic diagram of determining a target path provided by an embodiment of the present invention
  • FIG. 3 is a schematic diagram of determining a node to be clicked provided by an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of an application APP testing device provided by an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
  • Fig. 1 is the schematic diagram of application APP (application) testing process that the embodiment of the present invention provides, and this process comprises the following steps:
  • S101 Determine a poco tree structure of the APP, and determine a target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP.
  • S102 Determine the display content of the node to be tested according to the target path, compare the display content of the node to be tested with the content in the file used to develop the APP, and complete the test of the node to be tested .
  • the APP testing method provided by the embodiment of the present invention is applied to electronic equipment, and the embodiment of the present invention is mainly aimed at the testing method of the APP of the iOS terminal, and the electronic equipment may be an iphone, an ipad and the like equipped with the APP of the iOS terminal.
  • the APP testing method provided by the embodiment of the present invention is a testing method based on the poco tree of the internationalized APP on the iOS side.
  • the name of the poco node in the Android system can be bound to the id in the code to search, while the iOS system does not have a concept similar to the node id in the Android system.
  • searching for a poco node you need to go through the poco tree level by level. Search to the node to be tested, and most of the poco tree nodes on the iOS side that are directly mapped by conventional testing tools are "Other" nodes, and the names of non-"Other” nodes will change with the language switching of the iOS system, so the global multilingual APP cannot be used.
  • the embodiment of the present invention provides a test method based on the poco tree of the international multilingual APP on the iOS side. On the premise of focusing on the test of the multilingual copywriting of the international language APP, it takes into account the improvement of test efficiency and supports simultaneous multi-machine parallelism. Test to ensure the completeness and accuracy of the test.
  • the poco tree structure of the APP is firstly determined, and the poco tree structure includes multiple paths of the APP.
  • determine the target path corresponding to the node to be tested in the poco tree structure. Determine the display content of the node to be tested according to the target path, compare the display content of the node to be tested with the content in the file used to develop the APP, and complete the test of the node to be tested. If the comparison is successful, the test of the node to be tested is successful, and if the comparison fails, the test of the node to be tested fails.
  • the target path corresponding to the node to be tested is determined through the poco tree structure, and then the display content of the node to be tested is determined according to the target path. Then, the node to be tested is tested according to the displayed content of the node to be tested. Solved the problem that the names of non-"Other" nodes in the poco tree would change with the language switching of the iOS system, which would affect the test results.
  • the poco tree structure of the APP is determined first, and the target path corresponding to the node to be tested is determined from the poco tree structure for the node to be tested in the APP. Finally, determine the display content of the node to be tested according to the target path, compare the display content of the node to be tested with the content in the file used to develop the APP, and complete the test of the node to be tested. Based on the above scheme, the testing of each node in each language mode can be automatically completed, avoiding the problems of manual testing that consumes human resources and costs, the accuracy of testing cannot be guaranteed, and the testing efficiency is low.
  • the determining the target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP includes:
  • Each node in the Poco tree and the node to be tested include a name attribute, determine the name attribute of the node to be tested in the APP and the name attribute of each node in the Poco tree, and determine whether the Poco tree contains the node to be tested by matching the name attribute For target nodes with the same name attribute, the determined path to which the target node belongs is determined as the target path corresponding to the node to be tested.
  • the test case is compiled according to the specific copy, so after finding the node to be tested, and determining the target path corresponding to the node to be tested, the convenient way is to use the copy to find this node. Therefore, when determining the target path, the target path is determined only when the name attribute of the last node of the path in the Poco tree is consistent with the text to be tested.
  • determining the path to which the target node belongs as the target path corresponding to the node to be tested includes:
  • the path between the node to be tested from the nearest non-Other node to the node to be tested is taken as the target path.
  • the path is determined as a candidate path. Then determine whether there is a parent node other than the node to be tested in the candidate path that is not Other. If it exists, use the parent node as the root node, and use the path from the root node to the node to be tested as the target path. It should be noted that, in addition to the node to be tested, if there are multiple parent nodes that are not Other, you can choose one of the parent nodes that is not Other as the root node, and use this parent node as the root node, and transfer the root node to the node to be tested.
  • the non-Other node closest to the node to be tested can be selected as the root node according to the principle of the shortest path, and the path from the root node to the node to be tested can be used as the target path.
  • the Window node in Figure 2 is the root node in the candidate path
  • the non-Other node in Figure 2 in the embodiment of the present invention is the parent node
  • the non-Other node in Figure 2 is used as the root node
  • the non-Other node in Figure 2 is used as the root node.
  • the path between the node and the poco node to be tested is used as the target path. Use non-Other nodes to directly output downwards to find the retrieval path of the poco node to be tested.
  • the path is determined as a candidate path. If there is a parent node other than Other in the candidate path except the node to be tested, the path between the non-Other node closest to the node to be tested and the node to be tested is taken as the target path. The length of the target path is reduced, and the test efficiency of the nodes to be tested is improved.
  • comparing the displayed content of the node to be tested with the content in the file used to develop the APP, completing the test of the node to be tested includes:
  • the display content of the node to be tested is generally the display name of the node to be tested, and the corresponding relationship between the display content and the key value is preset. For example, the key value corresponding to the display content "payment" is a, and the key value corresponding to "balance” is b, etc. wait. According to the corresponding relationship of the key value to be tested, the target key value corresponding to the display content of the node to be tested is determined. There is a corresponding key value for each language in the file used to develop the APP, and the key values corresponding to the content of synonymous expression meaning in different languages are the same. Determine the content corresponding to the target key value in the file used to develop the APP.
  • the target key value is determined to be a
  • the content corresponding to the target key value a includes the content of each language content.
  • the content corresponding to the target key value is compared with the display content of the node to be tested, and if the content corresponding to the target key value has the same content as the display content of the node to be tested, it is determined that the test of the node to be tested is successful. If the content corresponding to the target key value does not have the same content as the displayed content of the node to be tested, it is determined that the test of the node to be tested fails.
  • the determination of the content corresponding to the target key value in the file used to develop the APP, and the content corresponding to the target key value and the display content of the node to be tested comprises:
  • Obtain the current language mode of the APP determine the content in the language mode in the content corresponding to the target key value in the file used to develop the APP, if the content in the language mode is consistent with the display content of the node to be tested If they are the same, it is determined that the test of the node to be tested is successful, and if the content in the language mode is different from the displayed content of the node to be tested, it is determined that the test of the node to be tested fails.
  • the current language mode of the APP for example, the current language mode is Chinese. Then determine the content in the language mode in the content corresponding to the target key value in the file used to develop the APP. Taking the target key value a corresponding to the content "payment” displayed by the node to be tested as an example, determine whether the content in the Chinese mode of the content corresponding to the target key value a in the file used to develop the APP is "payment”. If yes, it is determined that the test of the node to be tested is successful, and if not, it is determined that the test of the node to be tested fails.
  • the current language mode of the APP is obtained, and the content in the language mode in the content corresponding to the target key value in the file used to develop the APP is determined, if the content in the language mode is the same as If the displayed content of the nodes to be tested is the same, it is determined that the test of the node to be tested is successful; if the content in the language mode is different from the displayed content of the node to be tested, it is determined that the test of the node to be tested has failed. There is no need to compare all the content corresponding to the target key value in the file used to develop the APP with the display content of the node to be tested, which further improves the test efficiency.
  • the node path path in the device is output, and the node name attribute is used to print the node name. If the name is consistent with the standard value of the node to be tested, the path is correct. However, the path at this time is too long, and the operation will take up too much retrieval time. Continue to optimize the retrieval path. Except for the last node, if there is a parent node that is not "Other", use this node directly as the root node to avoid The poco node search path is too long, which reduces the test efficiency.
  • the position of the adjacent node can be calculated according to the screen size, and the adjacent node that can output the path can be used to trigger the node to be tested
  • the click event also includes:
  • the size of the node in each path in the poco tree structure and the positional relationship between the node and the node to be clicked determine the position of the node to be clicked on the screen, according to The position of the node to be clicked on the screen completes the click event on the node to be clicked, and the next node to be tested is tested.
  • the next node to be tested can be tested generally through the click event of the node to be clicked.
  • the APP testing method provided by the embodiment of the present invention can output the path of the poco node to be tested in the multilingual APP, and complete the click operation of the component that is not easy to output the node path.
  • Compilation of case scripts can adopt the optimal retrieval scheme for each node to form a set of automated test cases, and finally realize the automatic retrieval of poco tree nodes and automatic copy verification of the multilingual APP on the iOS side.
  • Fig. 4 is a schematic structural diagram of an application APP testing device provided by an embodiment of the present invention, the device includes:
  • the determining module 41 is configured to determine the poco tree structure of the APP, and determine the target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP;
  • the testing module 42 is configured to determine the display content of the node to be tested according to the target path, compare the display content of the node to be tested with the content in the file used to develop the APP, and complete the Tests for test nodes.
  • the determining module 41 is specifically configured to determine the name attribute of the node to be tested in the APP, determine the target node in the poco tree structure that is the same as the name attribute, and determine the path to which the target node belongs as the Describe the target path corresponding to the node to be tested.
  • the determining module 41 is specifically configured to determine the path to which the target node belongs as a candidate path corresponding to the node to be tested; if there is a non-Other parent node in the candidate path except the node to be tested, Then, the path between the non-Other node closest to the node to be tested and the node to be tested is taken as the target path.
  • the testing module 42 is specifically used to determine the target key value corresponding to the display content of the node to be tested according to the display content of the node to be tested and the preset corresponding relationship between the display content and the key value; The content corresponding to the target key value in the file used by the APP is compared with the display content of the node to be tested to complete the test of the node to be tested.
  • the test module 42 is specifically used to obtain the current language mode of the APP, and determine the content in the language mode in the content corresponding to the target key value in the file used to develop the APP, if the content in the language mode If it is the same as the displayed content of the node to be tested, it is determined that the test of the node to be tested is successful, and if the content in the language mode is different from the displayed content of the node to be tested, it is determined that the test of the node to be tested has failed.
  • the testing module 42 is further configured to determine the to-be-clicked node according to the screen size of the device on which the APP is installed, the size of the node in each path in the poco tree structure, and the positional relationship between the node and the node to be clicked. Click the position of the node on the screen, and complete the click event on the node to be clicked according to the position of the node to be clicked on the screen.
  • an electronic device is also provided in the embodiment of the present invention, as shown in FIG. , the communication interface 302, and the memory 303 complete mutual communication through the communication bus 304;
  • a computer program is stored in the memory 303, and when the program is executed by the processor 301, the processor 301 is made to perform the following steps:
  • an electronic device is also provided in the embodiment of the present invention. Since the problem-solving principle of the above-mentioned electronic device is similar to the APP test method, the implementation of the above-mentioned electronic device can refer to the implementation of the method, and the repetition will not be repeated. .
  • the communication bus mentioned above for the electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus or the like.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
  • the communication interface 302 is used for communication between the electronic device and other devices.
  • the memory may include a random access memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk memory.
  • RAM Random Access Memory
  • NVM non-Volatile Memory
  • the memory may also be at least one storage device located away from the aforementioned processor.
  • the above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate display or Other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • NP Network Processor
  • DSP Digital Signal Processing
  • the poco tree structure of the APP is determined, and according to the nodes to be tested in the APP, the target corresponding to the node to be tested in the poco tree structure is determined Path; determine the display content of the node to be tested according to the target path, compare the display content of the node to be tested with the content in the file used to develop the APP, and complete the test of the node to be tested .
  • the poco tree structure of the APP is determined first, and the target path corresponding to the node to be tested is determined from the poco tree structure for the node to be tested in the APP. Finally, determine the display content of the node to be tested according to the target path, compare the display content of the node to be tested with the content in the file used to develop the APP, and complete the test of the node to be tested. Based on the above scheme, the testing of each node in each language mode can be automatically completed, avoiding the problems of manual testing that consumes human resources and costs, the accuracy of testing cannot be guaranteed, and the testing efficiency is low.
  • an embodiment of the present invention also provides a computer-readable storage medium, where a computer program executable by an electronic device is stored in the computer-readable storage medium.
  • a computer program executable by an electronic device is stored in the computer-readable storage medium.
  • an embodiment of the present invention also provides a computer-readable storage medium. Since the principle of solving problems when the processor executes the computer program stored on the computer-readable storage medium is similar to the APP testing method, the processing For the implementation of the computer program stored in the above-mentioned computer-readable storage medium by the device, reference may be made to the implementation of the method, and repeated descriptions will not be repeated.
  • the above-mentioned computer-readable storage medium may be any available medium or data storage device that can be accessed by a processor in an electronic device, including but not limited to magnetic storage such as floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc., optical storage such as CD, etc. , DVD, BD, HVD, etc., and semiconductor memory such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid state drive (SSD), etc.
  • magnetic storage such as floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.
  • optical storage such as CD, etc. , DVD, BD, HVD, etc.
  • semiconductor memory such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid state drive (SSD), etc.
  • a computer program is stored in the computer-readable storage medium provided in the embodiment of the present invention.
  • the poco tree structure of the APP is determined.
  • the poco tree structure in the poco tree structure is determined.
  • the target path corresponding to the node to be tested determine the display content of the node to be tested according to the target path, compare the display content of the node to be tested with the content in the file used to develop the APP, and complete A test for the node to be tested.
  • the poco tree structure of the APP is determined first, and the target path corresponding to the node to be tested is determined from the poco tree structure for the node to be tested in the APP. Finally, determine the display content of the node to be tested according to the target path, compare the display content of the node to be tested with the content in the file used to develop the APP, and complete the test of the node to be tested. Based on the above scheme, the testing of each node in each language mode can be automatically completed, avoiding the problems of manual testing that consumes human resources and costs, the accuracy of testing cannot be guaranteed, and the testing efficiency is low.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions
  • the device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Testing Electric Properties And Detecting Electric Faults (AREA)

Abstract

本发明公开了一种应用APP测试方法、装置、电子设备及存储介质,所述方法包括:确定APP的poco树结构,根据所述APP中的待测试节点,确定所述poco树结构中所述待测试节点对应的目标路径;根据所述目标路径确定所述待测试节点的显示内容,根据所述待测试节点的显示内容和开发所述APP所用的文件中的内容进行比对,完成对所述待测试节点的测试。基于上述方案可以自动完成对各个语种模式下各个节点的测试,避免了人工测试耗费人力资源及成本较大,测试的准确性无法保证以及测试的效率较低的问题。

Description

一种应用APP测试方法、装置、电子设备及存储介质
相关申请的交叉引用
本申请要求在2021年11月24日提交中国专利局、申请号为202111407428.4、申请名称为“一种应用APP测试方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及应用APP测试技术领域,尤其涉及一种应用APP测试方法、装置、电子设备及存储介质。
背景技术
为支持推广境外用户,需要一套功能完善且具备全球主要语言的应用APP做支撑。APP开发完成后需要对APP进行测试,保障APP在本地化运行过程中的准确与高效。
在APP的国际化布局中,针对主要18种不同国家和地区的语言文案,目前在对APP进行测试时一般是采用人工的方式对APP逐页逐行逐段进行文案核验,即将APP中的文案与开发APP所用的文件中的文案进行比对。人工测试存在的问题很明显,首先由于测试人员对国际多种语言的掌握程度有限,在测试过程中需要进一步了解和学习国际多种语言,耗费人力资源及成本较大,并且测试的准确性无法保证。其次针对主要18种不同国家和地区的语言文案进行人工测试,使得APP测试的效率较低。
发明内容
本发明实施例提供了一种应用APP测试方法、装置、电子设备及存储介质,用以解决现有技术人工测试耗费人力资源及成本较大,测试的准确性无法保证以及测试的效率较低的问题。
本发明实施例提供了一种应用APP测试方法,所述方法包括:
确定APP的poco树结构,根据所述APP中的待测试节点,确定所述poco树结构中所述待测试节点对应的目标路径;
根据所述目标路径确定所述待测试节点的显示内容,根据所述待测试节点的显示内容和开发所述APP所用的文件中的内容进行比对,完成对所述待测试节点的测试。
进一步地,所述根据所述APP中的待测试节点,确定所述poco树结构中所述待测试节点对应的目标路径包括:
确定所述APP中的待测试节点的名称属性,确定所述poco树结构中与所述名称属性相同的目标节点,将所述目标节点所属的路径确定为所述待测试节点对应的目标路径。
进一步地,将所述目标节点所属的路径确定为所述待测试节点对应的目标路径包括:
将所述目标节点所属的路径确定为所述待测试节点对应的候选路径;
若所述候选路径中除所述待测试节点外,存在非Other的父节点,则将距离所述待测试节点最近的非Other节点到所述待测试节点之间的路径作为目标路径。
进一步地,根据所述待测试节点的显示内容和开发所述APP所用的文件中的内容进行比对,完成对所述待测试节点的测试包括:
根据所述待测试节点的显示内容,以及预先设置的显示内容与键值的对应关系,确定所述待测试节点的显示内容对应的目标键值;
确定开发所述APP所用的文件中所述目标键值对应的内容,将所述目标键值对应的内容和所述待测试节点的显示内容进行比对,完成对所述待测试节点的测试。
进一步地,所述确定开发所述APP所用的文件中所述目标键值对应的内容,将所述目标键值对应的内容和所述待测试节点的显示内容进行比对,完成对所述待测试节点的测试包括:
获取APP当前的语种模式,确定开发所述APP所用的文件中所述目标键值对应的内容中所述语种模式下的内容,若所述语种模式下的内容与所述待测试节点的显示内容相同,则确定所述待测试节点测试成功,若所述语种模式下的内容与所述待测试节点的显示内容不同,则确定所述待测试节点测试失败。
进一步地,所述方法还包括:
根据安装所述APP的设备的屏幕尺寸、所述poco树结构中的每条路径中节点的尺寸以及所述节点与待点击节点的位置关系,确定所述待点击节点在屏幕中的位置,根据所述待点击节点在屏幕中的位置完成对所述待点击节点的点击事件。
另一方面,本发明实施例提供了一种应用APP测试装置,所述装置包括:
确定模块,用于确定APP的poco树结构,根据所述APP中的待测试节点,确定所述poco树结构中所述待测试节点对应的目标路径;
测试模块,用于根据所述目标路径确定所述待测试节点的显示内容,根据所述待测试节点的显示内容和开发所述APP所用的文件中的内容进行比对,完成对所述待测试节点的测试。
进一步地,所述确定模块,具体用于确定所述APP中的待测试节点的名称属性,确定所述poco树结构中与所述名称属性相同的目标节点,将所述目标节点所属的路径确定为所述待测试节点对应的目标路径。
进一步地,所述确定模块,具体用于将所述目标节点所属的路径确定为所述待测试节点对应的候选路径;若所述候选路径中除所述待测试节点外,存在非Other的父节点,则将距离所述待测试节点最近的非Other节点到所述待测试节点之间的路径作为目标路径。
进一步地,所述测试模块,具体用于根据所述待测试节点的显示内容,以及预先设置的显示内容与键值的对应关系,确定所述待测试节点的显示内容对应的目标键值;确定开发所述APP所用的文件中所述目标键值对应的内容,将所述目标键值对应的内容和所述待测试节点的显示内容进行比对,完 成对所述待测试节点的测试。
进一步地,所述测试模块,具体用于获取APP当前的语种模式,确定开发所述APP所用的文件中所述目标键值对应的内容中所述语种模式下的内容,若所述语种模式下的内容与所述待测试节点的显示内容相同,则确定所述待测试节点测试成功,若所述语种模式下的内容与所述待测试节点的显示内容不同,则确定所述待测试节点测试失败。
进一步地,所述测试模块,还用于根据安装所述APP的设备的屏幕尺寸、所述poco树结构中的每条路径中节点的尺寸以及所述节点与待点击节点的位置关系,确定所述待点击节点在屏幕中的位置,根据所述待点击节点在屏幕中的位置完成对所述待点击节点的点击事件。
另一方面,本发明实施例提供了一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;
存储器,用于存放计算机程序;
处理器,用于执行存储器上所存放的程序时,实现上述任一项所述的方法步骤。
另一方面,本发明实施例提供了一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述任一项所述的方法步骤。
本发明实施例提供了一种应用APP测试方法、装置、电子设备及存储介质,所述方法包括:确定APP的poco树结构,根据所述APP中的待测试节点,确定所述poco树结构中所述待测试节点对应的目标路径;根据所述目标路径确定所述待测试节点的显示内容,根据所述待测试节点的显示内容和开发所述APP所用的文件中的内容进行比对,完成对所述待测试节点的测试。
上述的技术方案具有如下优点或有益效果:
由于在本发明实施例中,对于待测试的APP,首先确定出该APP的poco树结构,并针对APP中待测试节点从poco树结构中确定出待测试节点对应的 目标路径。最后根据目标路径确定待测试节点的显示内容,根据待测试节点的显示内容和开发APP所用的文件中的内容进行比对,完成对待测试节点的测试。基于上述方案可以自动完成对各个语种模式下各个节点的测试,避免了人工测试耗费人力资源及成本较大,测试的准确性无法保证以及测试的效率较低的问题。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的应用APP测试过程示意图;
图2为本发明实施例提供的确定目标路径示意图;
图3为本发明实施例提供的确定待点击节点示意图;
图4为本发明实施例提供的应用APP测试装置结构示意图;
图5为本发明实施例提供的电子设备结构示意图。
具体实施方式
下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。
实施例1:
图1为本发明实施例提供的应用APP(application)测试过程示意图,该过程包括以下步骤:
S101:确定APP的poco树结构,根据所述APP中的待测试节点,确定所述poco树结构中所述待测试节点对应的目标路径。
S102:根据所述目标路径确定所述待测试节点的显示内容,根据所述待测试节点的显示内容和开发所述APP所用的文件中的内容进行比对,完成对所述待测试节点的测试。
本发明实施例提供的APP测试方法应用于电子设备,本发明实施例主要是针对iOS端的APP的测试方法,电子设备可以是安装有iOS端的APP的iphone、ipad等设备。
本发明实施例提供的APP测试方法是一种基于iOS端国际化APP的poco树的测试方法。在对APP测试过程中,安卓系统poco节点名称可与代码中id绑定查找,而iOS系统没有类似安卓系统节点id的概念,在进行poco节点查找时要通过在poco树中一级一级向下查找至待测试节点,且常规测试工具直接映射的iOS端poco树节点多为“Other”节点,且非“Other”节点名称会随iOS系统切换语种而变化,因此全球多语言APP无法通过利用待测试节点名称的方式查找poco树节点。需要一种更完备的poco树节点检索装置以满足全球语言APP测试业务需要。为了解决上述问题,本发明实施例提供了基于iOS端国际多语言APP的poco树的测试方法,在重点解决国际语言APP多语言文案的测试前提下,兼顾提升测试效率,支持同时进行多机并行测试,保证测试完整性与准确性。
本发明实施例中,针对待测试的APP,首先确定APP的poco树结构,poco树结构中包括APP的多条路径。针对待测试节点,确定poco树结构中待测试节点对应的目标路径。根据目标路径确定待测试节点的显示内容,根据待测试节点的显示内容和开发APP所用的文件中的内容进行比对,完成对待测试节点的测试。若比对成功则待测试节点测试成功,若比对失败则待测试节点测试失败。
本发明实施例通过poco树结构确定出待测试节点对应的目标路径,然后根据目标路径确定待测试节点的显示内容。进而根据待测试节点的显示内容对待测试节点进行测试。解决了poco树中非“Other”节点名称会随iOS系统切换语种而变化,影响测试效果的问题。
由于在本发明实施例中,对于待测试的APP,首先确定出该APP的poco树结构,并针对APP中待测试节点从poco树结构中确定出待测试节点对应的目标路径。最后根据目标路径确定待测试节点的显示内容,根据待测试节点的显示内容和开发APP所用的文件中的内容进行比对,完成对待测试节点的测试。基于上述方案可以自动完成对各个语种模式下各个节点的测试,避免了人工测试耗费人力资源及成本较大,测试的准确性无法保证以及测试的效率较低的问题。
本发明实施例中,所述根据所述APP中的待测试节点,确定所述poco树结构中所述待测试节点对应的目标路径包括:
确定所述APP中的待测试节点的名称属性,确定所述poco树结构中与所述名称属性相同的目标节点,将所述目标节点所属的路径确定为所述待测试节点对应的目标路径。
Poco树中每个节点以及待测试节点都包括名称name属性,确定APP中的待测试节点的名称属性以及Poco树中每个节点的名称属性,通过名称属性匹配确定Poco树中包含与待测试节点的名称属性相同的目标节点,将确定出的目标节点所属的路径确定为待测试节点对应的目标路径。
需要说明的是,在写案例时根据具体的文案来编制测试案例的,所以找到待测试节点之后,确定待测试节点对应的目标路径,那便捷的方式是利用文案来查找这个节点。所以确定目标路径时,Poco树中的路径的最后一个节点的名称属性与要测试文案一致,才确定了目标路径。
若Poco树中路径包含的最后一个节点的名称属性与待测试节点的名称属性相同,将该路径确定为目标路径。此时确定出的目标路径较长,包含的节点较多,进行测试时操作时间较长,降低了测试效率。为了优化目标路径,本发明实施例中,将所述目标节点所属的路径确定为所述待测试节点对应的目标路径包括:
将所述目标节点所属的路径确定为所述待测试节点对应的候选路径;
若所述候选路径中除所述待测试节点外,存在非Other的父节点,则将距 离所述待测试节点最近的非Other节点到所述待测试节点之间的路径作为目标路径。
本发明实施例中,若Poco树中路径包含的最后一个节点的名称属性与待测试节点的名称属性相同,将该路径确定为候选路径。然后判断候选路径中是否存在除待测试节点外不为Other的父节点。如果存在,则将该父节点作为根节点,将根节点到待测试节点之间的路径作为目标路径。需要说明的是,若除待测试节点外存在多个不为Other的父节点,可以任选其中的一个不为Other的父节点作为根节点,将该父节点作为根节点,将根节点到待测试节点之间的路径作为目标路径。较佳的,可以根据路径最短原则选取距离待测试节点最近的非Other节点作为根节点,将根节点到待测试节点之间的路径作为目标路径。如图2所示,图2中Window节点为候选路径中的根节点,本发明实施例中图2中的非Other节点为父节点,将图2中的非Other节点作为根节点,将非Other节点到待测poco节点之间的路径作为目标路径。使用非Other节点直接向下输出找到待测poco节点的检索路径。
由于本发明实施例中,若Poco树中路径包含的最后一个节点的名称属性与待测试节点的名称属性相同,将该路径确定为候选路径。若候选路径中除待测试节点外,存在不为Other的父节点,则将距离所述待测试节点最近的非Other节点到所述待测试节点之间的路径作为目标路径。减少了目标路径长度,提高了对待测试节点的测试效率。
本发明实施例中,根据所述待测试节点的显示内容和开发所述APP所用的文件中的内容进行比对,完成对所述待测试节点的测试包括:
根据所述待测试节点的显示内容,以及预先设置的显示内容与键值的对应关系,确定所述待测试节点的显示内容对应的目标键值;
确定开发所述APP所用的文件中所述目标键值对应的内容,将所述目标键值对应的内容和所述待测试节点的显示内容进行比对,完成对所述待测试节点的测试。
待测试节点的显示内容一般为待测试节点的显示名称,预先设置有显示 内容与键值的对应关系,例如显示内容“支付”对应的键值为a,“余额”对应的键值为b等等。根据待测试键值的对应关系,确定待测试节点的显示内容对应的目标键值。开发APP所用的文件中每个语种存在对应的键值,并且不同的语种同义表达含义的内容对应的键值是相同的。确定开发APP所用的文件中目标键值对应的内容,例如确定目标键值为a,则确定开发APP所用的文件中目标键值a对应的内容,目标键值a对应的内容中包括各个语种的内容。然后将目标键值对应的内容和待测试节点的显示内容进行比对,若目标键值对应的内容中存在与待测试节点的显示内容相同的内容,则确定对待测试节点测试成功。若目标键值对应的内容中不存在与待测试节点的显示内容相同的内容,则确定对待测试节点测试失败。
为了进一步提高测试效率,本发明实施例中,所述确定开发所述APP所用的文件中所述目标键值对应的内容,将所述目标键值对应的内容和所述待测试节点的显示内容进行比对,完成对所述待测试节点的测试包括:
获取APP当前的语种模式,确定开发所述APP所用的文件中所述目标键值对应的内容中所述语种模式下的内容,若所述语种模式下的内容与所述待测试节点的显示内容相同,则确定所述待测试节点测试成功,若所述语种模式下的内容与所述待测试节点的显示内容不同,则确定所述待测试节点测试失败。
首先获取APP当前的语种模式,例如当前的语种模式为中文。然后确定开发APP所用的文件中目标键值对应的内容中所述语种模式下的内容。以待测试节点显示内容“支付”对应的目标键值为a为例,确定开发APP所用的文件中目标键值a对应的内容中汉语模式下的内容是否为“支付”。如果是,则确定所述待测试节点测试成功,如果否,则确定所述待测试节点测试失败。
由于在本发明实施例中,获取APP当前的语种模式,确定开发所述APP所用的文件中所述目标键值对应的内容中所述语种模式下的内容,若所述语种模式下的内容与所述待测试节点的显示内容相同,则确定所述待测试节点测试成功,若所述语种模式下的内容与所述待测试节点的显示内容不同,则 确定所述待测试节点测试失败。不需要将开发所述APP所用的文件中目标键值对应的所有内容和所述待测试节点的显示内容进行比对,进一步提高了测试效率。
在poco树检索装置中,输出设备中的节点路径path,使用节点name属性打印该节点名称,若名称与待测试节点标准值一致,则路径准确。但此时的路径过长,操作时会占用过多检索时间,继续优化检索路径,除最后一个节点外,若存在不为“Other”的父节点,则直接使用该节点作为根节点,避免因poco节点查找路径过长造成测试效率降低。
运用log Viewer打印path,按照打印路径手动编辑poco树检索路径,如打印路径为[0,0,0,1],则从根节点依次检索index为0的Other节点、index为0的Other节点、index为0的Other节点、index为1的Other节点,并通过节点name属性打印节点名称。
当节点child无法检索到实际value时,需使用offspring输出,如上图所示路径,从根节点依次检索index为0的Other节点、index为0的Other节点、index为0的Other节点、index为1的offspring节点,通过节点name属性打印节点名称。
本发明实施例中,针对需点击但无法通过poco检索装置直接暴露路径的节点(如图片等控件),可按屏幕尺寸计算相邻节点位置,利用可输出路径的相邻节点,触发待测节点的点击事件,所述方法还包括:
根据安装所述APP的设备的屏幕尺寸、所述poco树结构中的每条路径中节点的尺寸以及所述节点与待点击节点的位置关系,确定所述待点击节点在屏幕中的位置,根据所述待点击节点在屏幕中的位置完成对所述待点击节点的点击事件,并进行下一待测试节点的测试。
以图3为例,当待测节点A的路径path无法通过固有path打印方式输出时,可通过附近可输出path的节点B辅助进行查找。使用get_position()获得B节点所在位置占整个屏幕宽度比例propW、高度比例propH,使用get_bounds()获得B节点上右下左所在位置top、right、bottom、left,使用 device().get_current_resolution()输出整个屏幕宽width和高height,从而得到B节点中心的位置(propW*width,propH*height),B的中心位置距B上部边缘距离为(propH-top)*height,从而找到A中轴内任意点击位置(propW*width,top*height-λ),(λ为大于零的较小值)通过click()指令完成A节点点击事件。
在对一个待测试节点测试完成之后,一般可以通过对待点击节点的点击事件,进行到下一待测试节点的测试。
本发明实施例提供的APP测试方法可输出多语言APP内待测poco节点路径,并完成不易输出节点路径组件的点击操作。编制案例脚本可针对每一节点采用最优检索方案,形成一套自动化测试案例集,最终实现iOS端多语言APP的poco树节点自动检索和文案自动核对。
实施例2:
图4为本发明实施例提供的应用APP测试装置结构示意图,该装置包括:
确定模块41,用于确定APP的poco树结构,根据所述APP中的待测试节点,确定所述poco树结构中所述待测试节点对应的目标路径;
测试模块42,用于根据所述目标路径确定所述待测试节点的显示内容,根据所述待测试节点的显示内容和开发所述APP所用的文件中的内容进行比对,完成对所述待测试节点的测试。
所述确定模块41,具体用于确定所述APP中的待测试节点的名称属性,确定所述poco树结构中与所述名称属性相同的目标节点,将所述目标节点所属的路径确定为所述待测试节点对应的目标路径。
所述确定模块41,具体用于将所述目标节点所属的路径确定为所述待测试节点对应的候选路径;若所述候选路径中除所述待测试节点外,存在非Other的父节点,则将距离所述待测试节点最近的非Other节点到所述待测试节点之间的路径作为目标路径。
所述测试模块42,具体用于根据所述待测试节点的显示内容,以及预先设置的显示内容与键值的对应关系,确定所述待测试节点的显示内容对应的 目标键值;确定开发所述APP所用的文件中所述目标键值对应的内容,将所述目标键值对应的内容和所述待测试节点的显示内容进行比对,完成对所述待测试节点的测试。
所述测试模块42,具体用于获取APP当前的语种模式,确定开发所述APP所用的文件中所述目标键值对应的内容中所述语种模式下的内容,若所述语种模式下的内容与所述待测试节点的显示内容相同,则确定所述待测试节点测试成功,若所述语种模式下的内容与所述待测试节点的显示内容不同,则确定所述待测试节点测试失败。
所述测试模块42,还用于根据安装所述APP的设备的屏幕尺寸、所述poco树结构中的每条路径中节点的尺寸以及所述节点与待点击节点的位置关系,确定所述待点击节点在屏幕中的位置,根据所述待点击节点在屏幕中的位置完成对所述待点击节点的点击事件。
实施例3:
在上述各实施例的基础上,本发明实施例中还提供了一种电子设备,如图5所示,包括:处理器301、通信接口302、存储器303和通信总线304,其中,处理器301,通信接口302,存储器303通过通信总线304完成相互间的通信;
所述存储器303中存储有计算机程序,当所述程序被所述处理器301执行时,使得所述处理器301执行如下步骤:
确定APP的poco树结构,根据所述APP中的待测试节点,确定所述poco树结构中所述待测试节点对应的目标路径;
根据所述目标路径确定所述待测试节点的显示内容,根据所述待测试节点的显示内容和开发所述APP所用的文件中的内容进行比对,完成对所述待测试节点的测试。
基于同一发明构思,本发明实施例中还提供了一种电子设备,由于上述电子设备解决问题的原理与APP测试方法相似,因此上述电子设备的实施可以参见方法的实施,重复之处不再赘述。
上述电子设备提到的通信总线可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
通信接口302用于上述电子设备与其他设备之间的通信。
存储器可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。可选地,存储器还可以是至少一个位于远离前述处理器的存储装置。
上述处理器可以是通用处理器,包括中央处理器、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processing,DSP)、专用集成电路、现场可编程门陈列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。
在本发明实施例中处理器执行存储器上所存放的程序时,实现确定APP的poco树结构,根据所述APP中的待测试节点,确定所述poco树结构中所述待测试节点对应的目标路径;根据所述目标路径确定所述待测试节点的显示内容,根据所述待测试节点的显示内容和开发所述APP所用的文件中的内容进行比对,完成对所述待测试节点的测试。
由于在本发明实施例中,对于待测试的APP,首先确定出该APP的poco树结构,并针对APP中待测试节点从poco树结构中确定出待测试节点对应的目标路径。最后根据目标路径确定待测试节点的显示内容,根据待测试节点的显示内容和开发APP所用的文件中的内容进行比对,完成对待测试节点的测试。基于上述方案可以自动完成对各个语种模式下各个节点的测试,避免了人工测试耗费人力资源及成本较大,测试的准确性无法保证以及测试的效率较低的问题。
实施例4:
在上述各实施例的基础上,本发明实施例还提供了一种计算机存储可读 存储介质,所述计算机可读存储介质内存储有可由电子设备执行的计算机程序,当所述程序在所述电子设备上运行时,使得所述电子设备执行时实现如下步骤:
确定APP的poco树结构,根据所述APP中的待测试节点,确定所述poco树结构中所述待测试节点对应的目标路径;
根据所述目标路径确定所述待测试节点的显示内容,根据所述待测试节点的显示内容和开发所述APP所用的文件中的内容进行比对,完成对所述待测试节点的测试。
基于同一发明构思,本发明实施例中还提供了一种计算机可读存储介质,由于处理器在执行上述计算机可读存储介质上存储的计算机程序时解决问题的原理与APP测试方法相似,因此处理器在执行上述计算机可读存储介质存储的计算机程序的实施可以参见方法的实施,重复之处不再赘述。
上述计算机可读存储介质可以是电子设备中的处理器能够存取的任何可用介质或数据存储设备,包括但不限于磁性存储器如软盘、硬盘、磁带、磁光盘(MO)等、光学存储器如CD、DVD、BD、HVD等、以及半导体存储器如ROM、EPROM、EEPROM、非易失性存储器(NAND FLASH)、固态硬盘(SSD)等。
在本发明实施例中提供的计算机可读存储介质内存储计算机程序,计算机程序被处理器执行时实现确定APP的poco树结构,根据所述APP中的待测试节点,确定所述poco树结构中所述待测试节点对应的目标路径;根据所述目标路径确定所述待测试节点的显示内容,根据所述待测试节点的显示内容和开发所述APP所用的文件中的内容进行比对,完成对所述待测试节点的测试。
由于在本发明实施例中,对于待测试的APP,首先确定出该APP的poco树结构,并针对APP中待测试节点从poco树结构中确定出待测试节点对应的目标路径。最后根据目标路径确定待测试节点的显示内容,根据待测试节点的显示内容和开发APP所用的文件中的内容进行比对,完成对待测试节点的 测试。基于上述方案可以自动完成对各个语种模式下各个节点的测试,避免了人工测试耗费人力资源及成本较大,测试的准确性无法保证以及测试的效率较低的问题。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (14)

  1. 一种应用APP测试方法,其特征在于,所述方法包括:
    确定APP的poco树结构,根据所述APP中的待测试节点,确定所述poco树结构中所述待测试节点对应的目标路径;
    根据所述目标路径确定所述待测试节点的显示内容,根据所述待测试节点的显示内容和开发所述APP所用的文件中的内容进行比对,完成对所述待测试节点的测试。
  2. 如权利要求1所述的方法,其特征在于,所述根据所述APP中的待测试节点,确定所述poco树结构中所述待测试节点对应的目标路径包括:
    确定所述APP中的待测试节点的名称属性,确定所述poco树结构中与所述名称属性相同的目标节点,将所述目标节点所属的路径确定为所述待测试节点对应的目标路径。
  3. 如权利要求2所述的方法,其特征在于,将所述目标节点所属的路径确定为所述待测试节点对应的目标路径包括:
    将所述目标节点所属的路径确定为所述待测试节点对应的候选路径;
    若所述候选路径中除所述待测试节点外,存在非Other的父节点,则将距离所述待测试节点最近的非Other节点到所述待测试节点之间的路径作为目标路径。
  4. 如权利要求1所述的方法,其特征在于,根据所述待测试节点的显示内容和开发所述APP所用的文件中的内容进行比对,完成对所述待测试节点的测试包括:
    根据所述待测试节点的显示内容,以及预先设置的显示内容与键值的对应关系,确定所述待测试节点的显示内容对应的目标键值;
    确定开发所述APP所用的文件中所述目标键值对应的内容,将所述目标键值对应的内容和所述待测试节点的显示内容进行比对,完成对所述待测试节点的测试。
  5. 如权利要求4所述的方法,其特征在于,所述确定开发所述APP所用的文件中所述目标键值对应的内容,将所述目标键值对应的内容和所述待测试节点的显示内容进行比对,完成对所述待测试节点的测试包括:
    获取APP当前的语种模式,确定开发所述APP所用的文件中所述目标键值对应的内容中所述语种模式下的内容,若所述语种模式下的内容与所述待测试节点的显示内容相同,则确定所述待测试节点测试成功,若所述语种模式下的内容与所述待测试节点的显示内容不同,则确定所述待测试节点测试失败。
  6. 如权利要求1所述的方法,其特征在于,所述方法还包括:
    根据安装所述APP的设备的屏幕尺寸、所述poco树结构中的每条路径中节点的尺寸以及所述节点与待点击节点的位置关系,确定所述待点击节点在屏幕中的位置,根据所述待点击节点在屏幕中的位置完成对所述待点击节点的点击事件。
  7. 一种应用APP测试装置,其特征在于,所述装置包括:
    确定模块,用于确定APP的poco树结构,根据所述APP中的待测试节点,确定所述poco树结构中所述待测试节点对应的目标路径;
    测试模块,用于根据所述目标路径确定所述待测试节点的显示内容,根据所述待测试节点的显示内容和开发所述APP所用的文件中的内容进行比对,完成对所述待测试节点的测试。
  8. 如权利要求7所述的装置,其特征在于,所述确定模块,具体用于确定所述APP中的待测试节点的名称属性,确定所述poco树结构中与所述名称属性相同的目标节点,将所述目标节点所属的路径确定为所述待测试节点对应的目标路径。
  9. 如权利要求8所述的装置,其特征在于,所述确定模块,具体用于将所述目标节点所属的路径确定为所述待测试节点对应的候选路径;若所述候选路径中除所述待测试节点外,存在非Other的父节点,则将距离所述待测试节点最近的非Other节点到所述待测试节点之间的路径作为目标路径。
  10. 如权利要求7所述的装置,其特征在于,所述测试模块,具体用于根据所述待测试节点的显示内容,以及预先设置的显示内容与键值的对应关系,确定所述待测试节点的显示内容对应的目标键值;确定开发所述APP所用的文件中所述目标键值对应的内容,将所述目标键值对应的内容和所述待测试节点的显示内容进行比对,完成对所述待测试节点的测试。
  11. 如权利要求10所述的装置,其特征在于,所述测试模块,具体用于获取APP当前的语种模式,确定开发所述APP所用的文件中所述目标键值对应的内容中所述语种模式下的内容,若所述语种模式下的内容与所述待测试节点的显示内容相同,则确定所述待测试节点测试成功,若所述语种模式下的内容与所述待测试节点的显示内容不同,则确定所述待测试节点测试失败。
  12. 如权利要求7所述的装置,其特征在于,所述测试模块,还用于根据安装所述APP的设备的屏幕尺寸、所述poco树结构中的每条路径中节点的尺寸以及所述节点与待点击节点的位置关系,确定所述待点击节点在屏幕中的位置,根据所述待点击节点在屏幕中的位置完成对所述待点击节点的点击事件。
  13. 一种电子设备,其特征在于,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;
    存储器,用于存放计算机程序;
    处理器,用于执行存储器上所存放的程序时,实现权利要求1-6任一项所述的方法步骤。
  14. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-6任一项所述的方法步骤。
PCT/CN2022/112600 2021-11-24 2022-08-15 一种应用app测试方法、装置、电子设备及存储介质 WO2023093137A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111407428.4 2021-11-24
CN202111407428.4A CN114020636A (zh) 2021-11-24 2021-11-24 一种应用app测试方法、装置、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2023093137A1 true WO2023093137A1 (zh) 2023-06-01

Family

ID=80066196

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/112600 WO2023093137A1 (zh) 2021-11-24 2022-08-15 一种应用app测试方法、装置、电子设备及存储介质

Country Status (3)

Country Link
CN (1) CN114020636A (zh)
TW (1) TWI822301B (zh)
WO (1) WO2023093137A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114020636A (zh) * 2021-11-24 2022-02-08 中国银联股份有限公司 一种应用app测试方法、装置、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2919132A1 (en) * 2014-03-10 2015-09-16 periplus instruments GmbH & Co. KG Method for automatic generation of test data for testing a data warehouse system
CN111694754A (zh) * 2020-07-30 2020-09-22 北京字节跳动网络技术有限公司 应用程序的测试方法、装置、电子设备及计算机介质
CN112965916A (zh) * 2021-04-09 2021-06-15 中国工商银行股份有限公司 页面测试方法、页面测试装置、电子设备及可读存储介质
CN113268416A (zh) * 2021-05-17 2021-08-17 深圳Tcl新技术有限公司 一种应用程序的测试方法、装置、存储介质及终端
CN114020636A (zh) * 2021-11-24 2022-02-08 中国银联股份有限公司 一种应用app测试方法、装置、电子设备及存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170300402A1 (en) * 2016-04-19 2017-10-19 Sap Se Mock server and extensions for application testing
CN113515443A (zh) * 2021-04-21 2021-10-19 深圳市康冠商用科技有限公司 多国语言自动核对方法、装置、计算机设备及存储介质
CN113111005A (zh) * 2021-05-06 2021-07-13 腾讯科技(深圳)有限公司 应用程序测试方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2919132A1 (en) * 2014-03-10 2015-09-16 periplus instruments GmbH & Co. KG Method for automatic generation of test data for testing a data warehouse system
CN111694754A (zh) * 2020-07-30 2020-09-22 北京字节跳动网络技术有限公司 应用程序的测试方法、装置、电子设备及计算机介质
CN112965916A (zh) * 2021-04-09 2021-06-15 中国工商银行股份有限公司 页面测试方法、页面测试装置、电子设备及可读存储介质
CN113268416A (zh) * 2021-05-17 2021-08-17 深圳Tcl新技术有限公司 一种应用程序的测试方法、装置、存储介质及终端
CN114020636A (zh) * 2021-11-24 2022-02-08 中国银联股份有限公司 一种应用app测试方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
TW202321920A (zh) 2023-06-01
CN114020636A (zh) 2022-02-08
TWI822301B (zh) 2023-11-11

Similar Documents

Publication Publication Date Title
BR112015011537B1 (pt) Método e dispositivo de armazenamento para associação de metadados com código fonte
US10621066B2 (en) Automatic repair of scripts
WO2023093137A1 (zh) 一种应用app测试方法、装置、电子设备及存储介质
CN107451062B (zh) 一种用户界面遍历测试方法、装置、服务器、存储介质
WO2020083367A1 (en) Chip testing method, device, electronic apparatus and computer readable medium
CN110990411B (zh) 数据结构的生成方法及装置、调用方法及装置
US10572371B2 (en) Generating valid use cases from a parsed configuration file describing use case options
TW201207731A (en) Embedded system with plural firmware and firmware updating method thereof
CN110554893B (zh) 软件系统多语言适配方法、装置、设备及可读存储介质
WO2020237508A1 (zh) 一种断言验证代码绑定方法及装置
US11030074B2 (en) Code update based on detection of change in runtime code during debugging
US20160246709A1 (en) Source code unit testing using an indexing tool
US20230315416A1 (en) Code translation method and apparatus, and device
US20230236959A1 (en) Controlled input/output in progress state during testcase processing
US8645902B1 (en) Methods, systems, and computer program products for implementing interactive coloring of physical design components in a physical electronic design with multiple-patterning techniques awareness
US20160085659A1 (en) Base Line for Code Analysis
CN107168719A (zh) 应用程序运行方法、装置、终端及计算机可读存储介质
US20220374345A1 (en) Techniques for similarity determination across software testing configuration data entities
CN106095820A (zh) 一种自动获取地址的方法及系统
CN106874181B (zh) 一种接口转换的验证方法和装置
US20170371998A1 (en) Detecting dispensable inverter chains in a circuit design
CN110765008A (zh) 一种数据处理方法及装置
US20210349808A1 (en) Source quality check service
CN114493360A (zh) 基于rpa和ai的流程创意评估方法、装置、设备及介质
CN112651199A (zh) 质量验证平台和质量验证方法

Legal Events

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

Ref document number: 22897232

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2401000843

Country of ref document: TH