|
QTP - Capturing tool tips of images
2008-06-01 13:27:00 In my previous post (QTP - How to capture tool tip?) I shown an example on capturing tool tip of Web page link.That solution uses FireEvent("onmouseover") and GetROProperty("text") to get tool tip of a link.Now, I'm going to show how to show how to capture tool tips of images located on a Web page.Actually, the solution is simple.To capture a tool tip of an image, we can get value of "alt" Run-time Object property with GetROProperty("alt") function:Browser("brw").Page("p-g").GetROProperty("alt")Let's verify this code in practice. For example, let's check tooltips from Wikipedia Main page:I've prepared QTP script, which gets all image from this page and checks their tooltips ("alt" property):Dim descImage, listImages, attrAltText, attrSrcTextBrowser("Main Page - Wikipedia,").SyncBrowser("Main- Page - Wikipedia,").Page("Main Page - Wikipedia,").Sync' Create description for all images on a Web page.' For that we use "html tag" property and its value "IMG"Set descImage = Description...
How to save parameter value to other parameter in LoadRunner?
2008-06-01 11:36:00 One my reader asked me - "How to save parameter value to other parameter in LoadRunner?". OK, there is a simple solution.To save parameter value to other parameter you have to:Evaluate value of initial parameterUse lr_eval_string LoadRunner function.Save the evaluated string to a second parameterUse lr_save_string LoadRunner function.Please, check the following code:// save string value to initial parameterlr_save_string("some string value", "prmStr1");lr_output_message(lr-_eval_string("Value of prmStr1: {prmStr1}"));// save the evaluated value to second parameterlr_save_string(lr_eval-_string("{prmStr1}"), "prmStr2");lr_output_message(lr-_eval_string("Value of prmStr2: {prmStr2}"));Let's execute this code and check the result:(click the image to enlarge it)As you can see, both parameters (prmStr1 & prmStr2) have the same values - "some string value".So, we assigned the parameter value to other parameter successfully.Related articles:How to perform basic operations on LoadRunner p...
How to get unique file name in LoadRunner?
2008-05-31 21:45:00 In my previous LoadRunner VIDEO post, I shown and explained how to record PDF file saving in LoadRunner.The provided code works correctly in LoadRunner VuGen or in LoadRunner Controller for one concurrent user. Here it is://Truncate to zero length or create file for writing.fp = fopen("c:\temp\_file.pdf","wb")-;//Process the data ... //Write the data to an output file.fwrite(bufData, nSize, 1, fp);If you try to run this code with several concurrent users, all of them will try to create the same file and write to it. As a result, this will led to the error.How to resolve this problem?Each user has to get unique file name and create a file with the unique name .Now, I'm going to show - how to generate unique file name in LoadRunner.The first step is to get a timestamp as a part of file name.The timestamp consists of:date (month, day, year)time (hours, minutes, seconds, milliseconds)You can use the following simple code to get a full timestamp without milliseconds:lr_save_datetime("-...
QTP Descriptive programming - processing images
2008-05-28 19:29:00 Imagine a practical situation with QuickTest Professional (QTP).There are several images on a web page. You need to:get the number of all images on the pageprocess each image (for example, get its location)Do you know how to do that? If not, do not sorrow :) I'm going to show and explain how to do that.Also, I'm going to explain QTP Descriptive Programming concepts.Let's start with Google Book Search page:I have recorded simple QTP script which:uses http://books.google.com as initial URLclicks 'Google Book Search' image:So, the recorded QTP script is:Browser("Google Book Search").Page("Google Book Search").Image("Google Book Search").ClickWhy have I recorded this script?Because it will help us to investigate QTP Object Repository (OR) and properties of image.Let's open Object Repository:And then we check image's properties saved in Object Repository:(click the image to enlarge it)Using "html tag" property and its value "IMG", we can create general description for all images o...
Automated testing without automated testing tools
2008-05-17 22:23:00 How many automated testing tools exist in the world?Hm... I think, hundreds - Selenium, QuickTest Professional, SilkTest, Jmeter, LoadRunner, STAF, Watir, Canoo WebTest, and so on...Is is possible to perform an automated testing without automated testing tools? Sure!I will show how to perform automated testing of web applications on Internet Explorer (IE) browser. The main advantage is that these tests can be run on any Windows computer without any additional sofware required.Let's see steps of sample test:Open IE and navigate to google.com:Set value of edit box to 'Easy way to automate testing':Click 'Google Search' button:If a search results page contains a link to this blog (http://motevich.blogspot.com)- then click this link:Last step is to close the IE windowI've automated this test with an instance of the InternetExplorer object.Details info about InternetExplorer object is located here.I hope, the source code of my test is clean and understandable. Here it is:Option&nbs...
QTP - How to capture tool tip?
2008-05-16 21:50:00 My friend asked me - How to capture a tool tip text in QTP?For example, how to get tool tip ('Go to My Yahoo!') from the yahoo page:This QTP tutorial shows and explains How to get tool tip in QuickTest Professional.Actually, this is not a difficult task. The steps are:Place mouse cursor over the linkWait for tool tipGet text of shown tool tipThis QTP script captures a text of a tool tip:' Place mouse cursor over the linkBrowser("Yahoo!").Page("Yah-oo!").WebElement("text:=My Yahoo!").FireEvent "onmouseover"wait 1' Grab tooltipToolTip = Window("nativeclass:=tooltips_c-lass32").GetROProperty("text")P-lease, pay attention on details:We use FireEvent("onmouseover") to simulate mouse placing over the linkFunction wait(1) waits 1 second for a tool tipTo get tool tip text, we use:Window("nativeclass:=toolti-ps_class32").GetROProperty("tex-t")Let's run our code and compare captured tool tip with expected ('Go to My Yahoo!'):As you can see, above QTP script captures correct text of a Tool ...
Examples on LoadRunner Regular Expressions
2008-05-01 08:11:00 I'm going to show and explain how to use Regular Expressions in LoadRunner.Introduction:The present article is a summarizing of the LoadRunner Regular Expressions challenge and its results. Also, I added code for RegExp patterns/subpatterns matching.All LoadRunner Regular Expressions functions are shown with examples.Outline: How to check - whether RegExp pattern matches against a text or notHow to get a matched strings (RegExp patterns and subpatterns)How to check - Whether RegExp pattern matches against a text or notI thanks Charlie Weiblen and Tim Koopmans for the solution. I modified it slightly.So, here it is: Download and unpack Binaries and Developer files for PCRE (Perl Compatible Regular Expressions).These and others files are available on Pcre for Windows page.Unzip downloaded archives into c:pcre?omment out the include for stdlib.h file in:C:pcreincludepcre.hC:pcreinc-ludepcreposix.hIn your LoadRunner script, add to globals.h:#include "c:\pcre\include\pcre.h"#in...-
LoadRunner RegExp - Challenge resolved
2008-04-27 20:26:00 Great news! The challenge, I posted about using Regular Exprassions in Loadrunner, has been resolved! I wondered - how to use RegExp in LoadRunner.The winner is Charlie Weiblen. Congratulations, Charlie! Hooray! :)He proposed the following solution - Regular Expressions in LoadRunner. Yes, it allows to use Regular expressions in LoadRunner and his solution works perfectly.Also, I recommend to pay attention to his site - Performance engineering & testing. It contains a lot of interesting information on Performance testing and LoadRunner in particular.As I promised, the reward is $52.25. Since Charlie asked me to donate this money to FSF (Free Software Foundation), I did so.I captured screen shots to confirm that I donated money as I promised - $52.25. (Please, click on images to enlarge them):Donation page #1Donation page #2Donation page #3Confirmation email from FSF (Free Software Foundation)Well, what's next?First of all, I recommend to read solution from Tim Koopmans - Regex ...
LoadRunner - How to record PDF file saving?
2008-04-17 23:30:00 One LoadRunner user asked me - How to record PDF file saving in LoadRunner?Earlier, I explained that LoadRunner does not record client side activities!That means, that LoadRunner records PDF file transferring ('cause it is a network activity) and does not record PDF file saving (which does not generate any network traffic).In some case, we need to save PDF (or other) file on local disk and process it (edit, parse, or compare with 'etalon' file).The present LoadRunner video tutorial explains how to record PDF file saving in LoadRunner.How to record PDF file saving in LoadRunner?This is a first LoadRunner script from the above LoadRunner video tutorial.Note: this script is based on HP's article #11766 - How to verify download of a file in Web scripts (login to HP required to access).int fp;long i;web_url("writings.html","URL=-http://www.testing.com/writings-.html","TargetFrame=","Resource-=0","RecContentType=text/html",-"Referer=","Snapshot=t1.inf","M-ode=HTML",LAST);//Trunca...
How to run QTP test from command line
2008-04-15 13:30:00 Do you run your QTP tests suit manually?What about running them on the schedule, for example nightly testing?I will show the way how to do that - i.e. how to run QTP tests from command line.Using that approach, you can execute your QTP tests on the schedule.How to run QTP test from command line - QTP video tutorialThis is a script, which runs QTP tests (from video tutorial):Dim qtApp 'As QuickTest.Application ' Declare the Application object variableDim qtTest 'As QuickTest.Test ' Declare a Test object variableSet qtApp = CreateObject("QuickTest.Applica-tion") ' Create the Application objectqtApp.Launch ' Start QuickTestqtApp.Visible = True ' Make the QuickTest application visibleqtApp.Open "C:Tempsimple_test", True ' Open the test in read-only mode' set run settings for the testSet qtTest = qtApp.TestqtTest.Run ' Run the testWScript.StdOut.Write "Status is:" & qtTest.LastRunResults.Status ' Check the results of the test runqtTest.Close ' Close the testSet qtResults...
LoadRunner regular expressions
2008-04-15 06:10:00 I have a real challenge for LoadRunner specialists, professionals, and gurus.I would like to start new public investigation on LoadRunner regexp (regular expressions).The reward is $52.25.As you know, LoadRunner supports limited and 'light' regular expressions. These are special text flags of web_reg_save_param function to support 'light' LoadRunner regular expressions:/DIG interprets the pound sign (#) as a wildcard for a single digit.For example, "te##xt" matches for "te23xt", and doesn't match for "text" and "te234xt"./ALNUM interprets the caret sign (^) as a wildcard for a single US?ASCII alphanumeric character.There are three syntaxes: ALNUMIC to ignore case, ALNUMLC to match only lower case, and ALNUMUC to match only upper case.For example, with ALNUMLC flag enabled, "te^^xt" matches for "tenext", and doesn't match for "teNext" and "teneoxt".The task is simple:How to use real regular expressions in LoadRunner with C language?Note: you can use real regexps with VBScript o...
QTP - How to capture dynamic text
2008-03-30 20:46:00 This QTP video tutorial explain how to use QTP Text Output to capture dynamic text.The present QTP (QuickTest Pro) video tutorial covers the following:How to use QTP to capture text from the pageSettings from QTP 'Output Text Value Properties' dialogExplanation for QTP Output valueExplanation for left & right boundariesHow to save QTP Output text value into QTP DataTableDifferences between Global and Local QTP DataTable sheetsHow to read value from QTP DataTableHow to capture dynamic textDear Reader!Do you have comments on this QTP video tutorial?Do you have suggestions for future QTP video tutorials?Do you have interesting thoughts to share with us?Do you have plans on how to cooperate with me and my blog?Do you have bright ideas on automated testing?If your answer is 'Yes', please leave your comment to my blog.Or send me email. You can see my email at the end of this video tutorial.Thank you in advance!P.S. Your opinion is extremely important for me...
QTP - How to capture dynamic text
2008-03-30 20:46:00 This QTP video tutorial explain how to use QTP Text Output to capture dynamic text.The present QTP (QuickTest Pro) video tutorial covers the following:How to use QTP to capture text from the pageSettings from QTP 'Output Text Value Properties' dialogExplanation for QTP Output valueExplanation for left & right boundariesHow to save QTP Output text value into QTP DataTableDifferences between Global and Local QTP DataTable sheetsHow to read value from QTP DataTableHow to capture dynamic textDear Reader!Do you have comments on this QTP video tutorial?Do you have suggestions for future QTP video tutorials?Do you have interesting thoughts to share with us?Do you have plans on how to cooperate with me and my blog?Do you have bright ideas on automated testing?If your answer is 'Yes', please leave your comment to my blog.Or send me email. You can see my email at the end of this video tutorial.Thank you in advance!P.S. Your opinion is extremely important for me...
How to record QTP script - video tutorial
2008-03-24 00:10:00 I'm glad to introduce my new visual tutorial.This is QTP (QuickTest Pro) video tutorial and it explains how to record QTP scripts.The present QTP (QuickTest Pro) video tutorial covers the following:How to record QTP script for Web applicationsWhat record and run settings should be used to run and execute QTP scriptHow to replay/execute QTP scriptHow to get results of executed QTP scriptHow to enable capturing screenshots during QTP scipt replayingHow to enable capturing video during QTP scipt replayingHow to record QTP script - video tutorial - Part 1How to record QTP script - video tutorial - Part 2This is my first attempt to create Flash presentation :)In the future I will create video presentations on my favourite automated testing tools - QTP (QuickTest Pro), LR (LoadRunner), and Selenium (cross-platform automated testing tool for Web applications).So, my main goal is to get feedback on the way I plan to evolve my blog, dear readers.--Thank you for visiting and reading, dear r...
Try to download LoadRunner 9.1...
2008-03-16 16:14:00 ... and be disappointed :(Yes, I tried to download LoadRunner 9.1 and was disappointed. Do you know why I was? OK, I will explain...Some time ago I wrote about new LoadRunner 9.1 - LoadRunner 9.1 (9.10) is coming soon!And two days ago I found, that LoadRunner 9.1 is available for downloading from HP site:It goes without saying, that I click the link 'Download a free 10-Day Trial of LoadRunner' to evaluate new version and share my impressions...Yes, HP uploaded trial LoadRunner 9.1 version:After that I pressed 'I Agree' btn to start downloading and... and I got the following error:It's a pity, that a Leader in Business Technology Optimization (I mean HP) allows such errors...Moreover! I got this error on this Friday (14th March 2008).The same error was present on yesterday (15th March).Nothing changed today (16th March) - I'm getting the error again and again...It looks like a bad tendency :(So, do you have any guesses - will HP fix the error tomorrow (2/17/2008) or not? As for...
Try to download LoadRunner 9.1...
2008-03-16 16:14:00 ... and be disappointed :(Yes, I tried to download LoadRunner 9.1 and was disappointed. Do you know why I was? OK, I will explain...Some time ago I wrote about new LoadRunner 9.1 - LoadRunner 9.1 (9.10) is coming soon!And two days ago I found, that LoadRunner 9.1 is available for downloading from HP site:It goes without saying, that I click the link 'Download a free 10-Day Trial of LoadRunner' to evaluate new version and share my impressions...Yes, HP uploaded trial LoadRunner 9.1 version:After that I pressed 'I Agree' btn to start downloading and... and I got the following error:It's a pity, that a Leader in Business Technology Optimization (I mean HP) allows such errors...Moreover! I got this error on this Friday (14th March 2008).The same error was present on yesterday (15th March).Nothing changed today (16th March) - I'm getting the error again and again...It looks like a bad tendency :(So, do you have any guesses - will HP fix the error tomorrow (2/17/2008) or not? As for...
How to run LoadRunner Controller from command line?
2008-03-01 18:13:00 Today I will explain how to open and run LoadRunner Controller scripts from command line.This feature can decrease tester's manual efforts and thereby to increase your effectiveness and performance.You can open LoadRunner Controller scenario with:LoadRunnerinWlrun.exe -Run -TestPath scenario.lrs -ResultName res_folderFor example:(note: click the image to enlarge it)As a result of above command, LoadRunner Controller:startsopens Controller scenarioexecutes itsaves results to folder 'C:TempLR_Res esult_0'After that, Controller finishes working and closes.Please, see files from created 'C:TempLR_Res esult_0' folder:Tips: As you see, there is LoadRunner Result file (result_0.lrr). You can pass it automatically to LoadRunner Analysis for further processing.Refer for detailed information: Custom HTML report in LoadRunner Analysis from command line.Actually, Wlrun.exe can have several settings. There are their descriptions from HP LoadRunner Controller User's Guide (© HP/Me...
How to run LoadRunner Controller from command line?
2008-03-01 18:13:00 Today I will explain how to open and run LoadRunner Controller scripts from command line.This feature can decrease tester's manual efforts and thereby to increase your effectiveness and performance.You can open LoadRunner Controller scenario with:LoadRunnerinWlrun.exe -Run -TestPath scenario.lrs -ResultName res_folderFor example:(note: click the image to enlarge it)As a result of above command, LoadRunner Controller:startsopens Controller scenarioexecutes itsaves results to folder 'C:TempLR_Res esult_0'After that, Controller finishes working and closes.Please, see files from created 'C:TempLR_Res esult_0' folder:Tips: As you see, there is LoadRunner Result file (result_0.lrr). You can pass it automatically to LoadRunner Analysis for further processing.Refer for detailed information: Custom HTML report in LoadRunner Analysis from command line.Actually, Wlrun.exe can have several settings. There are their descriptions from HP LoadRunner Controller User's Guide (© HP/Me...
LoadRunner 9.1 (9.10) is coming soon!
2008-02-29 09:53:00 Have you noticed, that HP Knowledge Base contains a new version of LoadRunner - 9.10?Here it is:For the present day (Feb 29th, 2008) HP LoadRunner 9.1 (9.10) is not published yet for downloading.So, we have to wait for HP LoadRunner 9.1 (9.10) release or beta announcement...Well, what's new in the future LoadRunner?Please, see excerpts from HP LoadRunner 9.1 'What's new' file:Version 9.1 expands support for Web 2.0 applications by adding protocol support for Adobe?s popular AMF flash. This, alongside existing support for AJAX makes LoadRunner the solution of choice for Web 2.0 performance validation. In addition, LoadRunner 9.1 has enhanced testing capabilities for SOA and web services, as well as improved reporting for SOA performance metrics.Version 9.1 also adds support for Microsoft RDP, Vista, and VMWare powered platforms.Features are very interesting and appetizing! :)When I have a possibility to download LoadRunner 9.1 (9.10) and evaluate it, I'ii share my impressi...
LoadRunner 9.1 (9.10) is coming soon!
2008-02-29 09:53:00 Have you noticed, that HP Knowledge Base contains a new version of LoadRunner - 9.10?Here it is:For the present day (Feb 29th, 2008) HP LoadRunner 9.1 (9.10) is not published yet for downloading.So, we have to wait for HP LoadRunner 9.1 (9.10) release or beta announcement...Well, what's new in the future LoadRunner?Please, see excerpts from HP LoadRunner 9.1 'What's new' file:Version 9.1 expands support for Web 2.0 applications by adding protocol support for Adobe?s popular AMF flash. This, alongside existing support for AJAX makes LoadRunner the solution of choice for Web 2.0 performance validation. In addition, LoadRunner 9.1 has enhanced testing capabilities for SOA and web services, as well as improved reporting for SOA performance metrics.Version 9.1 also adds support for Microsoft RDP, Vista, and VMWare powered platforms.Features are very interesting and appetizing! :)When I have a possibility to download LoadRunner 9.1 (9.10) and evaluate it, I'ii share my impressi...
How to get LoadRunner iteration number - using global variable?
2008-02-26 19:26:00 I continue explaning about LoadRunner iteration number.Well, how to determine the current iteration number?The first way is to use LoadRunner parameter od 'Iteration Number' type.It is described hereThe second way is to use a LoadRunner global variable.I will explain this approach now. Also, you will see how to define and use global variables.Define a global variableYou can add a new variable definition into vuser_init section of LoadRunner script:Then we will add a variable incrementation and usage into Action section of LoadRunner script. For example, like this:Please, note that LoadRunner does not require using of "extern" keyword.And last step is to open LoadRunner Run-time Settings and to set the desired total iteration count. In my example I set it to 3:That's all! Let's start our script and see Log-file:As you can see, nIterationNumber variable changes its values with every new iteration.Tip: do not forget to increment its value, for example with ++ operator.Both pr...
How to get LoadRunner iteration number - using global variable?
2008-02-26 19:26:00 I continue explaning about LoadRunner iteration number.Well, how to determine the current iteration number?The first way is to use LoadRunner parameter od 'Iteration Number' type.It is described hereThe second way is to use a LoadRunner global variable.I will explain this approach now. Also, you will see how to define and use global variables.Define a global variableYou can add a new variable definition into vuser_init section of LoadRunner script:Then we will add a variable incrementation and usage into Action section of LoadRunner script. For example, like this:Please, note that LoadRunner does not require using of "extern" keyword.And last step is to open LoadRunner Run-time Settings and to set the desired total iteration count. In my example I set it to 3:That's all! Let's start our script and see Log-file:As you can see, nIterationNumber variable changes its values with every new iteration.Tip: do not forget to increment its value, for example with ++ operator.Both pr...
LoadRunner web_reg_find function - How to verify web page content?
2008-01-24 23:24:00 When you perform load testing, you have to be fully confident, that your application works correctly. It may be very usefull to check UI of application - is it shown correctly or not.This verification can be performed with 2 ways:Using LoadRunner content verification with web_reg_find functionRunning LoadRunner GUI Vusers (QTP or WR scripts)The present LoadRunner tutorial describes content verifications with web_reg_find function. I will explain and show a usage of web_reg_find function, its attributes and result.To get additional information about the seconds approach (running LoadRunner GUI Vusers), please read the article How to execute QTP script from LoadRunner?How to add LoadRunner content verification?Let's start with LoadRunner demo Web application - Web Tours.I will show how to check that a greeting 'Welcome to the Web Tours site' is shown on a start page:I've recorded a simple script on Web Tour application - it just opens a start page, logs in, and logs out:Afte...
LoadRunner web_reg_find function - How to verify web page content?
2008-01-24 23:24:00 When you perform load testing, you have to be fully confident, that your application works correctly. It may be very usefull to check UI of application - is it shown correctly or not.This verification can be performed with 2 ways:Using LoadRunner content verification with web_reg_find functionRunning LoadRunner GUI Vusers (QTP or WR scripts)The present LoadRunner tutorial describes content verifications with web_reg_find function. I will explain and show a usage of web_reg_find function, its attributes and result.To get additional information about the seconds approach (running LoadRunner GUI Vusers), please read the article How to execute QTP script from LoadRunner?How to add LoadRunner content verification?Let's start with LoadRunner demo Web application - Web Tours.I will show how to check that a greeting 'Welcome to the Web Tours site' is shown on a start page:I've recorded a simple script on Web Tour application - it just opens a start page, logs in, and logs out:Afte...
LoadRunner visual tutorials
2008-01-22 14:34:00 LoadRunner parameters:Using parameters in Loadrunner VuGen scriptWhat are LoadRunner parameter and parameterization?How to perform basic operations on LoadRunner parameters?How to get LoadRunner iteration number - using LoadRunner parameter?How to get LoadRunner iteration number - using global variable?LoadRunner correlation:Using Correlation in LoadRunner scripts - visual tutorialLoadRunner Correlation - How to capture an array of dynamic data with web_reg_save_param functionHow to select correct boundaries for web_reg_save_param LoadRunner function?Recording:LoadRunner VuGen scripting - How to automatically download file from server and save it to local disk?LoadRunner - How to record a file saving, performed by user from browser page?Controller:How to run LoadRunner Controller from command line?Analysis:How to automatically create custom HTML report in LoadRunner Analysis from command line?LoadRunner & QTP integration:How to execute QTP script from LoadRunner?Content verifica...
LoadRunner visual tutorials
2008-01-22 14:34:00 LoadRunner parameters:Using parameters in Loadrunner VuGen scriptWhat are LoadRunner parameter and parameterization?How to perform basic operations on LoadRunner parameters?How to get LoadRunner iteration number - using LoadRunner parameter?How to get LoadRunner iteration number - using global variable?LoadRunner correlation:Using Correlation in LoadRunner scripts - visual tutorialLoadRunner Correlation - How to capture an array of dynamic data with web_reg_save_param functionHow to select correct boundaries for web_reg_save_param LoadRunner function?Recording:LoadRunner VuGen scripting - How to automatically download file from server and save it to local disk?LoadRunner - How to record a file saving, performed by user from browser page?Controller:How to run LoadRunner Controller from command line?Analysis:How to automatically create custom HTML report in LoadRunner Analysis from command line?LoadRunner & QTP integration:How to execute QTP script from LoadRunner?Content verifica...
How to get LoadRunner iteration number - using LoadRunner parameter?
2007-12-08 22:33:00 In some cases, you have to know the current iteration number, which is being executed.It would be great to have something like lr_iteration_number() function. Unfortunately, LoadRunner does not provide that function...In the present article, I will describe how to get a current iteration nunber, which is being executed in LoadRunner VuGen or Controller. Actually, I know two ways how to get current LoadRunner iteration number:LoadRunner parameter of 'Iteration Number' typeGlobal variable, which should be incremented each iterationToday, I will describe and explain first approach (parameter of 'Iteration Number' type). The second one (global variable) I will describe in the next article.Well, we are starting:LoadRunner parameter of 'Iteration Number' typeTo insert new parameter into LoadRunner VuGen script, select 'Vuser/Parameter List...' menu item: 'Parameter List' dialog will be opened.Then:Click 'New' btn to create new LoadRunner parameterSet parameter name (I na...
How to get LoadRunner iteration number - using LoadRunner parameter?
2007-12-08 22:33:00 In some cases, you have to know the current iteration number, which is being executed.It would be great to have something like lr_iteration_number() function. Unfortunately, LoadRunner does not provide that function...In the present article, I will describe how to get a current iteration nunber, which is being executed in LoadRunner VuGen or Controller. Actually, I know two ways how to get current LoadRunner iteration number:LoadRunner parameter of 'Iteration Number' typeGlobal variable, which should be incremented each iterationToday, I will describe and explain first approach (parameter of 'Iteration Number' type). The second one (global variable) I will describe in the next article.Well, we are starting:LoadRunner parameter of 'Iteration Number' typeTo insert new parameter into LoadRunner VuGen script, select 'Vuser/Parameter List...' menu item: 'Parameter List' dialog will be opened.Then:Click 'New' btn to create new LoadRunner parameterSet parameter name (I na...
How to minimize/maximize QTP window before the QTP script execution?
2007-12-03 18:52:00 This is very useful feature - minimize QTP window before script execution. It allows to observe a desktop or an application under test wholly.I will show and describe how to minimize (or maximize) QTP window programmatically - i.e. from QTP script.Also, provided approach can be applied to minimize (maximize) any required window - Browser, Notepad, MS Word or Excel, and so on.There are two ways to minimize QTP window: Using Minimize method of Window objectUsing QTP Application object - QuickTest.Application These methods will contain several lines only and I hope that my explanations will be understandable.So, let's explore! Using Minimize method of Window objectYou can use Minimize method of Window object to minimize QTP window (or any other).Let's see two cases - when a window is located in Object Repository (OR) and widows is not located in OR.If a window is located in Object Repository (OR), then minimizing can be performed using the following code: hWnd = Brows...
How to minimize/maximize QTP window before the QTP script execution?
2007-12-03 18:52:00 This is very useful feature - minimize QTP window before script execution. It allows to observe a desktop or an application under test wholly.I will show and describe how to minimize (or maximize) QTP window programmatically - i.e. from QTP script.Also, provided approach can be applied to minimize (maximize) any required window - Browser, Notepad, MS Word or Excel, and so on.There are two ways to minimize QTP window: Using Minimize method of Window objectUsing QTP Application object - QuickTest.Application These methods will contain several lines only and I hope that my explanations will be understandable.So, let's explore! Using Minimize method of Window objectYou can use Minimize method of Window object to minimize QTP window (or any other).Let's see two cases - when a window is located in Object Repository (OR) and widows is not located in OR.If a window is located in Object Repository (OR), then minimizing can be performed using the following code: hWnd = Brows...
LoadRunner Correlation - How to capture an array of dynamic data with web_r
2007-11-25 00:00:00 Imagine, that server returns the following response:(since blogspot.com doesn't show tags correctly, I'm reluctant to show server response as image) .And we have to capture dynamic values of all IDs (underlined with green lines). These values can be used later - say, for LoadRunner script correlation.As usual, several solutions exist :) Let's see them:Insert five web_reg_save_param functions using "Ord=1" (2, 3, ...) attribute:web_reg_save_param ("ID1Value", "LB= value="", "RB="", "Ord=1", LAST);web_reg_save_param ("ID2Value", "LB= value="", "RB="", "Ord=2", LAST);web_reg_save_param ("ID3Value", "LB= value="", "RB="", "Ord=3", LAST);web_reg_save_param ("ID4Value", "LB= value="", "RB="", "Ord=4", LAST);web_reg_save_param ("ID5Value", "LB= value="", "RB="", "Ord=5", LAST);Tips: Please, note that web_reg_save_param function does not perform correlation. web_reg_save_param function just registers a request for correlation from the next server response. That's why web_reg_s...
LoadRunner Correlation - How to capture an array of dynamic data with web_r
2007-11-25 00:00:00 Imagine, that server returns the following response:(since blogspot.com doesn't show tags correctly, I'm reluctant to show server response as image) .And we have to capture dynamic values of all IDs (underlined with green lines). These values can be used later - say, for LoadRunner script correlation.As usual, several solutions exist :) Let's see them:Insert five web_reg_save_param functions using "Ord=1" (2, 3, ...) attribute:web_reg_save_param ("ID1Value", "LB= value="", "RB="", "Ord=1", LAST);web_reg_save_param ("ID2Value", "LB= value="", "RB="", "Ord=2", LAST);web_reg_save_param ("ID3Value", "LB= value="", "RB="", "Ord=3", LAST);web_reg_save_param ("ID4Value", "LB= value="", "RB="", "Ord=4", LAST);web_reg_save_param ("ID5Value", "LB= value="", "RB="", "Ord=5", LAST);Tips: Please, note that web_reg_save_param function does not perform correlation. web_reg_save_param function just registers a request for correlation from the next server response. That's why web_reg_s...
Broken links detection - LoadRunner tutorial
2007-11-21 12:34:00 Today, I will describe how to use LoadRunner for broken links detection.'Broken' link is 'not valid' link. This link usually returns 404 Error - "Page not found". Another side of broken links is that images other resources are not displayed.Using LoadRunner for broken links detection can be helpful, when you perform load testing of a site and you have to be sure, that all pages, images, applets, and other resources are available during the high server loading.LoadRunner allows broken links detection during:Script recordingScript executionBroken links detection during LoadRunner script recordingYou have to set appropriate recording options. For that, click 'Options...' button from 'Star Recording' dialog:'Recording Options' dialog opens. Here, set 'Add comment to script for HTTP errors while recording' option:Please, note that you can see a description of the 'Add comment to script for HTTP errors while recording' option.Now, you are ready to record your scrip...
Broken links detection - LoadRunner tutorial
2007-11-21 12:34:00 Today, I will describe how to use LoadRunner for broken links detection.'Broken' link is 'not valid' link. This link usually returns 404 Error - "Page not found". Another side of broken links is that images other resources are not displayed.Using LoadRunner for broken links detection can be helpful, when you perform load testing of a site and you have to be sure, that all pages, images, applets, and other resources are available during the high server loading.LoadRunner allows broken links detection during:Script recordingScript executionBroken links detection during LoadRunner script recordingYou have to set appropriate recording options. For that, click 'Options...' button from 'Star Recording' dialog:'Recording Options' dialog opens. Here, set 'Add comment to script for HTTP errors while recording' option:Please, note that you can see a description of the 'Add comment to script for HTTP errors while recording' option.Now, you are ready to record your scrip...
How to select correct boundaries for web_reg_save_param LoadRunner function
2007-11-11 00:23:00 I will explain and show - how to select correct boundaries for web_reg_save_param LoadRunner function.web_reg_save_param is used for LoadRunner script correlation. That's why every load tester should study this function thoroughly, if you wish your scripts work correctly.Imagine that the server returns the following part of HTML page:Note: I will refer to this example later.What boundaries should be used in web_reg_save_param LoadRunner function to capture value of "ID1" (abcde)?The correct left boundary for web_reg_save_param function should be: ID1" value="And right boundary for web_reg_save_param is: "See the solution:Do you know why it is? I will explain in details.To find out the boundaries, we have to see texts located on the left and on the right.What is the text located on the left? There are several variants:" (inverted comma)Actually, inverted comma cannot be used as left boundary, because it is located in several places in server's responce.So, we have to ex...
How to perform basic operations on LoadRunner parameters?
2007-11-05 19:32:00 LoadRunner functions and scripts, containing in the present article, will be interested for LoadRunner beginners in the first place.I will describe - how to perform basic mathematical operations on LoadRunner parameters:How to convert LoadRunner parameter's value to integer number?How to save integer number to LoadRunner parameter?How to perform mathematical operations on LoadRunner parameter?You can use this article as a LoadRunner tutorial on LoadRunner parameter operations.Well... May I start? :) How to convert LoadRunner parameter's value to integer number?Actually, this is not a difficult task. We have to use 'atoi' function.'atoi' function converts a string to an integer value.Please, see the following code:lr_save_string("543210", "prmCounter");lr_output_message-("String value of prmCounter: %s", lr_eval_string("{prmCounter}"))-;i = atoi(lr_eval_string("{prmCounte-r}"));lr_output_message("Intege-r value of prmCounter: %d", i);The result is:The key line of code is:i = atoi(l...
How to perform basic operations on LoadRunner parameters?
2007-11-05 19:32:00 LoadRunner functions and scripts, containing in the present article, will be interested for LoadRunner beginners in the first place.I will describe - how to perform basic mathematical operations on LoadRunner parameters:How to convert LoadRunner parameter's value to integer number?How to save integer number to LoadRunner parameter?How to perform mathematical operations on LoadRunner parameter?You can use this article as a LoadRunner tutorial on LoadRunner parameter operations.Well... May I start? :) How to convert LoadRunner parameter's value to integer number?Actually, this is not a difficult task. We have to use 'atoi' function.'atoi' function converts a string to an integer value.Please, see the following code:lr_save_string("543210", "prmCounter");lr_output_message-("String value of prmCounter: %s", lr_eval_string("{prmCounter}"))-;i = atoi(lr_eval_string("{prmCounte-r}"));lr_output_message("Intege-r value of prmCounter: %d", i);The result is:The key line of code is:i = ...
What are LoadRunner parameter and parameterization?
2007-11-01 20:31:00 This is a simple question - what is LoadRunner parameter? I've reread LoadRunner VuGen User's Guide v9, trying to find the exact definition of LoadRunner parameter. That's strange, but LoadRunner Help does not contain the exact answer on this question.In this article, I will answer basic questions, connected to LoadRunner parameters.I think, LR beginners should study this article carefully :)So, I recommend to read it, if you want to know:the definition of LoadRunner parameterLoadRunner parameter functionshow to create parameter in LoadRunner VuGen scriptwhich types of LoadRunner parameter are availablehow LoadRunner processes parameters - gets and sets their valuesother key concepts, connected to LR parameters OK, let's start.I've recorded Web (HTTP/HTML) simple script on Web Tours demo web application. There are two first steps:Please, notice that we use the following hard-coded username & password - jojo and jojo:"Name=username", "Value=jojo", ENDITEM,"Name=passwor...
What are LoadRunner parameter and parameterization?
2007-11-01 20:31:00 This is a simple question - what is LoadRunner parameter? I've reread LoadRunner VuGen User's Guide v9, trying to find the exact definition of LoadRunner parameter. That's strange, but LoadRunner Help does not contain the exact answer on this question.In this article, I will answer basic questions, connected to LoadRunner parameters.I think, LR beginners should study this article carefully :)So, I recommend to read it, if you want to know:the definition of LoadRunner parameterLoadRunner parameter functionshow to create parameter in LoadRunner VuGen scriptwhich types of LoadRunner parameter are availablehow LoadRunner processes parameters - gets and sets their valuesother key concepts, connected to LR parameters OK, let's start.I've recorded Web (HTTP/HTML) simple script on Web Tours demo web application. There are two first steps:Please, notice that we use the following hard-coded username & password - jojo and jojo:"Name=username", "Value=jojo", ENDITEM,"Name=passwor...
How to execute QTP script from LoadRunner?
2007-10-31 23:09:00 I'm a big fan of LoadRunner! Really. This is a wonderful tool for load and performance testing.Also, I like QTP. Not love it, just like :) It's powerful enough.That's why I decided to use them together - i.e. execute QTP script from LoadRunner.I recorded simple QTP script - it just opens Google, performs search, then it clicks 'Next' button, and closes browser:QTP script is quite clear, I hope :)But I faced the questions:Should QTP be installed or not?Can several QTP scripts be executed simultaneously on one computer?Is it required special license for QTP and/or LoadRunner?How to do that - hotw to execute QTP script from LoadRunner?and others questions...It's OK :) I will share my experience and help you to answer these questions!Let's sort them out one after another...Should QTP be installed or not?The answer is 'Yes'.If you plan to execute QTP scripts, QTP should be installed on Load Generator computer (or computers, if you to execute several concurrent QTP scripts)...
How to execute QTP script from LoadRunner?
2007-10-31 23:09:00 I'm a big fan of LoadRunner! Really. This is a wonderful tool for load and performance testing.Also, I like QTP. Not love it, just like :) It's powerful enough.That's why I decided to use them together - i.e. execute QTP script from LoadRunner.I recorded simple QTP script - it just opens Google, performs search, then it clicks 'Next' button, and closes browser:QTP script is quite clear, I hope :)But I faced the questions:Should QTP be installed or not?Can several QTP scripts be executed simultaneously on one computer?Is it required special license for QTP and/or LoadRunner?How to do that - hotw to execute QTP script from LoadRunner?and others questions...It's OK :) I will share my experience and help you to answer these questions!Let's sort them out one after another...Should QTP be installed or not?The answer is 'Yes'.If you plan to execute QTP scripts, QTP should be installed on Load Generator computer (or computers, if you to execute several concurrent QTP scripts)...
QTP - How to set/get system time and date?
2007-10-25 19:40:00 QTP allows running different types of test. And sometimes, it needs perform time and date manipulations on a computer. In this article, I will show and explain - how to get system time/date and change them.Actually, today's lecture consists of two questions:How to get system time and date?How to set system time and date? Let start training right now :)So, the first section is:How to get system time and date?Actually, this is not difficult task! Use the following functions:Now - function returns the current date and time according to the setting of your computer's system date and time.Date - function returns the current system date.Time - function returns a Variant of subtype Date indicating the current system time.So, the code is very simple. I provide it with a screen shot containing results:Well, let's deal with the second section:How to set system time and date?For that, I will use simple DOS commands:time - this command displays or sets the system time:To change the tim...
QTP - How to set/get system time and date?
2007-10-25 19:40:00 QTP allows running different types of test. And sometimes, it needs perform time and date manipulations on a computer. In this article, I will show and explain - how to get system time/date and change them.Actually, today's lecture consists of two questions:How to get system time and date?How to set system time and date? Let start training right now :)So, the first section is:How to get system time and date?Actually, this is not difficult task! Use the following functions:Now - function returns the current date and time according to the setting of your computer's system date and time.Date - function returns the current system date.Time - function returns a Variant of subtype Date indicating the current system time.So, the code is very simple. I provide it with a screen shot containing results:Well, let's deal with the second section:How to set system time and date?For that, I will use simple DOS commands:time - this command displays or sets the system time:To change the tim...
How to organize user-defined functions into LoadRunner library?
2007-10-23 19:36:00 Assume, you work and work in LoadRunner, create and create scripts.Eventually, you face the situation when your code is duplicated in many scripts. This is a wrong way! Take my word for it :)I will show - why it is and how to struggle against it.Duplicated code is an evil, because:If you fix/modify a duplicated code, you have to edit each occurrence of this code.It needs add debug messages into duplicated code, you have to add debug functions into each occurrence of this code.If you decide to change the algorithm, implemented in a duplicated code, you are reluctant to find and edit it in each occurrence of this code. If you have tens or hundreds VuGen tests, containing diplicated code, the support can become a nightmare. Rework will cost too much!!! You must avoid it from the beginning.Well, what to do?You have create a user-defined library. It needs place your code into separate h-file.Let's assume, we will use the following function: sum(1, 4, -3)which calculates a sum of argu...
How to organize user-defined functions into LoadRunner library?
2007-10-23 19:36:00 Assume, you work and work in LoadRunner, create and create scripts.Eventually, you face the situation when your code is duplicated in many scripts. This is a wrong way! Take my word for it :)I will show - why it is and how to struggle against it.Duplicated code is an evil, because:If you fix/modify a duplicated code, you have to edit each occurrence of this code.It needs add debug messages into duplicated code, you have to add debug functions into each occurrence of this code.If you decide to change the algorithm, implemented in a duplicated code, you are reluctant to find and edit it in each occurrence of this code. If you have tens or hundreds VuGen tests, containing diplicated code, the support can become a nightmare. Rework will cost too much!!! You must avoid it from the beginning.Well, what to do?You have create a user-defined library. It needs place your code into separate h-file.Let's assume, we will use the following function: sum(1, 4, -3)which calculates a sum of argu...
LoadRunner VuGen scripting - How to automatically download file from server
2007-10-18 20:21:00 In my previous article, "How to record a file saving, performed by user from browser page?", I shown that user's activities are not recorded by LoadRunner. This is a rule!LoadRunner records file transferring from server and does not record file saving.What to do, if you have to save transferred file to local disk?Continue reading, and you will get the solution :)So, Let's start.You can download file from a server with the web_url function.See an example:Image downloading:web_url("logo.gif",- "URL=ht-tp://www.google.com/intl/en_ALL-/images/logo.gif", &-nbsp; "Resource=1", &-nbsp; "RecContentTyp-e=image/gif", - "Snapshot=t1.inf", &-nbsp; LAST);This code downloads Google's logo image:To save this image as file to local disk, we have to perform these steps:Capture image from server's responseSave captured data to local diskHow to capture image from server's response?Use web_reg_save_param function ...
LoadRunner - How to record a file saving, performed by user from browser pa
2007-10-13 23:22:00 The problem:This is a frequently asked question - why file downloading from a browser page (right mouse click, then "Save Target As...") was not recorded in LoadRunner VuGen script?The difference between functional and load testing:Actually, LoadRunner records a file transferring only, not downloading!This is the principal difference between functional and load testing! I will describe it.Functional testing is done from a user's viewpoint.What does a user see? It sees windows, dialogs, UI cotrols.For example, user can see downloaded html-page in a browser, or as plain text in a telnet session.In this case, data transferring is the same (HTTP protocol), while data representation varies (browser or telnet session).LoadRunner performs Load testing, i.e. it records and emulates data transferring between client and server. Data transferring only, not data displaying for user!For the above example, html-page can be downloaded directly from web-server. Another variant - page can be downlo...
LoadRunner - How to record a file saving, performed by user from browser pa
2007-10-13 23:22:00 The problem:This is a frequently asked question - why file downloading from a browser page (right mouse click, then "Save Target As...") was not recorded in LoadRunner VuGen script?The difference between functional and load testing:Actually, LoadRunner records a file transferring only, not downloading!This is the principal difference between functional and load testing! I will describe it.Functional testing is done from a user's viewpoint.What does a user see? It sees windows, dialogs, UI cotrols.For example, user can see downloaded html-page in a browser, or as plain text in a telnet session.In this case, data transferring is the same (HTTP protocol), while data representation varies (browser or telnet session).LoadRunner performs Load testing, i.e. it records and emulates data transferring between client and server. Data transferring only, not data displaying for user!For the above example, html-page can be downloaded directly from web-server. Another variant - page can be downlo...
Using Correlation in LoadRunner scripts - visual tutorial
2007-10-12 22:42:00 Today, I will explain - what is LoadRunner correlation and how to perform it.In my humble opinion, correlation is the key concept of LoadRunner. So, strong understanding of correlation is mandatory requirement for any test engineer, if he plans to be LoadRunner professional or even guru :)Example from a real practice:I recorded LoadRunner script for a web server, which contained two special fields - timestamp and checksum:web_submit_data("rms.j-sp", "Action-=http://eprumossd0010:8400/RMS/-jsp/rms.jsp", "Method-=POST", "RecCon-tentType=text/html", "Refere-r=http://eprumossd0010:8400/RMS-/html/testFramework.html", "Snapsh-ot=t4.inf", "Mode=H-TML", ITEMDAT-A, "Name=T-IMESTAMP", "Value=1192177661211", ENDITEM, "Name=C-HECKSUM", "Value=715E19300D670ED77773BBF0-66DAAAE28...
Using Correlation in LoadRunner scripts - visual tutorial
2007-10-12 22:42:00 Today, I will explain - what is LoadRunner correlation and how to perform it.In my humble opinion, correlation is the key concept of LoadRunner. So, strong understanding of correlation is mandatory requirement for any test engineer, if he plans to be LoadRunner professional or even guru :)Example from a real practice:I recorded LoadRunner script for a web server, which contained two special fields - timestamp and checksum:web_submit_data("rms.j-sp", "Action-=http://eprumossd0010:8400/RMS/-jsp/rms.jsp", "Method-=POST", "RecCon-tentType=text/html", "Refere-r=http://eprumossd0010:8400/RMS-/html/testFramework.html", "Snapsh-ot=t4.inf", "Mode=H-TML", ITEMDAT-A, "Name=T-IMESTAMP", "Value=1192177661211", ENDITEM, "Name=C-HECKSUM", "Value=715E19300D670ED77773BBF0-66DAAAE28... |



