TWI822301B - An application APP testing method, device, electronic equipment and storage medium - Google Patents

An application APP testing method, device, electronic equipment and storage medium Download PDF

Info

Publication number
TWI822301B
TWI822301B TW111133530A TW111133530A TWI822301B TW I822301 B TWI822301 B TW I822301B TW 111133530 A TW111133530 A TW 111133530A TW 111133530 A TW111133530 A TW 111133530A TW I822301 B TWI822301 B TW I822301B
Authority
TW
Taiwan
Prior art keywords
node
tested
app
content
path
Prior art date
Application number
TW111133530A
Other languages
Chinese (zh)
Other versions
TW202321920A (en
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 TW202321920A publication Critical patent/TW202321920A/en
Application granted granted Critical
Publication of TWI822301B publication Critical patent/TWI822301B/en

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

Abstract

本發明公開了一種應用APP測試方法、裝置、電子設備及存儲介質,該方法包括:確定APP的poco樹結構,根據該APP中的待測試節點,確定該poco樹結構中該待測試節點對應的目標路徑;根據該目標路徑確定該待測試節點的顯示內容,根據該待測試節點的顯示內容和開發該APP所用的檔中的內容進行比對,完成對該待測試節點的測試。基於上述方案可以自動完成對各個語種模式下各個節點的測試,避免了人工測試耗費人力資源及成本較大,測試的準確性無法保證以及測試的效率較低的問題。The invention discloses 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 node corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP. Target path; determine the display content of the node to be tested based on 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 solution, the test of each node in each language mode can be automatically completed, avoiding the problems of manual testing that consumes human resources and costs a lot, the accuracy of the test cannot be guaranteed, and the efficiency of the test is low.

Description

一種應用APP測試方法、裝置、電子設備及存儲介質An application APP testing method, device, electronic equipment and storage medium

本發明屬於應用APP測試技術領域,尤其關於一種應用APP測試方法、裝置、電子設備及存儲介質。The present invention belongs to the technical field of application APP testing, and in particular relates to an application APP testing method, device, electronic equipment and storage medium.

為支援推廣境外使用者,需要一套功能完善且具備全球主要語言的應用APP做支撐。APP開發完成後需要對APP進行測試,保障APP在當地語系化運行過程中的準確與高效。In order to support the promotion of overseas users, a set of application APP with complete functions and major global languages is needed to support it. After the APP development is completed, the APP needs to be tested to ensure the accuracy and efficiency of the APP in the local language operation process.

在APP的國際化佈局中,針對主要18種不同國家和地區的語言文案,目前在對APP進行測試時一般是採用人工的方式對APP逐頁逐行逐段進行文案核驗,即將APP中的文案與開發APP所用的檔中的文案進行比對。人工測試存在的問題很明顯,首先由於測試人員對國際多種語言的掌握程度有限,在測試過程中需要進一步瞭解和學習國際多種語言,耗費人力資源及成本較大,並且測試的準確性無法保證。其次針對主要18種不同國家和地區的語言文案進行人工測試,使得APP測試的效率較低。In the international layout of the APP, for the language copywriting of 18 different countries and regions, when testing the APP, manual verification is generally used to verify the copywriting of the APP page by page, line by line, and paragraph by paragraph. That is, the copywriting in the APP Compare it with the copy in the file used to develop the APP. The problems with manual testing are obvious. First of all, because testers have limited mastery of international multiple languages, they need to further understand and learn international multiple languages during the testing process, which consumes a lot of human resources and costs a lot, and the accuracy of the test cannot be guaranteed. Secondly, manual testing is conducted on language copywriting in 18 different countries and regions, making APP testing less efficient.

本發明實施例提供了一種應用APP測試方法、裝置、電子設備及存儲介質,用以解決現有技術人工測試耗費人力資源及成本較大,測試的準確性無法保證以及測試的效率較低的問題。Embodiments of the present invention provide an APP application testing method, device, electronic equipment and storage medium to solve the problems in the prior art that manual testing consumes human resources and costs a lot, the accuracy of the test cannot be guaranteed, and the efficiency of the test is low.

本發明實施例提供了一種應用APP測試方法,該方法包括: 確定APP的poco樹結構,根據該APP中的待測試節點,確定該poco樹結構中該待測試節點對應的目標路徑; 根據該目標路徑確定該待測試節點的顯示內容,根據該待測試節點的顯示內容和開發該APP所用的檔中的內容進行比對,完成對該待測試節點的測試。 The embodiment of the present invention provides an application APP testing method, which method includes: 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 based on the node to be tested in the APP; The display content of the node to be tested is determined according to the target path, and the display content of the node to be tested is compared with the content in the file used to develop the APP to complete the test of the node to be tested.

進一步地,該根據該APP中的待測試節點,確定該poco樹結構中該待測試節點對應的目標路徑包括: 確定該APP中的待測試節點的名稱屬性,確定該poco樹結構中與該名稱屬性相同的目標節點,將該目標節點所屬的路徑確定為該待測試節點對應的目標路徑。 Further, 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: 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 target path corresponding to the node to be tested.

進一步地,將該目標節點所屬的路徑確定為該待測試節點對應的目標路徑包括: 將該目標節點所屬的路徑確定為該待測試節點對應的候選路徑; 若該候選路徑中除該待測試節點外,存在非Other的父節點,則將距離該待測試節點最近的非Other節點到該待測試節點之間的路徑作為目標路徑。 Further, determining the path to which the target node belongs as the target path corresponding to the node to be tested includes: 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 in addition to 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 used as the target path.

進一步地,根據該待測試節點的顯示內容和開發該APP所用的檔中的內容進行比對,完成對該待測試節點的測試包括: 根據該待測試節點的顯示內容,以及預先設置的顯示內容與鍵值的對應關係,確定該待測試節點的顯示內容對應的目標鍵值; 確定開發該APP所用的檔中該目標鍵值對應的內容,將該目標鍵值對應的內容和該待測試節點的顯示內容進行比對,完成對該待測試節點的測試。 Further, based on the comparison between the display content of the node to be tested and the content in the file used to develop the APP, completing the test of the node to be tested includes: According to the display content of the node to be tested and the preset corresponding relationship between the display content and the key value, determine the target key value corresponding to the display content of the node to be tested; Determine the content corresponding to the target key value in the file used to develop the APP, compare the content corresponding to the target key value with the displayed content of the node to be tested, and complete the test of the node to be tested.

進一步地,該確定開發該APP所用的檔中該目標鍵值對應的內容,將該目標鍵值對應的內容和該待測試節點的顯示內容進行比對,完成對該待測試節點的測試包括: 獲取APP當前的語種模式,確定開發該APP所用的檔中該目標鍵值對應的內容中該語種模式下的內容,若該語種模式下的內容與該待測試節點的顯示內容相同,則確定該待測試節點測試成功,若該語種模式下的內容與該待測試節點的顯示內容不同,則確定該待測試節點測試失敗。 Further, 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 test of the node to be tested includes: 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 is the same as the displayed content of the node to be tested, then determine the content. The node to be tested is tested successfully. If the content in the language mode is different from the displayed content of the node to be tested, it is determined that the node to be tested has failed the test.

進一步地,該方法還包括: 根據安裝該APP的設備的螢幕尺寸、該poco樹結構中的每條路徑中節點的尺寸以及該節點與待點擊節點的位置關係,確定該待點擊節點在螢幕中的位置,根據該待點擊節點在螢幕中的位置完成對該待點擊節點的點擊事件。 Further, the method also includes: 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, determine the position of the node to be clicked on the screen, according to the node to be clicked Complete the click event of the node to be clicked at the position on the screen.

另一方面,本發明實施例提供了一種應用APP測試裝置,該裝置包括: 確定模組,用於確定APP的poco樹結構,根據該APP中的待測試節點,確定該poco樹結構中該待測試節點對應的目標路徑; 測試模組,用於根據該目標路徑確定該待測試節點的顯示內容,根據該待測試節點的顯示內容和開發該APP所用的檔中的內容進行比對,完成對該待測試節點的測試。 On the other hand, embodiments of the present invention provide an application APP testing device, which includes: The determination module is used 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 test module is used to determine the display content of the node to be tested according to the target path, and compare the display content of the node to be tested with the content in the file used to develop the APP to complete the test of the node to be tested.

進一步地,該確定模組,具體用於確定該APP中的待測試節點的名稱屬性,確定該poco樹結構中與該名稱屬性相同的目標節點,將該目標節點所屬的路徑確定為該待測試節點對應的目標路徑。Further, the determination module is specifically used to determine the name attribute of the node to be tested in the APP, determine the target node with the same name attribute in the poco tree structure, and determine the path to which the target node belongs to the node to be tested. The target path corresponding to the node.

進一步地,該確定模組,具體用於將該目標節點所屬的路徑確定為該待測試節點對應的候選路徑;若該候選路徑中除該待測試節點外,存在非Other的父節點,則將距離該待測試節點最近的非Other節點到該待測試節點之間的路徑作為目標路徑。Further, the determination module is specifically used to determine the path to which the target node belongs as a candidate path corresponding to the node to be tested; if, in addition to the node to be tested, there is a non-Other parent node in the candidate path, then The path between the non-Other node closest to the node to be tested and the node to be tested is used as the target path.

進一步地,該測試模組,具體用於根據該待測試節點的顯示內容,以及預先設置的顯示內容與鍵值的對應關係,確定該待測試節點的顯示內容對應的目標鍵值;確定開發該APP所用的檔中該目標鍵值對應的內容,將該目標鍵值對應的內容和該待測試節點的顯示內容進行比對,完成對該待測試節點的測試。Further, the test module is specifically used to determine the target key value corresponding to the display content of the node to be tested based on the display content of the node to be tested and the preset correspondence between the display content and the key value; determine to develop the Compare the content corresponding to the target key value in the file used by the APP with the displayed content of the node to be tested to complete the test of the node to be tested.

進一步地,該測試模組,具體用於獲取APP當前的語種模式,確定開發該APP所用的檔中該目標鍵值對應的內容中該語種模式下的內容,若該語種模式下的內容與該待測試節點的顯示內容相同,則確定該待測試節點測試成功,若該語種模式下的內容與該待測試節點的顯示內容不同,則確定該待測試節點測試失敗。Further, the 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 content in the language mode is consistent with the If the displayed content of the node to be tested is the same, it is determined that the node to be tested is tested successfully. If the content in the language mode is different from the displayed content of the node to be tested, it is determined that the node to be tested is tested failed.

進一步地,該測試模組,還用於根據安裝該APP的設備的螢幕尺寸、該poco樹結構中的每條路徑中節點的尺寸以及該節點與待點擊節點的位置關係,確定該待點擊節點在螢幕中的位置,根據該待點擊節點在螢幕中的位置完成對該待點擊節點的點擊事件。Further, the test module is also used to determine the node to be clicked based on the screen size of the device on which the APP is installed, the size of the nodes in each path in the poco tree structure, and the positional relationship between the node and the node to be clicked. According to the position of the node to be clicked on the screen, the click event of the node to be clicked is completed.

另一方面,本發明實施例提供了一種電子設備,包括處理器、通信介面、記憶體和通信匯流排,其中,處理器,通信介面,記憶體通過通信匯流排完成相互間的通信; 記憶體,用於存放電腦程式; 處理器,用於執行記憶體上所存放的程式時,實現上述任一項所述之方法步驟。 On the other hand, embodiments of the present invention provide 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 communication with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement any of the above method steps when executing the program stored in the memory.

另一方面,本發明實施例提供了一種電腦可讀存儲介質,該電腦可讀存儲介質內存儲有電腦程式,該電腦程式被處理器執行時實現上述任一項所述之方法步驟。On the other hand, embodiments of the present invention provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, any one of the above method steps is implemented.

本發明實施例提供了一種應用APP測試方法、裝置、電子設備及存儲介質,該方法包括:確定APP的poco樹結構,根據該APP中的待測試節點,確定該poco樹結構中該待測試節點對應的目標路徑;根據該目標路徑確定該待測試節點的顯示內容,根據該待測試節點的顯示內容和開發該APP所用的檔中的內容進行比對,完成對該待測試節點的測試。Embodiments of the present invention provide an application APP testing method, device, electronic device and storage medium. The method includes: determining the poco tree structure of the APP, and determining the node to be tested in the poco tree structure according to the node to be tested in the APP. Corresponding target path; determine the display content of the node to be tested based on 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.

上述的技術方案具有如下優點或有益效果: 由於在本發明實施例中,對於待測試的APP,首先確定出該APP的poco樹結構,並針對APP中待測試節點從poco樹結構中確定出待測試節點對應的目標路徑。最後根據目標路徑確定待測試節點的顯示內容,根據待測試節點的顯示內容和開發APP所用的檔中的內容進行比對,完成對待測試節點的測試。基於上述方案可以自動完成對各個語種模式下各個節點的測試,避免了人工測試耗費人力資源及成本較大,測試的準確性無法保證以及測試的效率較低的問題。 The above technical solution has the following advantages or beneficial effects: In this embodiment of the present invention, for the APP 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, and compare the display content of the node to be tested with the content in the file used to develop the APP to complete the test of the node to be tested. Based on the above solution, the test of each node in each language mode can be automatically completed, avoiding the problems of manual testing that consumes human resources and costs a lot, the accuracy of the test cannot be guaranteed, and the efficiency of the test is low.

為利 貴審查委員了解本發明之技術特徵、內容與優點及其所能達到之功效,茲將本發明配合附圖及附件,並以實施例之表達形式詳細說明如下,而其中所使用之圖式,其主旨僅為示意及輔助說明書之用,未必為本發明實施後之真實比例與精準配置,故不應就所附之圖式的比例與配置關係解讀、侷限本發明於實際實施上的申請範圍,合先敘明。In order to help the review committee understand the technical features, content and advantages of the present invention and the effects it can achieve, the present invention is described in detail below in the form of embodiments with the accompanying drawings and attachments, and the drawings used therein are , its purpose is only for illustration and auxiliary description, and may not represent the actual proportions and precise configurations after implementation of the present invention. Therefore, the proportions and configuration relationships of the attached drawings should not be interpreted or limited to the actual implementation of the present invention. The scope shall be stated first.

在本發明的描述中,需要理解的是,術語「中心」、「橫向」、「上」、「下」、「左」、「右」、「頂」、「底」、「內」、「外」等指示的方位或位置關係為基於圖式所示的方位或位置關係,僅是為了便於描述本發明和簡化描述,而不是指示或暗示所指的裝置或元件必須具有特定的方位、以特定的方位構造和操作,因此不能理解為對本發明的限制。In the description of the present invention, it should be understood that the terms "center", "lateral", "upper", "lower", "left", "right", "top", "bottom", "inside", " The orientation or positional relationship indicated in the drawings is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description. It does not indicate or imply that the device or component referred to must have a specific orientation. Specific orientations of construction and operation are therefore not to be construed as limitations of the invention.

實施例1: 圖1為本發明實施例提供的應用APP(application)測試過程示意圖,該過程包括以下步驟: S101:確定APP的poco樹結構,根據該APP中的待測試節點,確定該poco樹結構中該待測試節點對應的目標路徑; S102:根據該目標路徑確定該待測試節點的顯示內容,根據該待測試節點的顯示內容和開發該APP所用的檔中的內容進行比對,完成對該待測試節點的測試。 Example 1: Figure 1 is a schematic diagram of the application APP (application) testing process provided by the embodiment of the present invention. The process includes the following steps: S101: 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; 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.

本發明實施例提供的APP測試方法應用於電子設備,本發明實施例主要是針對iOS端的APP的測試方法,電子設備可以是安裝有iOS端的APP的iphone、ipad等設備。The APP testing method provided by the embodiment of the present invention is applied to electronic devices. The embodiment of the present invention is mainly aimed at the testing method of iOS APP. The electronic device can be an iPhone, iPad and other devices with an iOS APP installed.

本發明實施例提供的APP測試方法是一種基於iOS 端國際化APP的poco樹的測試方法。在對APP測試過程中,安卓系統poco節點名稱可與代碼中id綁定查找,而iOS系統沒有類似安卓系統節點id的概念,在進行poco節點查找時要通過在poco樹中一級一級向下查找至待測試節點,且常規測試工具直接映射的iOS端poco樹節點多為“Other”節點,且非“Other”節點名稱會隨iOS系統切換語種而變化,因此全球多語言APP無法通過利用待測試節點名稱的方式查找poco樹節點。需要一種更完備的poco樹節點檢索裝置以滿足全球語言APP測試業務需要。為了解決上述問題,本發明實施例提供了基於iOS端國際多語言APP的poco樹的測試方法,在重點解決國際語言APP多語言文案的測試前提下,兼顧提升測試效率,支持同時進行多機並行測試,保證測試完整性與準確性。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. During the APP testing process, the poco node name of the Android system can be bound to the id in the code to search. However, the iOS system does not have a concept similar to the node ID of the Android system. When searching for the poco node, you must search down level by level in the poco tree. to the node to be tested, and the poco tree nodes on the iOS side directly mapped by conventional testing tools are mostly "Other" nodes, and the names of non-"Other" nodes will change as the iOS system switches languages, so global multi-language APPs cannot pass the test. Find poco tree nodes by node name. A more complete poco tree node retrieval device is needed to meet the needs of global language APP testing business. In order to solve the above problems, embodiments of the present invention provide a testing method based on the poco tree of the international multi-language APP on the iOS side. On the premise of focusing on solving the test of the multi-language copy of the international language APP, it also takes into account the improvement of testing efficiency and supports simultaneous multi-machine parallelization. Test to ensure test completeness and accuracy.

本發明實施例中,針對待測試的APP,首先確定APP的poco樹結構,poco樹結構中包括APP的多條路徑。針對待測試節點,確定poco樹結構中待測試節點對應的目標路徑。根據目標路徑確定待測試節點的顯示內容,根據待測試節點的顯示內容和開發APP所用的檔中的內容進行比對,完成對待測試節點的測試。若比對成功則待測試節點測試成功,若比對失敗則待測試節點測試失敗。In the embodiment of the present invention, for the APP to be tested, the poco tree structure of the APP is first determined, and the poco tree structure includes multiple paths of the APP. For the node to be tested, 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, and compare the display content of the node to be tested with the content in the file used to develop the APP to complete the test of the node to be tested. If the comparison is successful, the test of the node to be tested is successful; if the comparison fails, the test of the node to be tested fails.

本發明實施例通過poco樹結構確定出待測試節點對應的目標路徑,然後根據目標路徑確定待測試節點的顯示內容。進而根據待測試節點的顯示內容對待測試節點進行測試。解決了poco樹中非“Other”節點名稱會隨iOS系統切換語種而變化,影響測試效果的問題。The embodiment of the present invention determines the target path corresponding to the node to be tested through the poco tree structure, and then determines the display content of the node to be tested based on the target path. Then, the node to be tested is tested according to the display content of the node to be tested. Solved the problem that the non-"Other" node names in the poco tree would change when the iOS system switches languages, affecting the test results.

由於在本發明實施例中,對於待測試的APP,首先確定出該APP的poco樹結構,並針對APP中待測試節點從poco樹結構中確定出待測試節點對應的目標路徑。最後根據目標路徑確定待測試節點的顯示內容,根據待測試節點的顯示內容和開發APP所用的檔中的內容進行比對,完成對待測試節點的測試。基於上述方案可以自動完成對各個語種模式下各個節點的測試,避免了人工測試耗費人力資源及成本較大,測試的準確性無法保證以及測試的效率較低的問題。In this embodiment of the present invention, for the APP 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, and compare the display content of the node to be tested with the content in the file used to develop the APP to complete the test of the node to be tested. Based on the above solution, the test of each node in each language mode can be automatically completed, avoiding the problems of manual testing that consumes human resources and costs a lot, the accuracy of the test cannot be guaranteed, and the efficiency of the test is low.

本發明實施例中,該根據該APP中的待測試節點,確定該poco樹結構中該待測試節點對應的目標路徑包括: 確定該APP中的待測試節點的名稱屬性,確定該poco樹結構中與該名稱屬性相同的目標節點,將該目標節點所屬的路徑確定為該待測試節點對應的目標路徑。 In the embodiment of the present invention, 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: 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 target path corresponding to the node to be tested.

Poco樹中每個節點以及待測試節點都包括名稱name屬性,確定APP中的待測試節點的名稱屬性以及Poco樹中每個節點的名稱屬性,通過名稱屬性匹配確定Poco樹中包含與待測試節點的名稱屬性相同的目標節點,將確定出的目標節點所屬的路徑確定為待測試節點對應的目標路徑。Each node in the Poco tree and the node to be tested include the 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. Determine the node contained in the Poco tree and the node to be tested by matching the name attributes. For target nodes with the same name attribute, the path to which the determined target node belongs is determined as the target path corresponding to the node to be tested.

需要說明的是,在寫案例時根據具體的文案來編制測試案例的,所以找到待測試節點之後,確定待測試節點對應的目標路徑,那便捷的方式是利用文案來查找這個節點。所以確定目標路徑時,Poco樹中的路徑的最後一個節點的名稱屬性與要測試文案一致,才確定了目標路徑。It should be noted that when writing a case, the test case is compiled according to the specific copy. Therefore, 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 the node. Therefore, when determining the target path, the name attribute of the last node of the path in the Poco tree is consistent with the copy to be tested, and then the target path is determined.

若Poco樹中路徑包含的最後一個節點的名稱屬性與待測試節點的名稱屬性相同,將該路徑確定為目標路徑。此時確定出的目標路徑較長,包含的節點較多,進行測試時操作時間較長,降低了測試效率。為了優化目標路徑,本發明實施例中,將該目標節點所屬的路徑確定為該待測試節點對應的目標路徑包括: 將該目標節點所屬的路徑確定為該待測試節點對應的候選路徑; 若該候選路徑中除該待測試節點外,存在非Other的父節點,則將距離該待測試節點最近的非Other節點到該待測試節點之間的路徑作為目標路徑。 If the name attribute of the last node contained in the path in the Poco tree is the same as the name attribute of the node to be tested, the path is determined as the target path. At this time, the determined target path is longer and contains more nodes. The operation time during testing is longer, which reduces the testing efficiency. In order to optimize the target path, in the embodiment of the present invention, determining the path to which the target node belongs includes the following steps: 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 in addition to 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 used as the target path.

本發明實施例中,若Poco樹中路徑包含的最後一個節點的名稱屬性與待測試節點的名稱屬性相同,將該路徑確定為候選路徑。然後判斷候選路徑中是否存在除待測試節點外不為Other的父節點。如果存在,則將該父節點作為根節點,將根節點到待測試節點之間的路徑作為目標路徑。需要說明的是,若除待測試節點外存在多個不為Other的父節點,可以任選其中的一個不為Other的父節點作為根節點,將該父節點作為根節點,將根節點到待測試節點之間的路徑作為目標路徑。較佳的,可以根據路徑最短原則選取距離待測試節點最近的非Other節點作為根節點,將根節點到待測試節點之間的路徑作為目標路徑。如圖2所示,圖2中Window節點為候選路徑中的根節點,本發明實施例中圖2中的非Other節點為父節點,將圖2中的非Other節點作為根節點,將非Other節點到待測poco節點之間的路徑作為目標路徑。使用非Other節點直接向下輸出找到待測poco節點的檢索路徑。In the embodiment of the present invention, if the name attribute of the last node contained in the path in the Poco tree is the same as the name attribute of the node to be tested, the path is determined as a candidate path. Then determine whether there is a parent node other than the node to be tested that is not Other in the candidate path. If it exists, the parent node is used as the root node, and the path between the root node and the node to be tested is used as the target path. It should be noted that if there are multiple parent nodes that are not Other in addition to the node to be tested, you can select one of the parent nodes that is not Other as the root node, use the parent node as the root node, and move the root node to the node to be tested. The path between test nodes serves as the target path. Preferably, the non-Other node closest to the node to be tested can be selected as the root node according to the shortest path principle, and the path between the root node and the node to be tested can be used as the target path. As shown in Figure 2, the Window node in Figure 2 is the root node in the candidate path. In the embodiment of the present invention, the non-Other node in Figure 2 is the parent node. The non-Other node in Figure 2 is used as the root node, and 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 the search path to find the poco node to be tested.

由於本發明實施例中,若Poco樹中路徑包含的最後一個節點的名稱屬性與待測試節點的名稱屬性相同,將該路徑確定為候選路徑。若候選路徑中除待測試節點外,存在不為Other的父節點,則將距離該待測試節點最近的非Other節點到該待測試節點之間的路徑作為目標路徑。減少了目標路徑長度,提高了對待測試節點的測試效率。In this embodiment of the present invention, if the name attribute of the last node contained in the path in the Poco tree is the same as the name attribute of the node to be tested, the path is determined as a candidate path. If, in addition to the node to be tested, there is a parent node that is not Other in the candidate path, then the path between the non-Other node closest to the node to be tested and the node to be tested is used as the target path. The target path length is reduced and the testing efficiency of the nodes to be tested is improved.

本發明實施例中,根據該待測試節點的顯示內容和開發該APP所用的檔中的內容進行比對,完成對該待測試節點的測試包括: 根據該待測試節點的顯示內容,以及預先設置的顯示內容與鍵值的對應關係,確定該待測試節點的顯示內容對應的目標鍵值; 確定開發該APP所用的檔中該目標鍵值對應的內容,將該目標鍵值對應的內容和該待測試節點的顯示內容進行比對,完成對該待測試節點的測試。 In the embodiment of the present invention, based on the comparison between the display content of the node to be tested and the content in the file used to develop the APP, completing the test of the node to be tested includes: According to the display content of the node to be tested and the preset corresponding relationship between the display content and the key value, determine the target key value corresponding to the display content of the node to be tested; Determine the content corresponding to the target key value in the file used to develop the APP, compare the content corresponding to the target key value with the displayed content of the node to be tested, and complete the test of the node to be tested.

待測試節點的顯示內容一般為待測試節點的顯示名稱,預先設置有顯示內容與鍵值的對應關係,例如顯示內容“支付”對應的鍵值為a,“餘額”對應的鍵值為b等等。根據待測試鍵值的對應關係,確定待測試節點的顯示內容對應的目標鍵值。開發APP所用的檔中每個語種存在對應的鍵值,並且不同的語種同義表達含義的內容對應的鍵值是相同的。確定開發APP所用的檔中目標鍵值對應的內容,例如確定目標鍵值為a,則確定開發APP所用的檔中目標鍵值a對應的內容,目標鍵值a對應的內容中包括各個語種的內容。然後將目標鍵值對應的內容和待測試節點的顯示內容進行比對,若目標鍵值對應的內容中存在與待測試節點的顯示內容相同的內容,則確定對待測試節點測試成功。若目標鍵值對應的內容中不存在與待測試節點的顯示內容相同的內容,則確定對待測試節點測試失敗。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, the key value corresponding to "balance" is b, etc. wait. According to the corresponding relationship between the key values to be tested, the target key value corresponding to the display content of the node to be tested is determined. There are corresponding key values for each language in the files used to develop the APP, and the key values corresponding to the content that synonymously expresses meaning in different languages are the same. Determine the content corresponding to the target key value in the file used to develop the APP. For example, if the target key value is determined to be a, then determine the content corresponding to the target key value a in the file used to develop the APP. The content corresponding to the target key value a includes the content of each language. content. Then the content corresponding to the target key value is compared with the displayed content of the node to be tested. If the content corresponding to the target key value contains 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 is successful. If the content corresponding to the target key value does not contain 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 has failed.

為了進一步提高測試效率,本發明實施例中,該確定開發該APP所用的檔中該目標鍵值對應的內容,將該目標鍵值對應的內容和該待測試節點的顯示內容進行比對,完成對該待測試節點的測試包括: 獲取APP當前的語種模式,確定開發該APP所用的檔中該目標鍵值對應的內容中該語種模式下的內容,若該語種模式下的內容與該待測試節點的顯示內容相同,則確定該待測試節點測試成功,若該語種模式下的內容與該待測試節點的顯示內容不同,則確定該待測試節點測試失敗。 In order to further improve the testing efficiency, in the embodiment of the present invention, the content corresponding to the target key value in the file used to develop the APP is determined, and the content corresponding to the target key value is compared with the display content of the node to be tested to complete Tests for the node to be tested include: 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 is the same as the displayed content of the node to be tested, then determine the content. The node to be tested is tested successfully. If the content in the language mode is different from the displayed content of the node to be tested, it is determined that the node to be tested has failed the test.

首先獲取APP當前的語種模式,例如當前的語種模式為中文。然後確定開發APP所用的檔中目標鍵值對應的內容中該語種模式下的內容。以待測試節點顯示內容“支付”對應的目標鍵值為a為例,確定開發APP所用的檔中目標鍵值a對應的內容中漢語模式下的內容是否為“支付”。如果是,則確定該待測試節點測試成功,如果否,則確定該待測試節點測試失敗。First, obtain the current language mode of the APP. For example, the current language mode is Chinese. Then determine the content in the language mode 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 on the node to be tested as an example, determine whether the content corresponding to the target key value a in the file used to develop the APP in Chinese mode is "payment". If yes, it is determined that the test of the node to be tested is successful; if not, it is determined that the test of the node to be tested is failed.

由於在本發明實施例中,獲取APP當前的語種模式,確定開發該APP所用的檔中該目標鍵值對應的內容中該語種模式下的內容,若該語種模式下的內容與該待測試節點的顯示內容相同,則確定該待測試節點測試成功,若該語種模式下的內容與該待測試節點的顯示內容不同,則確定該待測試節點測試失敗。不需要將開發該APP所用的檔中目標鍵值對應的所有內容和該待測試節點的顯示內容進行比對,進一步提高了測試效率。In the embodiment of the present invention, the current language mode of the APP is obtained, and the content in the language mode among 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 consistent with the node to be tested, If the content displayed in the language mode is different from the displayed content of the node to be tested, it is determined that the node to be tested has failed the test. There is no need to compare all content corresponding to the target key value in the file used to develop the APP with the displayed content of the node to be tested, which further improves testing efficiency.

在poco樹檢索裝置中,輸出設備中的節點路徑path,使用節點name屬性列印該節點名稱,若名稱與待測試節點標準值一致,則路徑準確。但此時的路徑過長,操作時會佔用過多檢索時間,繼續優化檢索路徑,除最後一個節點外,若存在不為“Other”的父節點,則直接使用該節點作為根節點,避免因poco節點查找路徑過長造成測試效率降低。In the poco tree retrieval device, output the node path path in the device, and use the node name attribute to print the node name. If the name is consistent with the standard value of the node to be tested, the path is accurate. However, the path at this time is too long and will take up too much retrieval time during the operation. Continue to optimize the retrieval path. Except for the last node, if there is a parent node that is not "Other", use the node directly as the root node to avoid poco The node search path is too long, which reduces the test efficiency.

運用log Viewer列印path,按照列印路徑手動編輯poco樹檢索路徑,如列印路徑為[0,0,0,1],則從根節點依次檢索index為0的Other節點、index為0的Other節點、index為0的Other節點、index為1的Other節點,並通過節點name屬性列印節點名稱。Use log Viewer to print the path, and manually edit the poco tree search path according to the printing path. For example, if the printing path is [0, 0, 0, 1], then search the Other node with index 0 and the Other node with index 0 in sequence from the root node. Other node, Other node with index 0, Other node with index 1, and print the node name through the node name attribute.

當節點child無法檢索到實際value時,需使用offspring輸出,如上圖所示路徑,從根節點依次檢索index為0的Other節點、index為0的Other節點、index為0的Other節點、index為1的offspring節點,通過節點name屬性列印節點名稱。When the actual value of the node child cannot be retrieved, offspring output needs to be used. As shown in the path above, retrieve the Other node with index 0, the Other node with index 0, the Other node with index 0, and the index 1 in order from the root node. The offspring node prints the node name through the node name attribute.

本發明實施例中,針對需點擊但無法通過poco檢索裝置直接暴露路徑的節點(如圖片等控制項),可按螢幕尺寸計算相鄰節點位置,利用可輸出路徑的相鄰節點,觸發待測節點的點擊事件,該方法還包括: 根據安裝該APP的設備的螢幕尺寸、該poco樹結構中的每條路徑中節點的尺寸以及該節點與待點擊節點的位置關係,確定該待點擊節點在螢幕中的位置,根據該待點擊節點在螢幕中的位置完成對該待點擊節點的點擊事件,並進行下一待測試節點的測試。 In the embodiment of the present invention, for nodes that need to be clicked but cannot directly expose the path through the poco retrieval device (such as pictures and other control items), the position of the adjacent node can be calculated according to the screen size, and the adjacent node that can output the path is used to trigger the test The click event of the node, this method also includes: 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, determine the position of the node to be clicked on the screen, according to the node to be clicked Complete the click event of the node to be clicked at the position on the screen, and test the next node to be tested.

以圖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節點點擊事件。Taking Figure 3 as an example, when the path of the node A to be tested cannot be output through the inherent path printing method, the search can be assisted by the nearby node B that can output the path. Use get_position() to obtain the proportion of the width of the entire screen propW and the height proportion of the B node, propH, use get_bounds() to obtain the top, right, bottom, and left positions of the top, right, bottom, and left of the B node, and use device().get_current_resolution() to output The width and height of the entire screen are used to obtain the position of the center of node B (propW*width, propH*height). The distance between the center of B and the upper edge of B is (propH-top)*height, so as to find any click within the central axis of A. Position (propW*width, top*height - λ), (λ is a smaller value greater than zero) complete the A node click event through the click() instruction.

在對一個待測試節點測試完成之後,一般可以通過對待點擊節點的點擊事件,進行到下一待測試節點的測試。After testing a node to be tested, you can generally proceed to test the next node to be tested through the click event of the node to be clicked.

本發明實施例提供的APP測試方法可輸出多語言APP內待測poco節點路徑,並完成不易輸出節點路徑元件的點擊操作。編制案例腳本可針對每一節點採用最優檢索方案,形成一套自動化測試案例集,最終實現iOS端多語言APP的poco樹節點自動檢索和文案自動核對。The APP testing method provided by the embodiment of the present invention can output the poco node path to be tested in the multi-language APP, and complete the click operation of the node path element that is difficult to output. Compiling case scripts can use the optimal retrieval solution for each node to form a set of automated test cases, and ultimately achieve automatic retrieval of poco tree nodes and automatic verification of copywriting for multi-language iOS APPs.

實施例2: 圖4為本發明實施例提供的應用APP測試裝置結構示意圖,該裝置包括: 確定模組41,用於確定APP的poco樹結構,根據該APP中的待測試節點,確定該poco樹結構中該待測試節點對應的目標路徑; 測試模組42,用於根據該目標路徑確定該待測試節點的顯示內容,根據該待測試節點的顯示內容和開發該APP所用的檔中的內容進行比對,完成對該待測試節點的測試。 Example 2: Figure 4 is a schematic structural diagram of an application APP testing device provided by an embodiment of the present invention. The device includes: The determination module 41 is used 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 test module 42 is used to determine the display content of the node to be tested according to the target path, and compare the display content of the node to be tested with the content in the file used to develop the APP to complete the test of the node to be tested. .

該確定模組41,具體用於確定該APP中的待測試節點的名稱屬性,確定該poco樹結構中與該名稱屬性相同的目標節點,將該目標節點所屬的路徑確定為該待測試節點對應的目標路徑。The determination module 41 is specifically used to determine the name attribute of the node to be tested in the APP, determine the target node in the poco tree structure that has the same name attribute, and determine the path to which the target node belongs corresponding to the node to be tested. target path.

該確定模組41,具體用於將該目標節點所屬的路徑確定為該待測試節點對應的候選路徑;若該候選路徑中除該待測試節點外,存在非Other的父節點,則將距離該待測試節點最近的非Other節點到該待測試節點之間的路徑作為目標路徑。The determination module 41 is specifically used to determine the path to which the target node belongs as a candidate path corresponding to the node to be tested; if, in addition to the node to be tested, there is a non-Other parent node in the candidate path, then the distance to the node to be tested will be determined. The path between the nearest non-Other node of the node to be tested and the node to be tested is used as the target path.

該測試模組42,具體用於根據該待測試節點的顯示內容,以及預先設置的顯示內容與鍵值的對應關係,確定該待測試節點的顯示內容對應的目標鍵值;確定開發該APP所用的檔中該目標鍵值對應的內容,將該目標鍵值對應的內容和該待測試節點的顯示內容進行比對,完成對該待測試節點的測試。The test module 42 is specifically used to determine the target key value corresponding to the display content of the node to be tested based on the display content of the node to be tested and the preset corresponding relationship between the display content and the key value; determine the target key value used to develop the APP The content corresponding to the target key value in the file is compared with the displayed content of the node to be tested to complete the test of the node to be tested.

該測試模組42,具體用於獲取APP當前的語種模式,確定開發該APP所用的檔中該目標鍵值對應的內容中該語種模式下的內容,若該語種模式下的內容與該待測試節點的顯示內容相同,則確定該待測試節點測試成功,若該語種模式下的內容與該待測試節點的顯示內容不同,則確定該待測試節點測試失敗。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 is consistent with the content to be tested If the displayed content of the node 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 is failed.

該測試模組42,還用於根據安裝該APP的設備的螢幕尺寸、該poco樹結構中的每條路徑中節點的尺寸以及該節點與待點擊節點的位置關係,確定該待點擊節點在螢幕中的位置,根據該待點擊節點在螢幕中的位置完成對該待點擊節點的點擊事件。The test module 42 is also used to determine the position of the node to be clicked on the screen based on 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 click event of the node to be clicked is completed based on the position of the node to be clicked on the screen.

實施例3: 在上述各實施例的基礎上,本發明實施例中還提供了一種電子設備,如圖5所示,包括:處理器301、通信介面302、記憶體303和通信匯流排304,其中,處理器301,通信介面302,記憶體303通過通信匯流排304完成相互間的通信; 該記憶體303中存儲有電腦程式,當該程式被該處理器301執行時,使得該處理器301執行如下步驟: 確定APP的poco樹結構,根據該APP中的待測試節點,確定該poco樹結構中該待測試節點對應的目標路徑; 根據該目標路徑確定該待測試節點的顯示內容,根據該待測試節點的顯示內容和開發該APP所用的檔中的內容進行比對,完成對該待測試節點的測試。 Example 3: On the basis of the above embodiments, the embodiment of the present invention also provides an electronic device, as shown in Figure 5, including: a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301. The communication interface 302 and the memory 303 complete communication with each other through the communication bus 304; The memory 303 stores a computer program. When the program is executed by the processor 301, the processor 301 performs the following steps: 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 based on the node to be tested in the APP; The display content of the node to be tested is determined according to the target path, and the display content of the node to be tested is compared with the content in the file used to develop the APP to complete the test of the node to be tested.

基於同一發明構思,本發明實施例中還提供了一種電子設備,由於上述電子設備解決問題的原理與APP測試方法相似,因此上述電子設備的實施可以參見方法的實施,重複之處不再贅述。Based on the same inventive concept, embodiments of the present invention also provide an electronic device. Since the principle of solving problems of the above-mentioned electronic device is similar to that of the APP testing method, the implementation of the above-mentioned electronic device can be referred to the implementation of the method, and repeated details will not be repeated.

上述電子設備提到的通信匯流排可以是外設部件互連標準(Peripheral Component Interconnect,PCI)匯流排或延伸工業標準架構(Extended Industry Standard Architecture,EISA)匯流排等。該通信匯流排可以分為位址匯流排、資料匯流排、控制匯流排等。為便於表示,圖中僅用一條粗線表示,但並不表示僅有一根匯流排或一種類型的匯流排。The communication bus mentioned in the above-mentioned electronic equipment may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, 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.

通信介面302用於上述電子設備與其他設備之間的通信。The communication interface 302 is used for communication between the above-mentioned electronic device and other devices.

記憶體可以包括隨機存取記憶體(Random Access Memory,RAM),也可以包括非揮發性記憶體(Non-Volatile Memory,NVM),例如至少一個磁碟記憶體。可選地,記憶體還可以是至少一個位於遠離前述處理器的存儲裝置。The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far away from the aforementioned processor.

上述處理器可以是通用處理器,包括中央處理器、網路處理器(Network Processor,NP)等;還可以是數位訊號處理器(Digital Signal Processing,DSP)、專用積體電路、現場可程式設計門陳列或者其他可程式設計邏輯器件、分立門或者電晶體邏輯器件、分立硬體元件等。The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it can also be a digital signal processor (Digital Signal Processing, DSP), a special integrated circuit, or field programmable Gate array or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

在本發明實施例中處理器執行記憶體上所存放的程式時,實現確定APP的poco樹結構,根據該APP中的待測試節點,確定該poco樹結構中該待測試節點對應的目標路徑;根據該目標路徑確定該待測試節點的顯示內容,根據該待測試節點的顯示內容和開發該APP所用的檔中的內容進行比對,完成對該待測試節點的測試。In the embodiment of the present invention, when the processor executes the program stored in the memory, the poco tree structure of the APP is determined, and the target path corresponding to the node to be tested in the poco tree structure is determined according to the node to be tested in the APP; The display content of the node to be tested is determined according to the target path, and the display content of the node to be tested is compared with the content in the file used to develop the APP to complete the test of the node to be tested.

由於在本發明實施例中,對於待測試的APP,首先確定出該APP的poco樹結構,並針對APP中待測試節點從poco樹結構中確定出待測試節點對應的目標路徑。最後根據目標路徑確定待測試節點的顯示內容,根據待測試節點的顯示內容和開發APP所用的檔中的內容進行比對,完成對待測試節點的測試。基於上述方案可以自動完成對各個語種模式下各個節點的測試,避免了人工測試耗費人力資源及成本較大,測試的準確性無法保證以及測試的效率較低的問題。In this embodiment of the present invention, for the APP 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, and compare the display content of the node to be tested with the content in the file used to develop the APP to complete the test of the node to be tested. Based on the above solution, the test of each node in each language mode can be automatically completed, avoiding the problems of manual testing that consumes human resources and costs a lot, the accuracy of the test cannot be guaranteed, and the efficiency of the test is low.

實施例4: 在上述各實施例的基礎上,本發明實施例還提供了一種電腦存儲可讀存儲介質,該電腦可讀存儲介質內存儲有可由電子設備執行的電腦程式,當該程式在該電子設備上運行時,使得該電子設備執行時實現如下步驟: 確定APP的poco樹結構,根據該APP中的待測試節點,確定該poco樹結構中該待測試節點對應的目標路徑; 根據該目標路徑確定該待測試節點的顯示內容,根據該待測試節點的顯示內容和開發該APP所用的檔中的內容進行比對,完成對該待測試節點的測試。 Example 4: On the basis of the above embodiments, embodiments of the present invention also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program that can be executed by an electronic device. When the program is run on the electronic device, When, the electronic device implements the following steps when executing: 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 based on the node to be tested in the APP; The display content of the node to be tested is determined according to the target path, and the display content of the node to be tested is compared with the content in the file used to develop the APP to complete the test of the node to be tested.

基於同一發明構思,本發明實施例中還提供了一種電腦可讀存儲介質,由於處理器在執行上述電腦可讀存儲介質上存儲的電腦程式時解決問題的原理與APP測試方法相似,因此處理器在執行上述電腦可讀存儲介質存儲的電腦程式的實施可以參見方法的實施,重複之處不再贅述。Based on the same inventive concept, embodiments of the present invention also provide 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 processor For the implementation of the computer program stored in the computer-readable storage medium, please refer to the implementation of the method, and repeated details will not be repeated.

上述電腦可讀存儲介質可以是電子設備中的處理器能夠存取的任何可用介質或資料存放裝置,包括但不限於磁性記憶體如軟碟、硬碟、磁帶、磁光碟(MO)等、光學記憶體如CD、DVD、BD、HVD等、以及半導體記憶體如ROM、EPROM、EEPROM、非揮發性記憶體(NAND FLASH)、固態硬碟(SSD)等。The above-mentioned computer-readable storage media can be any available media or data storage devices that can be accessed by the processor in the electronic device, including but not limited to magnetic memories such as floppy disks, hard disks, tapes, magneto-optical disks (MO), etc., optical Memory such as CD, DVD, BD, HVD, etc., and semiconductor memory such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid state drive (SSD), etc.

在本發明實施例中提供的電腦可讀存儲介質內存儲電腦程式,電腦程式被處理器執行時實現確定APP的poco樹結構,根據該APP中的待測試節點,確定該poco樹結構中該待測試節點對應的目標路徑;根據該目標路徑確定該待測試節點的顯示內容,根據該待測試節點的顯示內容和開發該APP所用的檔中的內容進行比對,完成對該待測試節點的測試。A computer program is stored in the computer-readable storage medium provided in the embodiment of the present invention. When the computer program is executed by the processor, the poco tree structure of the APP is determined. According to the node to be tested in the APP, the poco tree structure to be tested is determined. The target path corresponding to the test node; determine the display content of the node to be tested based on the target path, and compare the display content of the node to be tested with the content in the file used to develop the APP to complete the test of the node to be tested .

由於在本發明實施例中,對於待測試的APP,首先確定出該APP的poco樹結構,並針對APP中待測試節點從poco樹結構中確定出待測試節點對應的目標路徑。最後根據目標路徑確定待測試節點的顯示內容,根據待測試節點的顯示內容和開發APP所用的檔中的內容進行比對,完成對待測試節點的測試。基於上述方案可以自動完成對各個語種模式下各個節點的測試,避免了人工測試耗費人力資源及成本較大,測試的準確性無法保證以及測試的效率較低的問題。In this embodiment of the present invention, for the APP 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, and compare the display content of the node to be tested with the content in the file used to develop the APP to complete the test of the node to be tested. Based on the above solution, the test of each node in each language mode can be automatically completed, avoiding the problems of manual testing that consumes human resources and costs a lot, the accuracy of the test cannot be guaranteed, and the efficiency of the test is low.

本發明是參照根據本發明實施例的方法、設備(系統)、和電腦程式產品的流程圖和/或方框圖來描述的。應理解可由電腦程式指令實現流程圖和/或方框圖中的每一流程和/或方框、以及流程圖和/或方框圖中的流程和/或方框的結合。可提供這些電腦程式指令到通用電腦、專用電腦、嵌入式處理機或其他可程式設計資料處理設備的處理器以產生一個機器,使得通過電腦或其他可程式設計資料處理設備的處理器執行的指令產生用於實現在流程圖一個流程或多個流程和/或方框圖一個方框或多個方框中指定的功能的裝置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine that causes instructions to be executed by the processor of the computer or other programmable data processing device. Means are generated for implementing the functions specified in the process or processes of the flowchart diagram and/or the block or blocks of the block diagram.

這些電腦程式指令也可存儲在能引導電腦或其他可程式設計資料處理設備以特定方式工作的電腦可讀記憶體中,使得存儲在該電腦可讀記憶體中的指令產生包括指令裝置的製造品,該指令裝置實現在流程圖一個流程或多個流程和/或方框圖一個方框或多個方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. , the instruction device implements the functions specified in one process or multiple processes in the flow chart and/or one block or multiple blocks in the block diagram.

這些電腦程式指令也可裝載到電腦或其他可程式設計資料處理設備上,使得在電腦或其他可程式設計設備上執行一系列操作步驟以產生電腦實現的處理,從而在電腦或其他可程式設計設備上執行的指令提供用於實現在流程圖一個流程或多個流程和/或方框圖一個方框或多個方框中指定的功能的步驟。These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby causing the computer or other programmable device to perform a computer-implemented process. The instructions executed on provide steps for implementing the functions specified in a process or processes of the flow diagrams and/or a block or blocks of the block diagrams.

以上僅為本發明之較佳實施例,並非用來限定本發明之實施範圍,如果不脫離本發明之精神和範圍,對本發明進行修改或者等同替換,均應涵蓋在本發明申請專利範圍的保護範圍當中。The above are only preferred embodiments of the present invention and are not intended to limit the implementation scope of the present invention. If the present invention is modified or equivalently substituted without departing from the spirit and scope of the present invention, the protection shall be covered by the patent scope of the present invention. within the range.

S101-S102:步驟 301:處理器 302:通信介面 303:記憶體 304:通信匯流排 41:確定模組 42:測試模組 S101-S102: Steps 301: Processor 302: Communication interface 303:Memory 304: Communication bus 41: Confirm the module 42:Test module

圖1為本發明實施例提供的應用APP測試過程示意圖; 圖2為本發明實施例提供的確定目標路徑示意圖; 圖3為本發明實施例提供的確定待點擊節點示意圖; 圖4為本發明實施例提供的應用APP測試裝置結構示意圖; 圖5為本發明實施例提供的電子設備結構示意圖。 Figure 1 is a schematic diagram of the application APP testing process provided by the embodiment of the present invention; Figure 2 is a schematic diagram of determining a target path provided by an embodiment of the present invention; Figure 3 is a schematic diagram of determining the node to be clicked according to an embodiment of the present invention; Figure 4 is a schematic structural diagram of an application APP testing device provided by an embodiment of the present invention; Figure 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.

S101-S102:步驟 S101-S102: Steps

Claims (12)

一種應用APP測試方法,該方法包括:確定APP的poco樹結構,根據該APP中的待測試節點,確定該poco樹結構中該待測試節點對應的目標路徑;根據該目標路徑確定該待測試節點的顯示內容,根據該待測試節點的顯示內容和開發該APP所用的檔中的內容進行比對,完成對該待測試節點的測試;該根據該APP中的待測試節點,確定該poco樹結構中該待測試節點對應的目標路徑包括:確定該APP中的待測試節點的名稱屬性,確定該poco樹結構中與該名稱屬性相同的目標節點,將該目標節點所屬的路徑確定為該待測試節點對應的目標路徑。 An application APP testing method, the method includes: determining the poco tree structure of the APP, 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; determining the node to be tested based on the target path The display content of the node to be tested is compared with the content in the file used to develop the APP to complete the test of the node to be tested; the poco tree structure is determined based on the node to be tested in the APP. The target path corresponding to the node to be tested includes: determining the name attribute of the node to be tested in the APP, determining the target node with the same name attribute in the poco tree structure, and determining the path to which the target node belongs to the node to be tested. The target path corresponding to the node. 如請求項1所述之應用APP測試方法,將該目標節點所屬的路徑確定為該待測試節點對應的目標路徑包括:將該目標節點所屬的路徑確定為該待測試節點對應的候選路徑;若該候選路徑中除該待測試節點外,存在非Other的父節點,則將距離該待測試節點最近的非Other節點到該待測試節點之間的路徑作為目標路徑。 Applying the APP testing method as described in request item 1, determining the path to which the target node belongs as the target path corresponding to the node to be tested includes: determining the path to which the target node belongs to the candidate path corresponding to the node to be tested; if In addition to the node to be tested, if there is a non-Other parent node in the candidate path, the path between the non-Other node closest to the node to be tested and the node to be tested is used as the target path. 如請求項1所述之應用APP測試方法,根據該待測試節點的顯示內容和開發該APP所用的檔中的內容進行比對,完成對該待測試節點的測試包括:根據該待測試節點的顯示內容,以及預先設置的顯示內容與鍵值 的對應關係,確定該待測試節點的顯示內容對應的目標鍵值;確定開發該APP所用的檔中該目標鍵值對應的內容,將該目標鍵值對應的內容和該待測試節點的顯示內容進行比對,完成對該待測試節點的測試。 Apply the APP testing method as described in request item 1, 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 including: according to the node to be tested Display content, as well as preset display content and key values The corresponding relationship, determine the target key value corresponding to the display content of the node to be tested; determine the content corresponding to the target key value in the file used to develop the APP, and combine the content corresponding to the target key value and the display content of the node to be tested Compare and complete the test of the node to be tested. 如請求項3所述之應用APP測試方法,該確定開發該APP所用的檔中該目標鍵值對應的內容,將該目標鍵值對應的內容和該待測試節點的顯示內容進行比對,完成對該待測試節點的測試包括:獲取APP當前的語種模式,確定開發該APP所用的檔中該目標鍵值對應的內容中該語種模式下的內容,若該語種模式下的內容與該待測試節點的顯示內容相同,則確定該待測試節點測試成功,若該語種模式下的內容與該待測試節點的顯示內容不同,則確定該待測試節點測試失敗。 According to the application APP testing method described in request item 3, the content corresponding to the target key value in the file used to develop the APP is determined, and the content corresponding to the target key value is compared with the display content of the node to be tested, and the completion The test of the node to be tested includes: obtaining the current language mode of the APP, determining the content in the language mode 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 content to be tested If the displayed content of the node 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 is failed. 如請求項1所述之應用APP測試方法,該方法還包括:根據安裝該APP的設備的螢幕尺寸、該poco樹結構中的每條路徑中節點的尺寸以及該節點與待點擊節點的位置關係,確定該待點擊節點在螢幕中的位置,根據該待點擊節點在螢幕中的位置完成對該待點擊節點的點擊事件。 Apply the APP testing method as described in request item 1, which method also includes: based on 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. , determine the position of the node to be clicked on the screen, and complete the click event on the node to be clicked based on the position of the node to be clicked on the screen. 一種應用APP測試裝置,該裝置包括:確定模組,用於確定APP的poco樹結構,根據該APP中的待測試節點,確定該poco樹結構中該待測試節點對應的目標路徑;測試模組,用於根據該目標路徑確定該待測試節點的顯示內容,根據該待測試節點的顯示內容和開發該APP所用的檔中的內容進 行比對,完成對該待測試節點的測試;該確定模組,具體用於確定該APP中的待測試節點的名稱屬性,確定該poco樹結構中與該名稱屬性相同的目標節點,將該目標節點所屬的路徑確定為該待測試節點對應的目標路徑。 An application APP testing device, the device includes: a determination module, used 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 test module , used to determine the display content of the node to be tested based on the target path, and perform the process based on the displayed content of the node to be tested and the content in the file used to develop the APP. Line comparison is completed to complete the test of the node to be tested; the determination module is specifically used 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 convert the The path to which the target node belongs is determined as the target path corresponding to the node to be tested. 如請求項6所述之應用APP測試裝置,該確定模組,具體用於將該目標節點所屬的路徑確定為該待測試節點對應的候選路徑;若該候選路徑中除該待測試節點外,存在非Other的父節點,則將距離該待測試節點最近的非Other節點到該待測試節點之間的路徑作為目標路徑。 In the application APP testing device described in claim 6, the determination module is specifically used to determine the path to which the target node belongs as a candidate path corresponding to the node to be tested; if the candidate path except the node to be tested, If there is a non-Other parent node, the path between the non-Other node closest to the node to be tested and the node to be tested is used as the target path. 如請求項6所述之應用APP測試裝置,該測試模組,具體用於根據該待測試節點的顯示內容,以及預先設置的顯示內容與鍵值的對應關係,確定該待測試節點的顯示內容對應的目標鍵值;確定開發該APP所用的檔中該目標鍵值對應的內容,將該目標鍵值對應的內容和該待測試節點的顯示內容進行比對,完成對該待測試節點的測試。 Apply the APP testing device as described in request item 6. The test module is specifically used to determine the display content of the node to be tested based on the display content of the node to be tested and the corresponding relationship between the preset display content and the key value. The corresponding target key value; determine the content corresponding to the target key value in the file used to develop the APP, compare the content corresponding to the target key value and the displayed content of the node to be tested, and complete the test of the node to be tested. . 如請求項8所述之應用APP測試裝置,該測試模組,具體用於獲取APP當前的語種模式,確定開發該APP所用的檔中該目標鍵值對應的內容中該語種模式下的內容,若該語種模式下的內容與該待測試節點的顯示內容相同,則確定該待測試節點測試成功,若該語種模式下的內容與該待測試節點的顯示內容不同,則確定該待測試節點測試失敗。 As for the application APP testing device described in request item 8, the test module is specifically used to obtain the current language mode of the APP and determine the content in the language mode of the content corresponding to the target key value in the file used to develop the APP, If the content in the language mode is the same as the displayed content of the node to be tested, it is determined that the node to be tested is tested successfully. If the content in the language mode is different from the displayed content of the node to be tested, it is determined that the node to be tested is tested. Fail. 如請求項6所述之應用APP測試裝置,該測試模組,還用於根 據安裝該APP的設備的螢幕尺寸、該poco樹結構中的每條路徑中節點的尺寸以及該節點與待點擊節點的位置關係,確定該待點擊節點在螢幕中的位置,根據該待點擊節點在螢幕中的位置完成對該待點擊節點的點擊事件。 As described in request 6, the application APP test device, the test module is also used for rooting 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, determine the position of the node to be clicked on the screen, and based on the node to be clicked Complete the click event of the node to be clicked at the position on the screen. 一種電子設備,包括處理器、通信介面、記憶體和通信匯流排,其中,處理器,通信介面,記憶體通過通信匯流排完成相互間的通信;記憶體,用於存放電腦程式;處理器,用於執行記憶體上所存放的程式時,實現如請求項1至5中任一項所述之應用APP測試方法步驟。 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 communication with each other through the communication bus; the memory is used to store computer programs; the processor, It is used to implement the application APP testing method steps described in any one of claims 1 to 5 when executing a program stored in the memory. 一種電腦可讀存儲介質,該電腦可讀存儲介質內存儲有電腦程式,該電腦程式被處理器執行時實現如請求項1至5中任一項所述之應用APP測試方法步驟。 A computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the application APP testing method steps described in any one of claims 1 to 5 are implemented.
TW111133530A 2021-11-24 2022-09-05 An application APP testing method, device, electronic equipment and storage medium TWI822301B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111407428.4A CN114020636A (en) 2021-11-24 2021-11-24 Application APP test method and device, electronic equipment and storage medium
CN202111407428.4 2021-11-24

Publications (2)

Publication Number Publication Date
TW202321920A TW202321920A (en) 2023-06-01
TWI822301B true TWI822301B (en) 2023-11-11

Family

ID=80066196

Family Applications (1)

Application Number Title Priority Date Filing Date
TW111133530A TWI822301B (en) 2021-11-24 2022-09-05 An application APP testing method, device, electronic equipment and storage medium

Country Status (3)

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

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114020636A (en) * 2021-11-24 2022-02-08 中国银联股份有限公司 Application APP test method and device, electronic equipment and storage medium

Citations (4)

* 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
CN113111005A (en) * 2021-05-06 2021-07-13 腾讯科技(深圳)有限公司 Application program testing method and device
CN113268416A (en) * 2021-05-17 2021-08-17 深圳Tcl新技术有限公司 Application program testing method and device, storage medium and terminal
CN113515443A (en) * 2021-04-21 2021-10-19 深圳市康冠商用科技有限公司 Multi-language automatic checking method, device, computer equipment and storage medium

Family Cites Families (4)

* 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
CN111694754B (en) * 2020-07-30 2023-04-07 抖音视界有限公司 Application program testing method and device, electronic equipment and computer medium
CN112965916B (en) * 2021-04-09 2024-03-08 中国工商银行股份有限公司 Page testing method, page testing device, electronic equipment and readable storage medium
CN114020636A (en) * 2021-11-24 2022-02-08 中国银联股份有限公司 Application APP test method and device, electronic equipment and storage medium

Patent Citations (4)

* 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 (en) * 2021-04-21 2021-10-19 深圳市康冠商用科技有限公司 Multi-language automatic checking method, device, computer equipment and storage medium
CN113111005A (en) * 2021-05-06 2021-07-13 腾讯科技(深圳)有限公司 Application program testing method and device
CN113268416A (en) * 2021-05-17 2021-08-17 深圳Tcl新技术有限公司 Application program testing method and device, storage medium and terminal

Also Published As

Publication number Publication date
CN114020636A (en) 2022-02-08
WO2023093137A1 (en) 2023-06-01
TW202321920A (en) 2023-06-01

Similar Documents

Publication Publication Date Title
US20200410044A1 (en) Visualized edition method, device and apparatus, and storage medium
CN109871326B (en) Script recording method and device
US9092314B2 (en) On-the-fly technical support
US20120159453A1 (en) Method to recognize gui object in globalized environment
CN105190548A (en) Automatic risk analysis of software
TWI822301B (en) An application APP testing method, device, electronic equipment and storage medium
WO2020151344A1 (en) Software development and testing method for sub-iterations and related devices
WO2020083367A1 (en) Chip testing method, device, electronic apparatus and computer readable medium
CN110554893B (en) Multi-language adaptation method, device and equipment for software system and readable storage medium
TW201207731A (en) Embedded system with plural firmware and firmware updating method thereof
WO2020237508A1 (en) Assertion validation code binding method and apparatus
JP3822044B2 (en) Design verification system, design verification method, and computer-readable recording medium storing design verification program
CN114912391A (en) Automatic generation method, device, equipment and medium of register design and verification model
CN113673191B (en) Timing correction method and apparatus, calculation apparatus, and storage medium
US20210026756A1 (en) Deriving software application dependency trees for white-box testing
US20220374345A1 (en) Techniques for similarity determination across software testing configuration data entities
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
US20230236959A1 (en) Controlled input/output in progress state during testcase processing
US9996656B2 (en) Detecting dispensable inverter chains in a circuit design
US8024362B2 (en) System and method for erasing and writing desktop management interface data under a linux system
US20230027880A1 (en) Techniques for automated testing of application programming interfaces
CN108334313A (en) Continuous integrating method, apparatus and code management system for large-scale SOC research and development
CN111859089B (en) Wrong word detection control method for Internet information
CN113177020A (en) Data processing method and device
CN116861829B (en) Method for locating errors in logic system design and electronic equipment