CN105847328A - Method for carrying out data transmission interaction for Http protocol based on QTP - Google Patents

Method for carrying out data transmission interaction for Http protocol based on QTP Download PDF

Info

Publication number
CN105847328A
CN105847328A CN201610145198.1A CN201610145198A CN105847328A CN 105847328 A CN105847328 A CN 105847328A CN 201610145198 A CN201610145198 A CN 201610145198A CN 105847328 A CN105847328 A CN 105847328A
Authority
CN
China
Prior art keywords
qtp
data
http
dll program
interface
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.)
Granted
Application number
CN201610145198.1A
Other languages
Chinese (zh)
Other versions
CN105847328B (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.)
Fujian Xinghai Communication Technology Co Ltd
Original Assignee
Fujian Xinghai Communication 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 Fujian Xinghai Communication Technology Co Ltd filed Critical Fujian Xinghai Communication Technology Co Ltd
Priority to CN201610145198.1A priority Critical patent/CN105847328B/en
Publication of CN105847328A publication Critical patent/CN105847328A/en
Application granted granted Critical
Publication of CN105847328B publication Critical patent/CN105847328B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content

Abstract

The invention provides a method for carrying out data transmission interaction for an Http protocol based on QTP. The method comprises the steps of designing an external script and a DLL program and carrying out data transmission interaction for the Http protocol by calling the external script and the DLL program through the QTP; carrying out class encapsulation in a QTP mode for functions in the DLL program by the external script; obtaining a request and response data from the Http protocol by the DLL program and carrying out corresponding gzip decompression for the obtained data; and providing an interface which is open and can be called by the QTP, wherein the DLL program transmits the data content of the gzip decompression to the QTP through the interface, so that the QTP can obtain the data content for corresponding data verification and data transmission operations. According to the method for carrying out data transmission interaction for the Http protocol based on QTP, efficient support from the QTP can be carried out for the Http protocol, lots of automatic designs can be expanded and extended based on the realization of the method, and the QTP is no longer limited to a UI test.

Description

