CN111857702A - Method, device and equipment for realizing automation of webdriver json protocol UI - Google Patents

Method, device and equipment for realizing automation of webdriver json protocol UI Download PDF

Info

Publication number
CN111857702A
CN111857702A CN202010727933.6A CN202010727933A CN111857702A CN 111857702 A CN111857702 A CN 111857702A CN 202010727933 A CN202010727933 A CN 202010727933A CN 111857702 A CN111857702 A CN 111857702A
Authority
CN
China
Prior art keywords
webdriver
protocol
automation
json
jmeter
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.)
Pending
Application number
CN202010727933.6A
Other languages
Chinese (zh)
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.)
Shanghai Zhongtongji Network Technology Co Ltd
Original Assignee
Shanghai Zhongtongji Network 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 Shanghai Zhongtongji Network Technology Co Ltd filed Critical Shanghai Zhongtongji Network Technology Co Ltd
Priority to CN202010727933.6A priority Critical patent/CN111857702A/en
Publication of CN111857702A publication Critical patent/CN111857702A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention relates to a method, a device and equipment for realizing automation of a webdriver json protocol UI, and belongs to the technical field of UI automation. The tester can extend from the interface script to the UI script when using the test tool Jmeter. And the compiling of the UI automation use case is completed on the basis of no need or a small amount of compiling codes through a visual interface and a rich existing method, so that the participation and the efficiency of UI automation are improved.

Description

