CN107908569B - WAP user interface test method - Google Patents

WAP user interface test method Download PDF

Info

Publication number
CN107908569B
CN107908569B CN201711477167.7A CN201711477167A CN107908569B CN 107908569 B CN107908569 B CN 107908569B CN 201711477167 A CN201711477167 A CN 201711477167A CN 107908569 B CN107908569 B CN 107908569B
Authority
CN
China
Prior art keywords
tested
user interface
case
test
cases
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
CN201711477167.7A
Other languages
Chinese (zh)
Other versions
CN107908569A (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.)
Vipshop Guangzhou Software Co Ltd
Original Assignee
Guangzhou Pinwei Software 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 Guangzhou Pinwei Software Co Ltd filed Critical Guangzhou Pinwei Software Co Ltd
Priority to CN201711477167.7A priority Critical patent/CN107908569B/en
Publication of CN107908569A publication Critical patent/CN107908569A/en
Application granted granted Critical
Publication of CN107908569B publication Critical patent/CN107908569B/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a WAP user interface test method, which comprises the following steps: the estNG configures the WAP user interface test, wherein the configuration comprises multithreading configuration, case combination to be tested and test result monitoring configuration of the case to be tested; the method comprises the following steps that a Selenium Grid running on a node server distributes a plurality of cases to be tested on a plurality of sub-node servers to be executed in parallel according to a multithreading configuration result and a case combination result to be tested; and the testNG monitors the test results of the multiple cases to be tested according to the monitoring configuration result while the multiple cases to be tested are executed in parallel. The technical problems that the time consumption is long, the test efficiency is lower and lower, and the maintenance cost is increased when a single-thread automation framework built by Junit and selenium is used for testing the WAP user interface are solved.

Description