Based on QTP, Http agreement is carried out data transmission mutual method
Technical field
The present invention relates to communication technique field, particularly relate to one based on QTP to Http agreement number According to the method that transmission is mutual.
Background technology
Automated execution refers to the automated test tool utilizing Hewlett-Packard Corporation of Hewlett-Packard to provide QuickTestProfessional (is called for short QTP), and it is manual that it realizes carrying out analog subscriber by interface UI operation Operation, and the result data representing program obtains thus verified by code, which can reduce User's workload in regression test, also reduces company's test in this respect and puts into.
The shortcoming existed:
1, software interface is mainly controlled to carry out triggering background function realization by QTP at automatic test, Also support webservices (interface of system external), but number is transmitted for some other procotols The most well support according to acquisition aspect.
Although 2, QTP use VBS script can carry out Transmission Control Protocol transmission realize Http agreement, But itself compatibility is not fine, and also cannot process very well for gzip data compression in Http.
Summary of the invention
The technical problem to be solved in the present invention, is to provide one based on QTP to Http agreement number According to the method that transmission is mutual, QTP is made can Http agreement effectively to be supported, and on the basis of it realizes Can be with a lot of the Automation Design of extending, it is possible to make QTP be no longer limited to UI test.
The present invention is achieved in that and a kind of carries out data transmission mutual based on QTP to Http agreement Method, described method is: design an external scripts and a DLL program, by QTP call described outside Http agreement is carried out data transmission alternately by portion's script and DLL program;
Described external scripts carries out the class wrapper of QTP mode to function in DLL program, and processes number Realization according to transmission;
Request and the response data of Http agreement are obtained by described DLL program, and to acquired number According to carrying out corresponding gzip decompression;And provide opening to be available for the interface that QTP calls, described DLL program The data content that gzip decompresses is transferred to QTP by described interface, makes QTP can obtain this part number Corresponding data verification and data transfer operation is carried out according to content.
Further, described DLL program concrete implementation mode is: at the beginning of DLL program advanced person's row data Beginningization, the URL of analyzing web page website, checking web sites IP port is the most effective, invalid, then tie Line journey, effectively, then whether checking web sites URL is effective, invalid, then terminate flow process, effectively, Then arrange http head and send request to server together with web sites data, it is judged that whether server rings Should;No, then terminate flow process, be, then obtain server response data, it is judged that the response data of acquisition is No needs decompress, no, then terminate flow process, be, then data decompression carry out Data Format Transform, It is the data form that QTP supports by Data Format Transform.
Further, described is the data form that QTP supports by Data Format Transform, is UTF Form is converted to ASCLL and Unicode format.
Further, described provide open and be available for the interface that QTP calls, the establishment of this interface particularly as follows: 1) initializing the multi-link container of Http: InitializeHttp container, this container is asked for supporting that many Http connect Ask, and make each request data response will not entanglement, need to be managed by container;
2) Http object: CreateHttp is created;One Http pair is created by the function of DLL program is internal As, and return this object unique ID in a reservoir, follow-up made requests on operation by this ID;
3) Http head: AddHeader is added;Needed for this Http head is support different browsers or language Http head, will be designed as self-defined head mode herein and manage;
4) request of data: SendHttpRequest;This request of data is the request of Http key data, request Time can attach the Http head added;
5) server response: GetHttpRequest is obtained;This GetHttpRequest is to obtain HTTP clothes Business device response data interface, carry out obtaining/decompress/change operation after, internal preserve;
6) service end response data length and class are obtained Hold: GetRequestValue/GetRequestValueLength, obtain the last interface data preserved, and Return ginseng to QTP parameter.
Further, described external scripts specific implementation is: initialize the function in DLL program, Initialize the container in DLL program, create the inside unique ID of Http object acquisition of external scripts, logical Cross ID encapsulate each interface and be supplied to QTP and call.
Present invention have the advantage that 1, QTP can be supported Http agreement aspect interface testing;
2, can support BS (Browser/Server, Browser/Server Mode) backstage ajax (is created The web development technologies of interaction network page application) data of this respect verify;
3, expansible use QTP carries out the functional safety checkings such as SQL injection attacks;
4, facilitating QTP to Http request call, the dress envelope class interface that only need to use QTP mode when calling is straight Tap into row http request of data, be not required to consider its specific implementation.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of DLL program concrete implementation.
Fig. 2 is the schematic flow sheet that external scripts implements.
Detailed description of the invention
Referring to shown in Fig. 1 and Fig. 2, the one of the present invention carries out data based on QTP to Http agreement Transmitting mutual method, described method is: designs an external scripts and a DLL program, passes through QTP Call described external scripts and Http agreement is carried out data transmission alternately by DLL program;
Described external scripts carries out the class wrapper of QTP mode to function in DLL program, and processes number Realization according to transmission;
Request and the response data of Http agreement are obtained by described DLL program, and to acquired number According to carrying out corresponding gzip decompression;And provide opening to be available for the interface that QTP calls, described DLL program The data content that gzip decompresses is transferred to QTP by described interface, makes QTP can obtain this part number Corresponding data verification and data transfer operation is carried out according to content.
Wherein, described DLL program concrete implementation mode is: DLL program advanced person's row data initialization, The URL of analyzing web page website, checking web sites IP port is the most effective, invalid, then terminate flow process, Effectively, then checking web sites URL is the most effective, invalid, then terminate flow process, effectively, then arrange Http head sends request to server together with web sites data, it is judged that whether server responds;It is no, Then terminate flow process, be, then obtain server response data, it is judged that the response data of acquisition is the need of entering Row decompression, no, then terminate flow process, be, then data decompression carry out Data Format Transform, by data lattice Formula is converted to the data form that QTP supports;Described is the data lattice that QTP supports by Data Format Transform Formula, is and UTF form is converted to ASCLL and Unicode format.
Described providing open and is available for the interface that QTP calls, the establishment of this interface is particularly as follows: 1) initialize The multi-link container of Http: InitializeHttp container, this container is for supporting many Http connection request, and makes each Individual request data response will not entanglement, need to be managed by container;
2) Http object: CreateHttp is created;One Http pair is created by the function of DLL program is internal As, and return this object unique ID in a reservoir, follow-up made requests on operation by this ID;
3) Http head: AddHeader is added;Needed for this Http head is support different browsers or language Http head, will be designed as self-defined head mode herein and manage;
4) request of data: SendHttpRequest;This request of data is the request of Http key data, request Time can attach the Http head added;
5) server response: GetHttpRequest is obtained;This GetHttpRequest is to obtain HTTP clothes Business device response data interface, carry out obtaining/decompress/change operation after, internal preserve;
6) service end response data length and class are obtained Hold: GetRequestValue/GetRequestValueLength, obtain the last interface data preserved, and Return ginseng to QTP parameter.
Described external scripts specific implementation is: initialize the function in DLL program, initializes DLL Container in program, is created the inside unique ID of Http object acquisition of external scripts, is encapsulated by ID Each interface is also supplied to QTP and calls.I.e. provided DLL program by QTP code and connected URL completes to initialize, and external scripts afterwards, without special concrete steps, only need to install above-mentioned interface After sequentially ID, other Http interfaces can be carried out function encapsulation, be supplied to QTP code call.
This encapsulation class is added to project resource can such instantiation be adjusted for: QTP by calling of QTP With.
The foregoing is only presently preferred embodiments of the present invention, all according to scope of the present invention patent done equal Deng change and modification, the covering scope of the present invention all should be belonged to.

