CN109032955B - UI automation test method, device, equipment and readable storage medium - Google Patents

UI automation test method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN109032955B
CN109032955B CN201811044881.1A CN201811044881A CN109032955B CN 109032955 B CN109032955 B CN 109032955B CN 201811044881 A CN201811044881 A CN 201811044881A CN 109032955 B CN109032955 B CN 109032955B
Authority
CN
China
Prior art keywords
management interface
storage system
target
folder
target storage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811044881.1A
Other languages
Chinese (zh)
Other versions
CN109032955A (en
Inventor
李超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201811044881.1A priority Critical patent/CN109032955B/en
Publication of CN109032955A publication Critical patent/CN109032955A/en
Application granted granted Critical
Publication of CN109032955B publication Critical patent/CN109032955B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The invention discloses a UI automatic test method, which comprises the following steps: receiving a request for carrying out UI automation test on a target storage system; deleting an original management interface folder corresponding to the verification code verification mode in the target storage system; acquiring a target management interface folder corresponding to the universal code verification mode, and storing the target management interface folder into a target storage system; setting the attribute of a target management interface folder, and restarting tomcat service; and carrying out UI automatic test on the target storage system in a universal code verification mode. In the process of carrying out UI automatic test, the verification mode of the target storage system to be tested can be quickly replaced without modifying the management interface code, and the UI automatic test efficiency can be improved. The invention also discloses a UI automation test device, equipment and a readable storage medium, and has corresponding technical effects.

Description

UI automation test method, device, equipment and readable storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a UI automatic testing method, a device, equipment and a readable storage medium.
Background
When the UI automation test is performed on the storage system, the verification code needs to be input when logging in the management interface, but the verification code is difficult to identify automatically, and 100% of successful identification cannot be guaranteed. This directly affects the performance of UI automation tests.
At present, in order to ensure that the UI automation test can be quickly and effectively executed, codes which are verified based on verification codes in management interface codes are directly modified so as to shield verification code verification links. However, since the shielding verification link requires a technician to manually modify the code, the efficiency of the UI automation test is reduced.
In summary, how to effectively solve the problems of UI automation test efficiency and the like is a technical problem that needs to be solved urgently by those skilled in the art at present.
Disclosure of Invention
The invention aims to provide a UI automatic test method, a device, equipment and a readable storage medium, so as to realize automatic change of a verification mode and further improve the UI automatic test efficiency.
In order to solve the technical problems, the invention provides the following technical scheme:
a UI automation test device comprising:
a memory for storing a computer program;
and the processor is used for realizing the steps of the UI automation testing method when the computer program is executed.
A readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the above-mentioned UI automation test method.
The method provided by the embodiment of the invention is applied to receive a request for carrying out UI automatic test on a target storage system; deleting an original management interface folder corresponding to the verification code verification mode in the target storage system; acquiring a target management interface folder corresponding to the universal code verification mode, and storing the target management interface folder into a target storage system; setting the attribute of a target management interface folder, and restarting tomcat service; and carrying out UI automatic test on the target storage system in a universal code verification mode.
After receiving a request for performing a UI automation test on the target storage system, the original management interface folder corresponding to the verification code verification mode in the target storage system may be deleted. And then, acquiring a target management interface folder corresponding to the universal code verification mode, and storing the target management interface folder into a target storage system. And restarting tomcat service after setting the attribute of a target management interface folder in the target storage system. Therefore, UI automation test can be carried out on the target storage system in the universal code verification mode. Namely, in the process of carrying out the UI automatic test, the verification mode of the target storage system to be tested can be quickly replaced without modifying the management interface code, and the UI automatic test efficiency can be improved.
Correspondingly, the embodiment of the invention also provides a UI automation test device, equipment and a readable storage medium corresponding to the UI automation test method, which have the technical effects and are not described herein again.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart illustrating an embodiment of a method for automatically testing a UI of the present invention;
FIG. 2 is a schematic structural diagram of an automatic UI testing apparatus according to an embodiment of the invention;
FIG. 3 is a schematic structural diagram of a UI automation test device according to an embodiment of the invention;
fig. 4 is a schematic structural diagram of a UI automation test device according to an embodiment of the present invention.
Detailed Description
The core of the invention is that the universal code and the verification code of the management interface of the storage system are automatically replaced to realize the automatic replacement of the verification mode and further improve the efficiency of UI automatic test. Specifically, when the storage system is compiled and constructed, the verification code is set to be a universal code, and the management interface code containing the universal code is independently packaged and stored. Therefore, when the UI automation test is carried out, the UI automation test can be carried out through the script, the management interface codes of the storage system are replaced by the management interface codes containing the universal codes, and the UI automation test is carried out in the universal code verification mode.
Accordingly, another core of the present invention is to provide a UI automation test apparatus, a device and a readable storage medium corresponding to the above UI automation test method, which have the above technical effects.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The first embodiment is as follows:
referring to fig. 1, fig. 1 is a flowchart illustrating a UI automation testing method according to an embodiment of the present invention, the method including the following steps:
s101, receiving a request for carrying out UI automation test on a target storage system.
When the process of performing the UI automation test on the target storage system is started, it can be regarded that the linux server receives the request of performing the UI automation test on the target storage system. And receiving a UI automation parameter request for the target storage system, namely, considering that the verification code verification mode in the target storage system needs to be changed into a universal code verification mode, so that the UI automation test efficiency is improved.
When logging in the verification code verification mode, a correct user name, a login password and a verification code need to be input so that the user can log in successfully; when logging in under the universal code verification description, the user, the login password and any verification code can be input only to successfully log in.
S102, deleting the original management interface folder corresponding to the verification code verification mode in the target storage system.
After the UI automation test request is received, the original management interface folder corresponding to the verification code verification mode in the target storage system can be deleted. Wherein the original management interface folder is stored in tbui file under/opt/apache-tomcat/directory. Wherein the tbui file contains a code of the verification code verification pattern.
When deleting the original management interface folder, firstly mounting/opt directory in the target storage system, and adding modification authority to the read-only file. Then, delete the original management interface folder under/opt/apache-tomcat/directory.
Preferably, to facilitate rolling back, i.e., returning to the original state, upon failure of the verification pattern replacement, or after completion of the UI automation test. Therefore, before deleting the original management interface folder corresponding to the verification code verification mode, the original management interface folder corresponding to the verification code verification mode can be backed up. That is, after receiving a request for performing a UI automation test on a target storage system, before deleting an original management interface folder corresponding to a verification code verification pattern in the target storage system, the original management interface folder corresponding to the verification code verification pattern in the storage system may also be backed up.
After deleting the original management interface folder corresponding to the verification code verification mode, the operation of step S103 may be performed.
S103, acquiring a target management interface folder corresponding to the universal code verification mode, and storing the target management interface folder into a target storage system.
In the embodiment of the invention, when the storage system is compiled and constructed, the object management interface codes containing the universal codes are independently packaged and stored. Thus, when the verification mode is replaced, the target management interface folder can be obtained. After the target management interface folder is obtained, the original management interface folder in the deleted target storage system can be directly stored in the directory where the original management interface folder is located before deletion. The target management interface folder can be copied to the/opt/apache-tomcat/directory in the target storage system.
Preferably, in order to facilitate automation, the target management interface file may be stored in a designated server in advance, wherein the designated server may be a Linux server. The target management interface file is obtained, namely, the target management interface folder corresponding to the universal code verification mode is copied from the designated server to the target storage system in the scp mode. Namely, the target management interface folder corresponding to the universal code verification mode on the designated server can be remotely copied to the target storage system in an scp mode. Specifically, how to copy the folder to the target storage system by using the scp method can refer to the current scp method, which is not described herein again.
S104, setting the attribute of the target management interface folder, and restarting tomcat service.
After the target management interface folder is stored in the target storage system, the properties of the target management interface folder of the target storage system may be set so as to be effective. Specifically, the management interface folder attribute may be set by performing the following steps:
step one, increasing the permissions of webadmin users and user groups by using a Chown command;
and step two, setting the file permissions of the target management interface folder and the subdirectories as read, write and executable by using a Chmod command.
The Chown command is used for changing the user name and the user group of a certain directory or file, and the permission of the webedmin user and the user group can be increased by using the Chown command. The Chmod command is used for modifying the access authority of a certain directory or file, and the permissions of the target management interface folder and the files of the subdirectories can be set to be read, written and executable by using the Chmod command. In particular, how the Chown command and the Chmod command are used is described in terms of their respective corresponding command syntax formats.
After the attribute of the target management interface folder is set, the tomcat service can be restarted by using a Satask restart service-service tomcat command.
And S105, carrying out UI automatic test on the target storage system in the universal code verification mode.
After the operations of the steps S101 to S104 are performed, the UI automation test can be performed in the universal code verification mode. When the UI automation test is carried out and the management interface of the target storage system is logged in, the user only needs to input an accurate user name, a login password and any one verification code to realize the login.
The method provided by the embodiment of the invention is applied to receive a request for carrying out UI automatic test on a target storage system; deleting an original management interface folder corresponding to the verification code verification mode in the target storage system; acquiring a target management interface folder corresponding to the universal code verification mode, and storing the target management interface folder into a target storage system; setting the attribute of a target management interface folder, and restarting tomcat service; and carrying out UI automatic test on the target storage system in a universal code verification mode.
After receiving a request for performing a UI automation test on the target storage system, the original management interface folder corresponding to the verification code verification mode in the target storage system may be deleted. And then, acquiring a target management interface folder corresponding to the universal code verification mode, and storing the target management interface folder into a target storage system. And restarting tomcat service after setting the attribute of a target management interface folder in the target storage system. Therefore, UI automation test can be carried out on the target storage system in the universal code verification mode. Namely, in the process of carrying out the UI automatic test, the verification mode of the target storage system to be tested can be quickly replaced without modifying the management interface code, and the UI automatic test efficiency can be improved.
Preferably, after the UI automation test is completed, correspondingly, a rollback operation may be performed to perform subsequent development or application, and the verification mode of the target storage system is replaced with the verification code verification mode. Specifically, after the UI automation test is performed on the target storage system in the universal code verification mode in step S105, a rollback operation is performed to replace the universal code verification mode with the verification code verification mode. For a specific rollback operation, a common rollback processing flow may be referred to, and the target management interface folder in the target storage system may be replaced with the original management interface folder by following the operations in step S102 to step S104.
Example two:
corresponding to the above method embodiment, the embodiment of the present invention further provides a UI automation test apparatus, and the UI automation test apparatus described below and the UI automation test method described above may be referred to in correspondence.
Referring to fig. 2, the apparatus includes the following modules:
a request receiving module 101, configured to receive a request for performing a UI automation test on a target storage system;
the folder deleting module 102 is configured to delete an original management interface folder corresponding to the verification code verification mode in the target storage system;
the folder acquisition module 103 is used for acquiring a target management interface folder corresponding to the universal code verification mode and storing the target management interface folder into a target storage system;
a folder setting module 104, configured to set an attribute of a target management interface folder, and restart tomcat service;
and the UI automation test module 105 is used for carrying out UI automation test on the target storage system in the universal code verification mode.
The device provided by the embodiment of the invention is applied to receive a request for carrying out UI automation test on a target storage system; deleting an original management interface folder corresponding to the verification code verification mode in the target storage system; acquiring a target management interface folder corresponding to the universal code verification mode, and storing the target management interface folder into a target storage system; setting the attribute of a target management interface folder, and restarting tomcat service; and carrying out UI automatic test on the target storage system in a universal code verification mode.
After receiving a request for performing a UI automation test on the target storage system, the original management interface folder corresponding to the verification code verification mode in the target storage system may be deleted. And then, acquiring a target management interface folder corresponding to the universal code verification mode, and storing the target management interface folder into a target storage system. And restarting tomcat service after setting the attribute of a target management interface folder in the target storage system. Therefore, UI automation test can be carried out on the target storage system in the universal code verification mode. Namely, in the process of carrying out the UI automatic test, the verification mode of the target storage system to be tested can be quickly replaced without modifying the management interface code, and the UI automatic test efficiency can be improved.
In a specific embodiment of the present invention, the folder setting module 104 is specifically configured to increase permissions of webedmin users and user groups by using a brown command; and setting the permission of the files of the target management interface folder and the subdirectories to be read, written and executable by using a Chmod command.
In a specific embodiment of the present invention, the folder setting module 104 is specifically configured to restart the tomcat service by using a save restart service-service tomcat command.
In one embodiment of the present invention, the method further comprises:
and the folder backup module is used for backing up the original management interface folder corresponding to the verification code verification mode in the storage system after receiving the request for carrying out the UI automation test on the target storage system and before deleting the original management interface folder corresponding to the verification code verification mode in the target storage system.
In an embodiment of the present invention, the folder obtaining module 103 is configured to copy, in an scp manner, a target management interface folder corresponding to the universal code verification mode from the designated server to the target storage system.
In a specific embodiment of the present invention, the folder deletion module 102 is specifically configured to mount a/opt directory of a target storage system, and add a modification permission of a read-only file; delete/opt/apache-tomcat/original management interface folder under directory.
In one embodiment of the present invention, the method further comprises:
and the rollback module is used for executing rollback operation after UI (user interface) automatic test is carried out on the target storage system in the universal code verification mode, and replacing the universal code verification mode with the verification code verification mode.
Example three:
corresponding to the above method embodiment, the embodiment of the present invention further provides a UI automation test device, and a UI automation test device described below and a UI automation test method described above may be referred to in a corresponding manner.
Referring to fig. 3, the transaction apparatus includes:
a memory D1 for storing computer programs;
processor D2, configured to implement the steps of the transaction processing method of the above-described method embodiment when executing the computer program.
Referring to fig. 4, fig. 4 is a schematic diagram of a specific structure of the UI automatic test equipment provided in this embodiment, which may generate relatively large differences due to different configurations or performances, and may include one or more processors (CPUs) 322 (e.g., one or more processors) and a memory 332, and one or more storage media 330 (e.g., one or more mass storage devices) storing an application 342 or data 344. Memory 332 and storage media 330 may be, among other things, transient storage or persistent storage. The program stored on the storage medium 330 may include one or more modules (not shown), each of which may include a series of instructions operating on a data processing device. Still further, the central processor 322 may be configured to communicate with the storage medium 330 to execute a series of instructional operations on the storage medium 330 on the UI automation test device 301.
The UI automation test equipment 301 may also include one or more power sources 326, one or more wired or wireless network interfaces 350, one or more input output interfaces 358, and/or one or more operating systems 341. Such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
The steps in the UI automation test method described above may be implemented by the structure of the UI automation test apparatus.
Example four:
corresponding to the above method embodiment, the embodiment of the present invention further provides a readable storage medium, and a readable storage medium described below and a UI automation test method described above may be referred to correspondingly.
A readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the UI automation test method of the above-mentioned method embodiments.
The readable storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various other readable storage media capable of storing program codes.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.

Claims (9)

1. A UI automation test method is characterized by comprising the following steps:
receiving a request for carrying out UI automation test on a target storage system;
deleting an original management interface folder corresponding to a verification code verification mode in the target storage system; wherein the original management interface folder is a tbui file stored in an opt/apache-tomcat/directory; wherein the tbui file contains a code of a verification code verification pattern;
acquiring a target management interface folder corresponding to a universal code verification mode, and storing the target management interface folder into the target storage system; the target management interface folder is a folder which independently packs and stores target management interface codes containing universal codes when the target storage system is compiled and constructed;
setting the attribute of the target management interface folder, and restarting tomcat service;
carrying out UI automation test on the target storage system in the universal code verification mode;
wherein, setting the attribute of the target management interface folder comprises:
increasing the permissions of webedmin users and user groups by using a Chown command;
and setting the file permissions of the target management interface folder and the subdirectories to be read, written and executable by using a Chmod command.
2. The UI automation test method of claim 1, wherein the restarting tomcat service comprises:
restart tomcat service with the Satask restart service-service tomcat command.
3. The method according to claim 1, wherein after receiving the request for UI automation test on the target storage system, before deleting the original management interface folder corresponding to the verification code verification pattern in the target storage system, the method further comprises:
and backing up an original management interface folder corresponding to the verification code verification mode in the storage system.
4. The UI automation test method of claim 1, wherein obtaining a target management interface folder corresponding to a universal code verification mode and storing the target management interface folder in the target storage system comprises:
and copying a target management interface folder corresponding to the universal code verification mode from the designated server to the target storage system by adopting an scp mode.
5. The UI automation test method of claim 1, wherein deleting an original management interface folder in the target storage system corresponding to a verification code verification pattern comprises:
mounting the/opt directory of the target storage system, and increasing the modification authority of the read-only file;
delete/opt/apache-tomcat/original management interface folder under directory.
6. The UI automation test method of any of claims 1 to 5 further comprising, after conducting UI automation test on the target storage system in the universal code verification mode:
and executing a rollback operation, and replacing the universal code verification mode with the verification code verification mode.
7. An automated UI testing apparatus, comprising:
the request receiving module is used for receiving a request for carrying out UI automation test on the target storage system;
the folder deleting module is used for deleting the original management interface folder corresponding to the verification code verification mode in the target storage system; wherein the original management interface folder is a tbui file stored in an opt/apache-tomcat/directory; wherein, the tbui file comprises the code of the verification code verification mode;
the folder acquisition module is used for acquiring a target management interface folder corresponding to the universal code verification mode and storing the target management interface folder into the target storage system; the target management interface folder is a folder which independently packs and stores target management interface codes containing universal codes when the target storage system is compiled and constructed;
the folder setting module is used for setting the attribute of the target management interface folder and restarting tomcat service;
the UI automation test module is used for carrying out UI automation test on the target storage system in the universal code verification mode;
the folder setting module is specifically used for increasing the permissions of webadmin users and user groups by using a Chown command; and setting the file permissions of the target management interface folder and the subdirectories to be read, written and executable by using a Chmod command.
8. A UI automation test device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the UI automation test method according to any one of claims 1 to 6 when executing the computer program.
9. A readable storage medium, characterized in that the readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the UI automation test method according to any one of claims 1 to 6.
CN201811044881.1A 2018-09-07 2018-09-07 UI automation test method, device, equipment and readable storage medium Active CN109032955B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811044881.1A CN109032955B (en) 2018-09-07 2018-09-07 UI automation test method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811044881.1A CN109032955B (en) 2018-09-07 2018-09-07 UI automation test method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN109032955A CN109032955A (en) 2018-12-18
CN109032955B true CN109032955B (en) 2021-06-25

Family

ID=64624091

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811044881.1A Active CN109032955B (en) 2018-09-07 2018-09-07 UI automation test method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN109032955B (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106899445A (en) * 2015-12-21 2017-06-27 北京奇虎科技有限公司 The method and system of page interface automatic test
CN105681344A (en) * 2016-03-11 2016-06-15 广东亿迅科技有限公司 Verification code recognition system and method
CN106650398B (en) * 2017-01-03 2023-04-14 深圳博十强志科技有限公司 Verification code identification system and identification method of mobile platform

Also Published As

Publication number Publication date
CN109032955A (en) 2018-12-18

Similar Documents

Publication Publication Date Title
CN106951345B (en) Consistency test method and device for disk data of virtual machine
CN102736978B (en) A kind of method and device detecting the installment state of application program
US9971595B1 (en) Techniques for automated database deployment
US20160378458A1 (en) Method and device for system application installation package, and terminal
CN109684298B (en) Database migration method, device, equipment and storage medium
JP2017201470A (en) Setting support program, setting support method, and setting support device
CN107992404A (en) A kind of Software Automatic Testing Method and device
CN113434158A (en) User-defined management method, device, equipment and medium for big data component
US10803166B1 (en) Automated determination of application privileges
CN110659202A (en) Client automatic testing method and device
US11416235B2 (en) System and method for managed server independence for deployment of software applications and libraries
CN110209525B (en) Operating system restoration method and device
US11093380B1 (en) Automated testing of backup component upgrades within a data protection environment
CN111625407B (en) SSD performance test method and related components
CN109032955B (en) UI automation test method, device, equipment and readable storage medium
CN115567392B (en) Automatic deployment upgrading method for customer internal service system
CN113986263A (en) Code automation test method, device, electronic equipment and storage medium
US9946534B1 (en) Techniques for automated database deployment
CN112579113A (en) Application program upgrading method and device, storage medium and terminal
CN107026754B (en) Automatic operation and maintenance method and device for single-node PaaS platform
US10698790B1 (en) Proactive debugging
CN113708981B (en) Method and system for repairing fault of cloud host system
CN113110955B (en) System disk repair method, storage medium and device
CN117194390B (en) Database migration method and device
CN116149707B (en) Method and device for detecting and avoiding upgrading risk of distributed system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant