Systems & Software Talk | |
|
Visitors since August 14, 2007:
Free Hit Counters Client-side Popup Window HandlerIt is quite sad when something like this utility is needed. What were they thinking or smoking?? Nonetheless, I backed into a need for this. As the title suggests, this is a method for handling popup windows generated by the app-under-test; where the popup is client-side only and is not directly involved in a communication exchange with the server, nor is its output used in a GET or POST. So if you need something to send keystrokes to a client-side popup where the LR script is incapable of handling it, this is a method for sending keystrokes and clearing the window so the Vuser may proceed. The need for this is very rare. You may obtain the demo/package here at SQAForums. NOTE! This is not needed for ordinary download/open/save file-type operations. Forcing Files to Travel With LR ScriptsEveryone has baggage. I have baggage. Just ask my wife and be prepared to listen for a couple of hours. LoadRunner scripts and scripts of equivalent tools are no different. This is a tip that demonstrates how to spread the wealth of baggage to LoadRunner scripts. Why do I need to do this you might ask. Here are some reasons. You may:
How would you then do this? Two methods follow: First:
Second: Each LoadRunner script, within the script folder has a "Dot Usr" file or .usr file. Of course if you double-click the file icon, VuGen will launch - assuming VuGen is installed properly. However, if you right-mouse on it, you will see that you can "Open With...". This is key to adding baggage per the above list.
Note the period or dot and the backslash, AND the equals sign (=). The "." and = sign must be present. Congratulations! You have now created more baggage. Inform your wife or significant other that you now have more baggage. In many applications that you script for, you may encounter the need to upload a file to the system/application-under-test. The method described above removes the need to manually copy this file to every load generator. Ok, well what if the file name needs to be different for every submit? I will expose a couple methods for doing this in a separate blog entry. Please feel free to share how you handle situations like this - either by linking to it or by commenting on this entry. I use this quite often in conjunction with the utility under this link. I keep the baseline measurement file with the script for future reference. I also use it to ensure proper baggage handling of external custom code that is necessary for the correct operation of the script - code such as VBScript-based for specifc jobs callable via "system();" within the LR script.
LoadRunner - Correlated Date Comparison= ** Date Comparison Utility ** = If you arrived here looking for tips on how to compare (depending upon your orientation) your dates with "Gloria" or "Betsy" or with "Duke" or "Beaufort", you came to the wrong place. While you might be interested in dating parameters, this topic has a different context. We are not dealing with parameters such as "First Date Suck Face Scale" or "Dinner Tight-Wadness" or "Opened Car-door For Me But Slammed It And Crushed My Roses" or "Flirt level With Waiter Or Waitress" or "Alcoholic Beverage Guzzle Rate" or "Frequency Of Change Topic To All About Me". We are dealing in ones and zeros here. Sure your date may have been a zero but really, we are talking two different types of parameters. Still not convinced that this is not about humans and dating? I know you are thinking about the word "LoadRunner". Sure your date turned out to be an extreme emotional Load and during dinner you daydreamt that you were a first class Runner. But honestly, this is about information technology. Anyway... This is derived from a bucket of code that is also shared at SQAForums: www.sqaforums.com. I wrote a piece and then ptrussell_nc discovered a flaw in the original and fixed it. Too bad it isn't that easy to fix a flaw in a date - heh?The purpose of this code fragment is as follows:
* Results from 4 & 5 above can be: 1) date is before, 2) date is after, or 3) the date is the same.
Note from ptr: In merging this code this rewritten it to be slightly more efficient and compact. /* Authors: JakeBrake & ptrussell_nc of SQAForums.com Version: 1.1 Date: 1-Aug-2007 */ { int rc; int refrel; char *today; char *refDate; /* lr_eval_param is going to return a block of memory that we can use. We don't need to write those results to a temporary buffer. This next line saves today as mm/dd/yyyy in "dateToday" */ lr_save_datetime("%m/%d/%Y", DATE_NOW, "dateToday"); Do you still think this is about the human dating experience? Are his or her parameters important to you? Do you wish to have a good correlating experience? Please let me refer you to here. Oh arighty then.. you came here for dating pointers. Here are some! It's all in the fingernails:
LoadRunner: web_reg_save_param(); SaveLen and SaveOffsetParameter parsing: web_reg_save_param() (WRSP) – SaveLen & SaveOffset; Have you ever used WSRP to capture a value that looks similar to this? "123450_67811_909876543". You capture it and then you must use it in a subsequent POST or GET. However, it might not be the same string each iteration which is why you correlated it in the first place! On top of that you might need to substitute the "_" underscore characters with one or more characters for the subsequent POST or GET such that it must look like this: "123450%5F67811%5F909876543", where the instances of the underscores are replaced with "%5F" – for example. Now let us assume that the original numeric portion is 1) fixed length, and 2) the segments within are fixed length. If those criteria are not met, this will not work for you. Otherwise this situation allows us to use WRSP versus writing some custom "C" to manipulate character buffers. Before showing how to solve this situation with WRSP, let us take another look at the value, "123450_67811_909876543". Let us also say that a next script iteration might return this value to the WRSP, "100010_22255_900777040". Remember that you must now replace the two underscores (2 chars) with "%5F" or a total of six chars. Below is a way to accomplish this. As always, you would place the WRSP statements before the GET or POST that causes the value to be returned to your Vuser’s dynamic parameter. Again, assuming the captured value is constant length and each segment within is fixed length and the value returned for said iteration is "100010_22255_900777040", we would use the below to setup three dynamic parameters from the same string; taking advantage of WRSP arguments "SaveLen" and "SaveOffset". In the below, use the same right and left boundaries for each WRSP (wrsp is used below. You would of course use web_reg_save_param();). wrsp("Segment1", "LB=Left", "RB=Right", "SaveLen=6", "SaveOffset=0", LAST); wrsp("Segment2", "LB=Left", "RB=Right", "SaveLen=5", "SaveOffset=7", LAST); wrsp("Segment3", "LB=Left", "RB=Right", "SaveLen=9", "SaveOffset=13", LAST); We now have three dynamic parameters as follows: {Segment1} = "100010", {Segment2} = "22255", {Segment3} = "900777040" Notice that we did not capture the underscore character. Assuming you must now use the example "%5F" in lieu if the underscore character in a POST or GET, the below is an example of how you would proceed. /* Then your subsequent GET or POST would look like this: */ web_submit_data (or web_url, etc.) ... ITEMDATA, "Name=NamedItem", "Value= {Segment1}%5F{Segment1}%5F{Segment1}", ENDITEM, The actual above value returned to the server in this example would be: 100010%5F22255%5F900777040 Circular heh? Vugen Output Log Transaction Parser
If you answered "Yes" to all of the above and agree with my opening proposition, then the report-generating Version 1.1 Utility Under Here is right for you. The utility is under the "Attachment" link located in the header of the post. Please read the information and follow the instructions in the post. Look for a Version 2.0 by the end of July 2007. Version 2.0 will properly handle transactions in the vuser_init and vuser_end sections. If you have no need for this from a LoadRunner perspective, please feel free to use it as reference code for manipulating Excel(tm Microsoft Corp.) spreadsheets. Please let me know if you use this and find it useful! Please do not report any bugs to me - fix 'em yourself! (No - just kidding!) Please do report them to me. Thank you. If you have a need for examples of manipulating spreadsheets programmatically this code has examples.
{ Last Page } { Page 1 of 2 } { Next Page } |
About MeMy Profile Archives Friends My Photo Album LinksCorey GoldbergEffective Testing? Bj Rollison I.M. Testy Blog Alan Page: Software Testing & Rants Dmitry's LoadRunner and QTP Blog Veterans History Project Air Traffic Control Watch Music Making Fun My home 1972-1975 CategoriesFunctional TestingPerformance Horror Development Performance Testing General Tools Tips Warped Humor LoadRunner Tips and Tricks Recent EntriesIntroducing TestalisDefect Report - Politically Correct Performance Testing Vuser Personas – Part I Happy Holidays 2007 Acceptance Testing (UAT) - Some Answers to Some Questions FriendsLauraScharpphilk10 richardw100 aalhait jimhazen strazzerj Lynnem bru EklecticTester jgottlieb leakybrain michaeljf prainbow rajeshmathur rstens Yury zeeslo whollymindless SyndicationRSS Site Feed |