Claims (5)

1. one kind carries out data transmission mutual method based on QTP to Http agreement, it is characterised in that: Described method is: designs an external scripts and a DLL program, calls described external scripts by QTP With DLL program, Http agreement is carried out data transmission alternately;
Described external scripts carries out the class wrapper of QTP mode to function in DLL program, and processes number Realization according to transmission;
Request and the response data of Http agreement are obtained by described DLL program, and to acquired number According to carrying out corresponding gzip decompression;And provide opening to be available for the interface that QTP calls, described DLL program The data content that gzip decompresses is transferred to QTP by described interface, makes QTP can obtain this part number Corresponding data verification and data transfer operation is carried out according to content.
The most according to claim 1 based on QTP, Http agreement is carried out data transmission mutual Method, it is characterised in that: described DLL program concrete implementation mode is: DLL program advanced person's line number According to initialization, the URL of analyzing web page website, checking web sites IP port is the most effective, invalid, Then terminating flow process, effectively, then checking web sites URL is the most effective, invalid, then terminate flow process, Effectively, then arrange http head and send request to server together with web sites data, it is judged that server is No response;No, then terminate flow process, be, then obtain server response data, it is judged that the number of responses of acquisition According to the need of decompressing, no, then terminate flow process, be, then data decompression carry out data form and turn Change, be the data form that QTP supports by Data Format Transform.
The most according to claim 1 based on QTP, Http agreement is carried out data transmission mutual Method, it is characterised in that: described by Data Format Transform be QTP support data form, be by UTF form is converted to ASCLL and Unicode format.
The most according to claim 1 based on QTP, Http agreement is carried out data transmission mutual Method, it is characterised in that: described offer is open is available for the interface that QTP calls, the establishment tool of this interface Body is: 1) initialize the multi-link container of Http: InitializeHttp container, this container is for supporting many Http Connection request, and make each request data response will not entanglement, need to be managed by container;
2) Http object: CreateHttp is created;One Http pair is created by the function of DLL program is internal As, and return this object unique ID in a reservoir, follow-up made requests on operation by this ID;
3) Http head: AddHeader is added;Needed for this Http head is support different browsers or language Http head, will be designed as self-defined head mode herein and manage;
4) request of data: SendHttpRequest;This request of data is the request of Http key data, request Time can attach the Http head added;
5) server response: GetHttpRequest is obtained;This GetHttpRequest is to obtain HTTP clothes Business device response data interface, carry out obtaining/decompress/change operation after, internal preserve;
6) service end response data length and class are obtained Hold: GetRequestValue/GetRequestValueLength, obtain the last interface data preserved, and Return ginseng to QTP parameter.
The most according to claim 1 based on QTP, Http agreement is carried out data transmission mutual Method, it is characterised in that: described external scripts specific implementation is: initialize in DLL program Function, initializes the container in DLL program, and the inside Http object acquisition creating external scripts is unique ID, encapsulates each interface by ID and is supplied to QTP and calls.
CN201610145198.1A 2016-03-15 2016-03-15 Carry out data transmission interactive method to Http agreement based on QTP Expired - Fee Related CN105847328B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610145198.1A CN105847328B (en) 2016-03-15 2016-03-15 Carry out data transmission interactive method to Http agreement based on QTP

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610145198.1A CN105847328B (en) 2016-03-15 2016-03-15 Carry out data transmission interactive method to Http agreement based on QTP