WAP user interface test method
Technical Field
The invention relates to the technical field of computers, in particular to a WAP user interface testing method.
Background
With the continuous development of computer technology and internet industry, the update speed of the WAP user interface is increasing, so that more and more WAP user interfaces need to be tested, and the test speed of the WAP user interface is required to be faster and faster.
The existing method for testing the WAP user interface is to use a single-thread automatic frame established by Junit and selenium to carry out testing, but the testing process of the single-thread automatic frame is executed in series, the time consumption is long, the testing efficiency is lower and lower along with the increasing number of cases to be tested of the WAP user interface, and the maintenance cost is increased.
Disclosure of Invention
The invention provides a WAP user interface test method, which solves the technical problems that the test of a WAP user interface by using a single-thread automation frame established by Junit and selenium consumes long time, the test efficiency is lower and lower, and the maintenance cost is increased.
The invention provides a WAP user interface test method, which comprises the following steps:
the testNG configures the WAP user interface test, wherein the configuration comprises multithreading configuration, case combination to be tested and test result monitoring configuration of the case to be tested;
the method comprises the following steps that a Selenium Grid running on a node server distributes a plurality of cases to be tested on a plurality of sub-node servers to be executed in parallel according to a multithreading configuration result and a case combination result to be tested;
and the testNG monitors the test results of the multiple cases to be tested according to the monitoring configuration result while the multiple cases to be tested are executed in parallel.
Preferably, the first and second electrodes are formed of a metal,
the WAP user interface test method further comprises the following steps:
and the Selenium Grid controls the browser driver of each case to be tested to use the same thread in the execution process.
Preferably, the first and second electrodes are formed of a metal,
the process of executing the to-be-side use case on the child node server specifically comprises the following steps:
initializing a browser driver on a child node server, loading test data and determining parameters of the to-be-tested case;
then calling corresponding service components according to a preset service operation method and executing corresponding service processes;
and calling a method of the assertion class and verifying the test result of the to-be-tested case according to the method of the assertion class.
Preferably, the first and second electrodes are formed of a metal,
the service component is formed by calling methods in the class in advance and then packaging corresponding service scenes according to the methods in the class.
Preferably, the first and second electrodes are formed of a metal,
calling a preset page object to execute a corresponding business process;
the page object is formed by calling an element object class in advance and then packaging corresponding elements according to the element object class.
Preferably, the first and second electrodes are formed of a metal,
the WAP user interface test method further comprises the following steps:
and when the test result of the to-be-tested case is verified to be failed, the testNG controls the to-be-tested case with the test result failed to be verified to be executed on the child node server again.
Preferably, the first and second electrodes are formed of a metal,
the WAP user interface test method further comprises the following steps:
and generating a corresponding report according to the monitoring condition of the test result of the plurality of test cases to be tested.
Preferably, the first and second electrodes are formed of a metal,
the execution of the cases to be tested takes classes as a unit, wherein each class comprises a plurality of methods, and each method corresponds to one case to be tested.
Preferably, the first and second electrodes are formed of a metal,
the execution of the to-be-tested use cases takes methods as a unit, and each method corresponds to one to-be-tested use case.
According to the technical scheme, the invention has the following advantages:
the testNG firstly configures the WAP user interface test, and the configuration comprises multithreading configuration, case combination to be tested and test result monitoring configuration of the case to be tested; then, the Selenium Grid running on the node server distributes a plurality of cases to be tested on a plurality of child node servers to execute in parallel according to the multithreading configuration result and the case combination result to be tested; finally, the testNG monitors the test results of the multiple cases to be tested according to the monitoring configuration result while the multiple cases to be tested are executed in parallel; the method has the advantages that the multithreading concurrent execution of the to-be-tested cases is realized through the Selenium Grid, the execution efficiency of the to-be-tested cases is effectively improved, the TestNG is used for carrying out the pre-configuration and the monitoring in the concurrent execution process of the to-be-tested cases, and the technical problems that the test of the WAP user interface is long in time consumption, the test efficiency is lower and the maintenance cost is increased due to the fact that a single-thread automation framework built by the Junit and the Selenium is used are solved.
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, and 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 these drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a WAP user interface testing method according to a first embodiment of the present invention;
fig. 2 is a flowchart illustrating a WAP user interface testing method according to a second embodiment of the present invention;
fig. 3 is a schematic flow diagram of a process of executing a to-be-side use case on a child node server.
Detailed Description
The embodiment of the invention provides a WAP user interface test method, which solves the technical problems that the test of a WAP user interface by using a single-thread automation framework established by Junit and selenium consumes long time, the test efficiency is lower and lower, and the maintenance cost is increased.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. 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.
Referring to fig. 1, a flowchart of a WAP user interface testing method according to a first embodiment of the present invention is shown.
The invention provides a first embodiment of a WAP user interface test method, which comprises the following steps:
step 101, TestNG configures WAP user interface testing.
The configuration includes but is not limited to a multithread configuration, a combination of cases to be tested, and a test result monitoring configuration of cases to be tested.
The multi-thread configuration may be understood as which specific threads are turned on for WAP user interface testing.
In the process of testing the WAP user interface, a plurality of cases to be tested need to be executed, and the combination of the cases to be tested can be understood as the number, execution sequence, specific thread to be executed and the like of the cases to be tested.
The test result monitoring configuration of the to-be-tested case can be understood as executing corresponding operations according to the test result, for example, outputting the content a after the test result is successful, outputting the content B after the test result is failed, or executing other operations.
And 102, distributing a plurality of cases to be tested on a plurality of child node servers for parallel execution according to the multithreading configuration result and the case combination result to be tested by the Selenium Grid running on the node servers.
It will be appreciated that the child node servers will have previously completed registration.
In the embodiment, the multithreading parallel execution of the to-be-tested use case is realized through the control of the Selenium Grid, and the execution efficiency of the to-be-tested use case is effectively improved.
And 103, monitoring the test results of the multiple cases to be tested according to the monitoring configuration result while the TestNG executes the multiple cases to be tested in parallel.
In this embodiment, assuming that there are two child node servers, with different configurations in step 1, 5 cases to be tested may be respectively allocated to the two child node servers in a group of two and three, or 5 cases to be tested may be respectively allocated to the two child node servers in a group of one and four.
Referring to fig. 2, a flowchart of a WAP user interface testing method according to a second embodiment of the present invention is shown.
The invention provides a second embodiment of a WAP user interface test method, which comprises the following steps:
step 201, TestNG configures WAP user interface test, where the configuration includes multithreading configuration, combination of cases to be tested, and test result monitoring configuration of cases to be tested.
Step 201 is the same as step 101 in the first embodiment of the present application, and specific description may refer to the content of step 101 in the first embodiment, which is not described herein again.
Step 202, the Selenium Grid running on the node server allocates a plurality of cases to be tested on a plurality of child node servers for parallel execution according to the multithreading configuration result and the case combination result to be tested.
It should be noted that, under the condition that the use cases to be tested are executed in parallel, the Selenium Grid can control the browser driver that each use the same thread in the execution process of each use case to be tested.
And 203, monitoring the test results of the multiple cases to be tested according to the monitoring configuration result while the TestNG executes the multiple cases to be tested in parallel.
And 204, generating a corresponding report according to the monitoring condition of the test result of the plurality of test cases to be tested.
In this embodiment, the execution of the to-be-tested use case may take a class as a unit, where each class includes a plurality of methods, and each method corresponds to one to-be-tested use case; in this case, the child node server will execute multiple use cases to be tested at once.
The execution of the cases to be tested can also take methods as a unit, and each method corresponds to one case to be tested; in this case, the child node server will execute one use case to be tested at a time.
Referring to fig. 3, a schematic flow chart of the to-be-used case executed on the child node server is shown.
The process of executing the to-be-side use case on the child node server specifically comprises the following steps:
step 301, initializing a browser driver on the child node server, loading test data, and determining parameters of a case to be tested.
Step 301 may also include determining whether there is a dependency on the use case to be tested.
Step 302, then call the corresponding service component according to the preset service operation method and execute the corresponding service flow.
The service component is formed by calling methods in the class in advance and then packaging corresponding service scenes according to the methods in the class.
For example, the business components can be respectively packaged into a login business component, a shopping cart business component and an order business component according to different business scenarios.
And calling a preset page object in the process of executing the corresponding business process.
The page object is formed by calling an element object class in advance and then packaging corresponding elements according to the element object class.
The page objects may include a landing page object, a shopping cart page object, and a checkout page object.
For example, in the case of testing login, the corresponding page object may be formed by encapsulating an input box, a click button, an account number and a password.
Because the page object is formed by encapsulation, when a certain page element changes, the page object only needs to be adjusted, for example, the elements of the landing page object in the landing page object, the shopping cart page object and the settlement page object change, and only the landing page object needs to be adjusted; in the prior art, all elements corresponding to the landing page object, the shopping cart page object and the settlement page object are packaged once again, so that the whole test script needs to be adjusted no matter which element of the shopping cart page object is changed, and the cost for maintaining the test script due to the change of the page element can be reduced by packaging the page object.
Step 303, calling a method of the assertion class and verifying the test result of the case to be tested according to the method of the assertion class.
For example, after login is successful, a user name should be displayed on the page, whether the user name exists can be verified by calling the assertion type method, if yes, the verification test result is considered to be successful, otherwise, the verification test result is considered to be failed.
And step 304, when the test result of the to-be-tested case is verified to be failed, the TestNG controls the to-be-tested case with the test result verified to be failed to be executed on the child node server again.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (6)

