# uiautomatorviewer-plus BDD脚本录制,代码生成器 **Repository Path**: vvliker-jo/uiautomatorviewer-plus ## Basic Information - **Project Name**: uiautomatorviewer-plus BDD脚本录制,代码生成器 - **Description**: 基于uiautomatorviewer的自动化代码生成器,脚本录制工具。支持手机常用的操作,如等待元素出现,点击元素,滑动屏幕,获取元素文本,保存元素文本,输入文本,添加断言等一键生成代码,还有一个调试工具验证生成的代码是否正确。 - **Primary Language**: Java - **License**: Unlicense - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-08-06 - **Last Updated**: 2024-11-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README **Automated script generation and debugging tool based on Uiautomator secondary development. This tool will make you to quickly develop automated scripts without needing to know the code. You just need to generate code based on this tool, and then debug the code through the tool, and the automation script is developed in this way.** ![输入图片说明](imgs/en/1.png) ![输入图片说明](imgs/en/2.png) Next, let's take a look currently implemented functions, from left to right: system settings, Step adding and modifying, waiting for elements to appear, clicking on elements, saving text, input text, adding assertions, deleting nodes, generating code, refreshing test cases and Debug tool ![输入图片说明](imgs/en/3.png) ### System settings, which can set the generated class names, debug servers, code templates and output paths, and finally test data ![输入图片说明](imgs/en/4.png) ### Step addition, modification, and maintenance of public steps. Click on 'My Testing Scenarios' to add new test steps or select common test steps ![输入图片说明](imgs/en/5.png) ### Wait for the element to display. Select the element you want to operate on the screen, and the text of the current element will be displayed by default. If there is no text for the element, use xpath to locate it. The default is to wait for the selected element to appear, or you can choose to wait for the relative element of that element to appear. ![输入图片说明](imgs/en/6.png) ### Clicking on an element also uses text positioning by default. You can click on the selected element, or on other relative node elements of that element. You can also set to only click on a certain element when text appears. ![输入图片说明](imgs/en/7.png) ### Save the text. Searching for the target element in the interface can assist you in finding the correct target element. If there is a resource id, it is used for positioning by default. If not, other text relative positioning or custom xpath can be used. Click to find the target element, and the corresponding xpath and target element text will be displayed below. Then enter the key and description information to save the text ![输入图片说明](imgs/en/8.png) ### Entering text and searching for the target element in the interface can assist you in finding the correct target element for the text to be entered. Clicking on the input box for the text will bring up the second and third interfaces, allowing you to select the text to be entered ![输入图片说明](imgs/en/9.png) ![输入图片说明](imgs/en/10.png) ### Add assertions to compare the elements displayed on the interface with known and determined data. Searching for the target element in the interface can assist you in finding the element that needs to be compared. Click the input box at the bottom to select the expected text from the cache, or click the tab on the right to select the expected text from the test data ![输入图片说明](imgs/en/11.png) ### Screen sliding allows you to set the direction, speed, and timeout time of the slide. ![输入图片说明](imgs/en/12.png) ### To generate code, simply click the "Generate Code" button. The generated code includes a feature file, two Step files (the operations of the two Steps are the same, except that the Step at the end of Debug puts each operation into a separate method, which is only used by Debug tools), a page object Screen, and a multilingual file ![输入图片说明](imgs/en/14.png) ![输入图片说明](imgs/cn/15.png) ![输入图片说明](imgs/en/16.png) ![输入图片说明](imgs/en/17.png) ### The Debug tool can select a step and debug all operations under this step, or select an operation, click the Debug button to display the pop-up box below, and click Execute to debug the corresponding code. In the custom tab, you can debug any code without debugging the current operation. You only need to specify the class name, method name, and method parameters. If there are any problems, you can check "Print PageSource" to print out the source code of the current screen for inspection. ![输入图片说明](imgs/en/18.png) ![输入图片说明](imgs/en/19.png)