Publications (2)

Publication Number Publication Date
CN105847328A true CN105847328A (en) 2016-08-10
CN105847328B CN105847328B (en) 2019-03-08

Family

ID=56587086

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610145198.1A Expired - Fee Related CN105847328B (en) 2016-03-15 2016-03-15 Carry out data transmission interactive method to Http agreement based on QTP

Country Status (1)

Country Link
CN (1) CN105847328B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106991276A (en) * 2017-03-17 2017-07-28 浙江大学 A kind of data-interface dynamic creation method based on openEHR templates

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101303664A (en) * 2008-06-19 2008-11-12 腾讯科技(深圳)有限公司 Professional quick test device and method
US20100095161A1 (en) * 2008-10-14 2010-04-15 Hana Giat Test tool for concurrent web services and user interface testing
US20100281467A1 (en) * 2009-04-29 2010-11-04 Hexaware Technologies, Inc. Method and apparatus for automatic software testing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101303664A (en) * 2008-06-19 2008-11-12 腾讯科技(深圳)有限公司 Professional quick test device and method
US20100095161A1 (en) * 2008-10-14 2010-04-15 Hana Giat Test tool for concurrent web services and user interface testing
US20100281467A1 (en) * 2009-04-29 2010-11-04 Hexaware Technologies, Inc. Method and apparatus for automatic software testing

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
XINBIAN WANG ET AL.: "The Research of Data-Driven Testing Based on QTP", 《THE 9TH INTERNATIONAL CONFERENCE ON COMPUTER SCIENCE & EDUCATION (ICCSE 2014)》 *
沈涵超: "QTP 中的对象库的设计、研究和实现", 《科技信息》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106991276A (en) * 2017-03-17 2017-07-28 浙江大学 A kind of data-interface dynamic creation method based on openEHR templates
CN106991276B (en) * 2017-03-17 2020-01-21 浙江大学 Data interface dynamic generation method based on openEHR template

Also Published As

Publication number Publication date
CN105847328B (en) 2019-03-08

Similar Documents

Publication Publication Date Title
US9331953B2 (en) Device management method, middleware, and machine-to-machine communications platform, device, and system
CN106972974B (en) A kind of the Web network management systems and its terminal authentication method of electric power LTE wireless terminals
CN105763619B (en) The method and device that client and server-side are communicated
CN106533813A (en) Method for remotely controlling upgrade of intelligent device
CN105138454B (en) A kind of automated testing method for B/S framework security softwares
WO2019204045A1 (en) System and method to securely execute datacenter management operations remotely
WO2017040931A1 (en) Methods and apparatus for enhancing native service layer device management functionality
CN107066276A (en) The method that a kind of FPGA device Remote configuration in communication equipment updates
CN105677397A (en) Method for optimizing PHP remote procedure call through local gateway program
CN111066014B (en) Apparatus, method, and program for remotely managing devices
US20140149561A1 (en) Integration framework system and method of providing integration framework
CN101699823B (en) Method for realizing caching resource in curl library
CN104410702A (en) Remote service request method, response method, request device and response device
CN102609353A (en) Method, device and system for managing program debugging
CN105847328A (en) Method for carrying out data transmission interaction for Http protocol based on QTP
CN106294119B (en) Test scheduling system and method and terminal equipment
CN107888451A (en) The method of testing and device of a kind of Web server
CN107018164B (en) Service processing method and device
CN107103058B (en) Big data service combination method and composite service combination method based on Artifact
CN106648805A (en) Intelligent device, intelligent system, and method for intelligently installing application
CN105453522B (en) Method and system for providing a function in a computer system of a vehicle
CN102693595A (en) Network cloud open terminal on-line invoice issuing method based on CSOI technology
CN102047650B (en) For method and the communication equipment for this reason of operational communications equipment
KR101399800B1 (en) Service providing method and system for instance hosting
CN102594587A (en) Embedded WEB debugging and testing maintenance method and debugging and testing maintenance system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20190308

Termination date: 20200315