1. A WAP user interface test method is characterized by comprising the following steps:
the testNG configures the WAP user interface test, wherein the configuration comprises multithreading configuration, case combination to be tested and test result monitoring configuration of the case to be tested;
the method comprises the following steps that a Selenium Grid running on a node server distributes a plurality of cases to be tested on a plurality of sub-node servers to be executed in parallel according to a multithreading configuration result and a case combination result to be tested;
the testNG monitors the test results of the multiple cases to be tested according to the monitoring configuration result while the multiple cases to be tested are executed in parallel;
the process of executing the to-be-tested use case on the child node server specifically comprises the following steps:
initializing a browser driver on a child node server, loading test data and determining parameters of the to-be-tested case;
then calling corresponding service components according to a preset service operation method and executing corresponding service processes;
calling a method of the assertion class and verifying a test result of a to-be-tested case according to the method of the assertion class;
wherein, executing the corresponding business process specifically comprises:
calling a preset page object to execute a corresponding business process;
the page object is formed by calling an element object class in advance and then packaging corresponding elements according to the element object class;
the service component is formed by calling methods in the class in advance and then packaging corresponding service scenes according to the methods in the class.
2. The WAP user interface testing method of claim 1, further comprising:
and the Selenium Grid controls the browser driver of each case to be tested to use the same thread in the execution process.
3. The WAP user interface testing method of claim 1, further comprising:
and when the test result of the to-be-tested case is verified to be failed, the testNG controls the to-be-tested case with the test result failed to be verified to be executed on the child node server again.
4. The WAP user interface testing method of claim 1, further comprising:
and generating a corresponding report according to the monitoring condition of the test result of the plurality of test cases to be tested.
5. The WAP user interface test method of claim 1, wherein the execution of the use cases to be tested is in units of classes, wherein each class includes a plurality of methods, each method corresponding to one use case to be tested.
6. The WAP user interface test method of claim 1, wherein the execution of the use cases to be tested is in units of methods, each method corresponding to one use case to be tested.
CN201711477167.7A 2017-12-29 2017-12-29 WAP user interface test method Active CN107908569B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711477167.7A CN107908569B (en) 2017-12-29 2017-12-29 WAP user interface test method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711477167.7A CN107908569B (en) 2017-12-29 2017-12-29 WAP user interface test method

Publications (2)

Publication Number Publication Date
CN107908569A CN107908569A (en) 2018-04-13
CN107908569B true CN107908569B (en) 2021-06-18