Method, device and equipment for realizing automation of webdriver json protocol UI
Technical Field
The invention belongs to the technical field of UI automation, and particularly relates to a method, a device and equipment for realizing automation of a webdriver json protocol UI.
Background
With the agile model and fast iterations of software development, automation has been driven deep into projects in order to maintain high availability of the project. Each iteration may have many use cases that require regression, so automation has become an essential part of the software project.
Currently, the high maintainability and the participation of UI automation are difficult problems, and many companies use a pure code self-writing framework mode. And a company builds a webpage through a test center, so that a tester can input keywords and the like through a visual interface, and then calls the written codes at the bottom layer.
However, although the code frame built by the self has flexibility and maintainability, a person with strong programming ability is required to operate the code frame, for example, many companies send a person with a code base to maintain the bottom layer frame, so that a tester familiar with the service writes a corresponding use case through some packaged keywords or excels or a certain template, the participation is not high, and the packages are all five-fold, and the flexibility and the participation cannot be considered simultaneously. If the mode of providing the test middle desk page by building the webpage needs larger cost, and testers need to be familiar with a plurality of customized keywords and using methods. These approaches may be different for each company and the learned content may not be available across companies or platforms.
Therefore, how to improve the convenience of UI automation becomes a problem to be solved urgently in the prior art.
Disclosure of Invention
In order to at least solve the above problems in the prior art, the present invention provides a method, an apparatus, and a device for implementing UI automation of webdriver json protocol, so as to implement UI automation more conveniently and quickly.
The technical scheme provided by the invention is as follows:
on one hand, a method for realizing automation of a webdriver json protocol UI comprises the following steps:
packaging an http request based on a webdriver json protocol;
based on the Jmeter, packaging the webdriver json protocol to obtain a target Jmeter;
and realizing UI automation based on the interface of the target Jmeter.
Optionally, the encapsulating http request based on the webdriver json protocol includes:
and packaging the http request based on the protocol specification of the bottom foundation of the webdriver json protocol.
Optionally, the interface based on the target meter realizes UI automation, including:
and sending Json to a selenium remote server according to the target Jmeter, thereby realizing UI automation.
Optionally, the encapsulating http request based on the protocol specification of the bottom foundation of the webdriver json protocol includes:
starting a remote server;
acquiring a protocol specification of a bottom foundation of the webdriver json protocol based on the remote server;
and packaging the http request according to the protocol specification of the bottom foundation of the webdriver json protocol.
Optionally, the method further includes:
and acquiring a target plug-in based on the target meter.
In another aspect, an apparatus for implementing automation of webdriver json protocol UI includes: the system comprises a packaging module and an operation module;
the encapsulation module is used for encapsulating the http request based on a webdriver json protocol; based on the Jmeter, packaging the webdriver json protocol to obtain a target Jmeter;
and the operation module is used for realizing UI automation based on the interface of the target Jmeter.
Optionally, the encapsulation module is configured to: and packaging the http request based on the protocol specification of the bottom foundation of the webdriver json protocol.
Optionally, the running module is configured to: and sending Json to a selenium remote server according to the target Jmeter, thereby realizing UI automation.
Optionally, the encapsulation module is configured to: starting a remote server; acquiring a protocol specification of a bottom foundation of the webdriver json protocol based on the remote server; and packaging the http request according to the protocol specification of the bottom foundation of the webdriver json protocol.
In another aspect, an apparatus for implementing webdriver json protocol UI automation includes: a processor, and a memory coupled to the processor;
the memory is used for storing a computer program at least used for executing any one of the above methods for realizing the automation of the webdriver json protocol UI;
the processor is used for calling and executing the computer program in the memory.
The invention has the beneficial effects that:
according to the method, the device and the equipment for realizing the UI automation of the webdriver json protocol, provided by the embodiment of the invention, the Jmeter is used for carrying out the UI automation encapsulation, so that the popularization and participation of the UI automation are improved, and the threshold of a tester in compiling the UI automation script is reduced. The tester can extend from the interface script to the UI script when using the test tool Jmeter. And the compiling of the UI automation use case is completed on the basis of no need or a small amount of compiling codes through a visual interface and a rich existing method, so that the participation and the high efficiency of the UI automation are improved
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 schematic flowchart of a method for implementing automation of a webdriver json protocol UI according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a device for implementing automation of a webdriver json protocol UI according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for implementing automation of a webdriver json protocol UI according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. 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 examples given herein without any inventive step, are within the scope of the present invention.
In order to at least solve the technical problem provided by the present invention, an embodiment of the present invention provides a method for implementing automation of a webdriverjson protocol UI.
Fig. 1 is a schematic flow chart of a method for implementing automation of a webdriver json protocol UI according to an embodiment of the present invention, and referring to fig. 1, the method according to the embodiment of the present invention may include the following steps:
and S11, encapsulating the http request based on the webdriver json protocol.
S12, based on the Jmeter, packaging the webdriver json protocol to obtain a target Jmeter;
and S13, realizing UI automation based on the interface of the target meter.
The UI, which is a short name of User Interface, refers to an operation Interface of a User, and includes a mobile APP, a web page, an intelligent wearable device, and the like. Jmeter is an existing test tool.
Optionally, the UI automation is implemented based on the interface of the target meter, including: and sending Json to a selenium remote server according to the target Jmeter, thereby realizing UI automation.
In the embodiment of the invention, the webdriver Json protocol and the Jmeter are combined, so that Json is sent to a selenium remote server by the Jmeter to realize UI automation. As a plurality of practical methods are packaged by Jmeter as a tool widely used in the test field, Jmeter can be directly and conveniently used, and in addition, a webdriver json protocol is packaged to carry out UI automation, so that testers can write automation scripts very quickly and efficiently when entering the home.
Optionally, the http request is encapsulated based on webdriver json protocol, and the encapsulating includes: and packaging the http request based on the protocol specification of the bottom foundation of the webdriver json protocol.
For example, the essence of selenium is actually webdriver json protocol (https:// www.w.3. org/TR/webdriver /), which is actually an http request through which interaction with the browser is made. In this embodiment, the http request is encapsulated based on webdriver json protocol.
Optionally, the http request is encapsulated based on a protocol specification of a bottom layer basis of the webdriver json protocol, including: starting a remote server; acquiring a protocol specification of a bottom foundation of a webdriver json protocol based on a remote server; and packaging the http request according to the protocol specification of the bottom foundation of the webdriver json protocol.
For example, the present embodiment provides a specific example:
a remote server is started, and the starting website can be: java-dwebdriver. chrome. driver: "chrome. exe" -jarseliunium-server-standalone-2. xx.0. jar.
In this embodiment, the bottom layer connection, that is, the protocol specification of the bottom layer base, may be opened, for example:http://localhost:4444/wd/hub/static/resource/hub.html。
and (3) creating session: posthttp://127.0.0.1: 4444/wd/hub/session. WhereinSession is a mechanism to record the client state, and Session is stored in the server.
Open hundred degrees and send
Post http://localhost:4444/wd/hub/session/85a32b0f-e617-449a-bcea-8c84ffa2c5f4/url。
{
"url":"http://www.baidu.com"
}
findElement By id:
Sending
Post http://localhost:4444/wd/hub/session/85a32b0f-e617-449a-bcea-8c84ffa2c5f4/element。
{
"using":"id",
"value":"kw"
}
In the embodiment of the invention, all the selenium api essentially interacts by sending an http request to the selenium server. Only the selenium api encapsulates a layer forming its own api on the basis thereof, e.g.
Get (), webdriver, findElementById (), sendkeys (), etc
Optionally, the method further includes: and acquiring the target plug-in based on the target meter.
Specifically, the Jmeter has a very good encapsulation function, all webdriverjson protocols (https:// www.w.3. org/TR/webdriver /) can be encapsulated in the Jmeter, the abstract function abstract classes provided by the Jmeter can be encapsulated into an extension function, or the abstract JavaSamplerClient is integrated in Java Sampler, even the abstract SamplerGUI forms a plug-in, and the like, and after the plug-in is formed, the Jmeter is convenient for cross-company use.
In this embodiment, the packaged keywords or methods may be directly combined with existing functions in the meter. For example, the Jmeter has very convenient functions of response judgment, response interception, parameterization, database connection and the like, and is familiar to ordinary testers. And the driving of the browser can be performed by combining keywords or a method after the webdriver json protocol is packaged by a Jmeter, so that testers can enter the browser quickly and conveniently, and even the UI automation can be realized without writing codes. The Jmeter also has a concurrency function, and can conveniently test multiple threads.
The method for realizing automation of the webdriver json protocol UI provided by the embodiment of the invention provides a method which does not need to build a middle platform page, can realize automation of the selenium UI by using a Jmeter tool familiar to testers, can be maintained in a plug-in mode, can be used in a cross-company and cross-platform manner, and has very good flexibility under the condition that the packaged functions are combined with the Jmeter.
According to the method for realizing the automation of the webdriver json protocol UI, the Jmeter is used for carrying out the UI automation encapsulation, so that the popularization and participation of the UI automation are improved, and the threshold of a tester in compiling the UI automation script is reduced. The tester can extend from the interface script to the UI script when using the test tool Jmeter. And the compiling of the UI automation use case is completed on the basis of no need or a small amount of compiling codes through a visual interface and a rich existing method, so that the participation and the efficiency of UI automation are improved.
Based on a general inventive concept, the embodiment of the invention also provides a device for realizing the automation of the webdriver json protocol UI.
Fig. 2 is a schematic structural diagram of a device for implementing automation of a webdriver json protocol UI according to an embodiment of the present invention, and referring to fig. 2, the device according to the embodiment of the present invention may include the following structures: 6. an encapsulation module 21 and an operation module 22;
the encapsulation module 21 is used for encapsulating the http request based on the webdriver json protocol; based on the Jmeter, packaging a webdriver json protocol to obtain a target Jmeter;
and the operation module 22 is used for realizing UI automation based on the interface of the target Jmeter.
Optionally, the encapsulation module 21 is configured to: and packaging the http request based on the protocol specification of the bottom foundation of the webdriver json protocol.
Optionally, the operation module 22 is configured to: and sending Json to a selenium remote server according to the target Jmeter, thereby realizing UI automation.
Optionally, the encapsulation module 21 is configured to: starting a remote server; acquiring a protocol specification of a bottom foundation of a webdriverjson protocol based on a remote server; according to the protocol specification of the bottom layer foundation of the webdriver json protocol, the http request is encapsulated
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
According to the method for realizing the automation of the webdriver json protocol UI, the Jmeter is used for carrying out the UI automation encapsulation, so that the popularization and participation of the UI automation are improved, and the threshold of a tester in compiling the UI automation script is reduced. The tester can extend from the interface script to the UI script when using the test tool Jmeter. And the compiling of the UI automation use case is completed on the basis of no need or a small amount of compiling codes through a visual interface and a rich existing method, so that the participation and the efficiency of UI automation are improved.
Based on a general inventive concept, the embodiment of the invention also provides equipment for realizing the automation of the webdriver json protocol UI.
Fig. 3 is a schematic structural diagram of an apparatus for implementing automation of a webdriver json protocol UI according to an embodiment of the present invention, and referring to fig. 3, the apparatus for implementing automation of a webdriver json protocol UI according to an embodiment of the present invention includes: a processor 31, and a memory 32 connected to the processor.
The memory 32 is used for storing a computer program, and the computer program is at least used for the method for realizing the webdriver json protocol UI automation described in any of the above embodiments;
the processor 31 is used to invoke and execute the computer program in the memory.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.
It is understood that the same or similar parts in the above embodiments may be mutually referred to, and the same or similar parts in other embodiments may be referred to for the content which is not described in detail in some embodiments.
It should be noted that the terms "first," "second," and the like in the description of the present invention are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present invention, the meaning of "a plurality" means at least two unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. A method for realizing automation of a webdriver json protocol UI is characterized by comprising the following steps:
packaging an http request based on a webdriver json protocol;
based on the Jmeter, packaging the webdriver json protocol to obtain a target Jmeter;
and realizing UI automation based on the interface of the target Jmeter.
2. The method of claim 1, wherein encapsulating http requests based on webdriver json protocol comprises:
and packaging the http request based on the protocol specification of the bottom foundation of the webdriver json protocol.
3. The method of claim 1, wherein the interface based on the target meter implements UI automation, comprising:
and sending Json to a selenium remote server according to the target Jmeter, thereby realizing UI automation.
4. The method of claim 2, wherein encapsulating http requests based on a protocol specification underlying the webdriver json protocol comprises:
starting a remote server;
acquiring a protocol specification of a bottom foundation of the webdriver json protocol based on the remote server;
and packaging the http request according to the protocol specification of the bottom foundation of the webdriver json protocol.
5. The method of claim 1, further comprising:
and acquiring a target plug-in based on the target meter.
6. A device for realizing automation of a webdriver json protocol UI is characterized by comprising: the system comprises a packaging module and an operation module;
the encapsulation module is used for encapsulating the http request based on a webdriver json protocol; based on the Jmeter, packaging the webdriver json protocol to obtain a target Jmeter;
and the operation module is used for realizing UI automation based on the interface of the target Jmeter.
7. The apparatus of claim 6, wherein the encapsulation module is to: and packaging the http request based on the protocol specification of the bottom foundation of the webdriverjson protocol.
8. The method of claim 1, wherein the execution module is to: and sending Json to a selenium remote server according to the target Jmeter, thereby realizing UI automation.
9. The method of claim 1, wherein the encapsulation module is configured to: starting a remote server; acquiring a protocol specification of a bottom foundation of the webdriver json protocol based on the remote server; and packaging the http request according to the protocol specification of the bottom foundation of the webdriver json protocol.
10. An apparatus for implementing automation of a webdriver json protocol UI, comprising: a processor, and a memory coupled to the processor;
the memory is used for storing a computer program at least for executing the method for realizing the automation of the webdriver json protocol UI as claimed in any one of claims 1-5;
the processor is used for calling and executing the computer program in the memory.
CN202010727933.6A 2020-07-23 2020-07-23 Method, device and equipment for realizing automation of webdriver json protocol UI Pending CN111857702A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010727933.6A CN111857702A (en) 2020-07-23 2020-07-23 Method, device and equipment for realizing automation of webdriver json protocol UI

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010727933.6A CN111857702A (en) 2020-07-23 2020-07-23 Method, device and equipment for realizing automation of webdriver json protocol UI

Publications (1)

Publication Number Publication Date
CN111857702A true CN111857702A (en) 2020-10-30

Family

ID=72950222

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010727933.6A Pending CN111857702A (en) 2020-07-23 2020-07-23 Method, device and equipment for realizing automation of webdriver json protocol UI

Country Status (1)

Country Link
CN (1) CN111857702A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150052256A1 (en) * 2013-08-15 2015-02-19 Unisys Corporation Transmission of network management data over an extensible scripting file format
CN111274153A (en) * 2020-02-14 2020-06-12 香港乐蜜有限公司 Automatic testing method and device and electronic equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150052256A1 (en) * 2013-08-15 2015-02-19 Unisys Corporation Transmission of network management data over an extensible scripting file format
CN111274153A (en) * 2020-02-14 2020-06-12 香港乐蜜有限公司 Automatic testing method and device and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SWEEEEEET: "【软件测试】selenium与webdriver详解", pages 1 - 5, Retrieved from the Internet <URL:https://blog.csdn.net/weixin_42962924/article/details/89668260> *
雨点小: "使用WebDriver采样器将JMeter与Selenium集成", pages 1 - 6, Retrieved from the Internet <URL:博客园,https://www.cnblogs.com/yudx/p/12966846.html> *

Similar Documents

Publication Publication Date Title
US11188310B2 (en) Automatically generating an interface description in an interface description language
CN111176626B (en) Cross-programming-language code calling method and device, medium and equipment
US8239839B2 (en) Asynchrony debugging using web services interface
US11762763B2 (en) Orchestration for automated performance testing
CN109643252B (en) Middleware interface and middleware interface generator
US20070168971A1 (en) Multi-tiered model-based application testing
US7657789B1 (en) Multi-machine testing system and method for testing software
CN107608901B (en) Jmeter-based testing method and device, storage medium and electronic equipment
US20090164981A1 (en) Template Based Asynchrony Debugging Configuration
US20140289738A1 (en) Systems and Methods for Dynamic Configuration of Client-Side Development Environments Through Use of Application Servers
CN111444111A (en) Performance testing method and device based on python, computer equipment and storage medium
US11023558B1 (en) Executing functions on-demand on a server utilizing web browsers
US20110161395A1 (en) Synthetic transaction monitoring and management of scripts
US20120089931A1 (en) Lightweight operation automation based on gui
US20140123114A1 (en) Framework for integration and execution standardization (fiesta)
CN103605527A (en) System and method for realizing cloud computing application interface integration and unified style display
US20230401058A1 (en) Semantic functional wrappers of services
WO2020177519A1 (en) Debugging method executed on smart terminal and software debugging device
CN110188308B (en) Client automatic dotting reporting method, storage medium, equipment and system
CN114116509A (en) Program analysis method, program analysis device, electronic device, and storage medium
US7865880B2 (en) System and/or method for implementing efficient techniques for testing common information model providers
CN109634758A (en) Method and middleware platform based on JSON document control event and behavior
CN102739806A (en) VXI-11 network automatic discovery method for LXI instrument on basis of DSP (Digital Signal Processor)/BIOS (Basic Input Output System) operation system
CN111857702A (en) Method, device and equipment for realizing automation of webdriver json protocol UI
CN202143098U (en) Intelligent mobile phone open cross-platform system based on cloud computing

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