LoadRunner calling QTP script to implement performance testing

Source: Internet
Author: User

An email made me have to work overtime on weekends to study how to simulate the actual production environment. The general demand is based on the Reading section number and the electricity year to inquire the user's payment situation under the Reading section, a reading section has hundreds of to 2000 users. It is necessary to query the payment status of users under different reading sections, and then print the payment status of each user under the Reading section in turn.

For such a problem, I want to start a good solution, as long as the script to add a loop control statement is good, but the actual test only know, LoadRunner in the data to the server when there is an ID is not regular, immediately bored a bit, before the idea so desperate. After careful consideration, the print invoice is each computer directly connected to a printer, that is, can not be simulated by a script, need to make the scripts distributed, the script needs to control on each machine running. This allows each script to be relatively independent. So I think of QTP, using QTP to write scripts, with LoadRunner to control the execution of scripts, so as to meet the needs of the field.

Attached: The QTP script is as follows:

Systemutil.closeprocessbyname "Iexplore.exe" Systemutil.run "Iexplore.exe", "http://172.19.201.188:7001/web/" set Childobjects = CreateObject ("Scripting.Dictionary") with Childobjects. Add "Browser", Browser ("creationtime:=0"). Add "Page",. Item ("Browser"). Page ("Index:=0"). Add "Username",. Item ("Page"). Webedit ("Name:=username"). Add "Password",. Item ("Page"). Webedit ("Name:=password"). Add "Submit",. Item ("Page"). Image ("Index:=0"). Add "Frame",. Item ("page"). Frame ("Name:=barframe"). Add "Linkmenu",. Item ("Frame"). Link ("text:= Tariff collection and marketing account Management"). Add "Linkitem",. Item ("Frame"). Link ("text:= Customer payment Management", "index:=0"). Add "Treemenuframe",. Item ("page"). Frame ("Name:=treemenuframe"). Add "Webtable",. Item ("Treemenuframe"). Webtable ("text:= my desktop support. *", "index:=0"). Add "PageFrame",. Item ("page"). Frame ("Name:=pageframe", "index:=1"). Add "Mrsectno",. Item ("PageFrame"). Webedit ("Name:=mrsectno"). Add "Rcvblym",. ITEM ("PageFrame"). Webedit ("Name:=rcvblym"). Add "Webbutton",. Item ("PageFrame"). Webbutton ("name:= query") End Withchildobjects.item ("Username"). Set "YYY" Childobjects.item ("Password"). Set "1" Childobjects.item ("Submit"). Clickchildobjects.item ("Linkmenu"). Click Childobjects.item ("Linkitem"). Click Childobjects.item ("Webtable"). ChildItem ("Image", 192). Clickchildobjects.item ("Mrsectno"). Set "0000006511" Childobjects.item ("Rcvblym"). Set "201211" Childobjects.item ("Webbutton"). Clickservices.starttransaction "Start" with Browser ("creationtime:=0"). Page ("Index:=0") for n= 1 to. Frame ("Name:=pageframe", "index:=1"). Webedit ("Name:=tatolrecord"). Getroproperty ("value"). Frame ("Name:=pageframe", "index:=1"). WebCheckBox ("index:=" &n). Set "on". Frame ("Name:=pageframe", "index:=1"). Webbutton ("name:= Print Invoice"). Click Set wsh=createobject ("Wscript.Shell") Wsh.sendkeys "^+{f4}". Frame ("Name:=pageframe", "index:=1"). WebCheckBox ("index:=" &n).   Set "OFF" NextEnd withservices.endtransaction "Start" 

Note: To run the qtp script in LoadRunner, you need to set up transactions in the QTP script, such as: Services.starttransaction "Start" and services.endtransaction "start"
The steps to invoke the QTP script in LoadRunner are as follows:
1, install LoadRunner, QTP Tools on each machine.

2, QTP on each machine, tick Tools--options--run "alow other Mercury products to run tests and components" setting.

3, each terminal must open loadrunner LR agent process and QTP toos-remote Agent service.

4. After starting the LoadRunner, select the QTP script in the LR runtime and store the file with a. usr file name extension for the QTP script. Note: When running QTP scripts in LoadRunner, there can only be one GUI VUser

5. Add different groups, and each group's scripts are executed by the remote machine.

After completing the above steps and setting the scene, you can run the scene in the LoadRunner console, so that you can see that each terminal calls the QTP script to execute the automated tests concurrently, which also achieves one of our concurrent and cyclic testing purposes.

LoadRunner calling QTP script to implement performance testing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.