Family

ID=61872063

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711477167.7A Active CN107908569B (en) 2017-12-29 2017-12-29 WAP user interface test method

Country Status (1)

Country Link
CN (1) CN107908569B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804311B (en) * 2018-05-07 2022-06-03 微梦创科网络科技(中国)有限公司 Method and device for executing test file
CN110262967A (en) * 2019-06-05 2019-09-20 微梦创科网络科技(中国)有限公司 A kind of log-output method and device applied to automatic test
CN112395182A (en) * 2019-08-14 2021-02-23 中国联合网络通信集团有限公司 Automatic testing method, device, equipment and computer readable storage medium
CN111338930A (en) * 2019-12-19 2020-06-26 烽火通信科技股份有限公司 Automatic test system and method based on multiple processes and multiple tenants
CN112446604A (en) * 2020-11-20 2021-03-05 北京思特奇信息技术股份有限公司 Marketing activity production method and system based on business components
CN113010412A (en) * 2021-02-05 2021-06-22 成都库珀区块链科技有限公司 Automatic regression testing method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103984628A (en) * 2014-05-15 2014-08-13 中国南方航空股份有限公司 Automatic function test method and system applied to BS (browser/server) framework
US8874969B2 (en) * 2012-07-09 2014-10-28 Microsoft Corporation Independent hit testing
CN105095077A (en) * 2015-07-17 2015-11-25 北京奇虎科技有限公司 Automated testing method and device for user interfaces

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8874969B2 (en) * 2012-07-09 2014-10-28 Microsoft Corporation Independent hit testing
CN103984628A (en) * 2014-05-15 2014-08-13 中国南方航空股份有限公司 Automatic function test method and system applied to BS (browser/server) framework
CN105095077A (en) * 2015-07-17 2015-11-25 北京奇虎科技有限公司 Automated testing method and device for user interfaces

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
吕茜.基于WebDriver和TestNG的网页自动化测试方法.《软件》.2016,第37卷(第12期),第69-73页. *
基于WebDriver和TestNG的网页自动化测试方法;吕茜;《软件》;20161231;第37卷(第12期);第69-73页 *
面向对象分布式Web自动化实现;高玉军;《软件》;20131130;第34卷(第11期);第86-88,99页 *

Also Published As

Publication number Publication date
CN107908569A (en) 2018-04-13

Similar Documents

Publication Publication Date Title
CN107908569B (en) WAP user interface test method
US10884897B2 (en) Integrating synthetic performance measurements with continuous delivery pipelines
CN108959068B (en) Software interface testing method, device and storage medium
US20140289418A1 (en) Methods and systems for planning execution of an application in a cloud computing system
US20200019488A1 (en) Application Test Automate Generation Using Natural Language Processing and Machine Learning
US10802953B2 (en) Test plan generation using machine learning
US10810502B2 (en) Computing architecture deployment configuration recommendation using machine learning
US9898396B2 (en) Automated software testing and validation via graphical user interface
US10042744B2 (en) Adopting an existing automation script to a new framework
US10540150B2 (en) Composable context menus
US11797427B2 (en) Automatic generation of unit tests while running an application
da Silveira et al. Generation of scripts for perfomance testing based on UML models
US20180336115A1 (en) Evaluating fairness in devices under test
CN104391686A (en) Flow control method and device
US11055205B1 (en) Regression testing using automation technologies
Masek et al. Systematic evaluation of sandboxed software deployment for real-time software on the example of a self-driving heavy vehicle
US11750471B2 (en) Method and apparatus for determining resource configuration of cloud service system
CN102810065B (en) For the method and system of loader module
CN107122205B (en) Installation time determining method and device for installation program
US11579959B2 (en) Systems and methods for margin based diagnostic tools for priority preemptive schedulers
US10606971B2 (en) Testing netlists based on singular independent signals
CN110008116B (en) Wechat webapp debugging method and device
CN113535590A (en) Program testing method and device
US20120005055A1 (en) Dynamic computation of roi for test automation
Petrus et al. Model-Based Test Case Minimization and Prioritization for Improved Early Fault Detection Capability

Legal Events

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

Effective date of registration: 20220111

Address after: 510000 Room 601, 128 Dingxin Road, Haizhu District, Guangzhou City, Guangdong Province (office only)

Patentee after: Vipshop (Guangzhou) Software Co.,Ltd.

Address before: 510000 No. 314, Fangcun Avenue, Liwan District, Guangzhou City, Guangdong Province

Patentee before: GUANGZHOU PINWEI SOFTWARE Co.,Ltd.

TR01 Transfer of patent right