Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Loadrunner script with attachment files within the LoadRunner forums, part of the Software Testing category; Hi, I am recording a web application, One screen contains Browse field and i need to browse some files from my local machine. This application does not accept same document ...
|
|||||||
|
|||
|
Loadrunner script with attachment files
Hi,
I am recording a web application, One screen contains Browse field and i need to browse some files from my local machine. This application does not accept same document twice. During replay, it needs to select different files randomly from my machine Can some one please advice how to overcome this, And also since i selected files from my machine, same script is not running through Load Controller. Please advice. Thanks |
| Sponsored Links |
|
|||
|
Re: Loadrunner script with attachment files
Hi,
I suppose you are http web protocol. So incase you look into Request where files are being selected for upload, you should find that filename should be specified. Create a .dat / .csv file containing a single column name as "FileName". Enter 2-3 filename along with the full path and save the file. Now navigate to the section where the file is getting selected. Right Click on the filename and select "Replace with a Parameter" option. Browse and select the saved .csv / .dat file. Select unique under the Occurence column. This would ensure that for every iteration, a new file is selected. Incase you wish to re-use the data in a cyclic manner, once your action is completed, in your vuser_end include a code where the uploaded file is deleted at the end. As regards running in the controller, pass the filepath in the .csv file with complete UNC path including your machine IP address. Also select Load Generator as your machine IP to ensure faster connectivity. Cheers....
__________________
Regards, V.Umesh Krishnan QA Consultant |
| The Following 2 Users Say Thank You to bizzzzzare For This Useful Post: | ||
|
|||
|
Re: Loadrunner script with attachment files
Hi,
First in order to make sure the scripts are accessible from the Controller and Load Generator machines, I suggest you locate them on a network drive/path which is accessible for all machines. Use UNC path to avoid redundant drive mapping on each of these machines Regarding the random mechanism, it can be solved in several different ways. I suggest you create copies of these files (as many as needed), and name them in a pattern you can control from LoadRunner. For example: File_1.doc, File_2.doc, File_3.doc, etc... From LoadRunner define a unique number as parameter and while you run the script, just before you reach the browse selection section, concatenate the fixed prefix "File_" with the unique parameter. This way you will make sure the same file is not being uploaded by several different vusers. I hope it helps shlomini |
| The Following User Says Thank You to shlomini For This Useful Post: | ||
|
|||
|
Re: Loadrunner script with attachment files
Hi Umesh,
For some scripts, this is working but for some, it is throwing below warning message and script is failing: Warning -26488: Could not obtain information about submitted file "C:\Program Files\Mercury Interactive\VUser Generator\scripts\EDMS scripts for Audit Trail Triggers\PFG Electronic chec in\\venkatam2k\EDMS\Test Electronic document 1.doc": _stat rc=-1, errno=2 [No such file or directory]. Using an empty file [MsgId: MWAR-26488] Actually in my application, we have different screens for uploading a document. In some screens, it is accepting and in some cases, filename is taking from the Path where the script exactly loaded and this is causing problem Please advice |
|
|||
|
Re: Loadrunner script with attachment files
Hi Sai,
Possible reason could be that you have missed out parameterizing the file path in some scripts. Please check that no script uses a constant absoulte path as recorded. All scripts should be having the file upload path parameterized and specify the UNC path for all files. Also introduce a small code to check for file existence prior to the step of uploading the file. The function could be something on these lines - File *fp = fOpen("file","r"); if (fp) { lr_output_message "file Exists"; } else { lr_output_message "File Missing"; ) Specify the path used in File Upload Parmeter at the place where file is used in the first line. Cheers...
__________________
Regards, V.Umesh Krishnan QA Consultant |
|
|||
|
Re: Loadrunner script with attachment files
Please anyone help how to capture cookie value in load runner which we tried to correlate the cookie value in the tree view but we are not able find the value. We are trying to correlate the cart key cookie values. We are seeing response body but not able to see anything in tree view ****** response body for transaction with id 423 ****** minicart.finalizeadditem({errormessage:"",cart:{cartkey:"601812",cartname:"cart",numberofitems:"1",totalvalue:"435.00",currencydescription:"usd",itemlist:[{sku:"11668019",linekey:"623844",name:"lipofectamine™ 2000 transfection reagent",quantity:"1",unitprice:"435.00",totalprice:"435.00",editflag:"n",configflag:"n",editurl:""}]},jsessionid:"81c0a97bdc91a52f8257c39aef98bc81"}); $$$$$$ response body for transaction with id 423 ended $$$$$$
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how can i write user define functions in LoadRunner Script? | bnswamyATP | LoadRunner | 6 | 11-18-2008 05:59 AM |
| Test Script File Attachment | Geek_Guest | Test Director | 0 | 09-06-2007 01:57 PM |
| East-Tec Backup 2007 backs up and protects the files and data you care about (files, | JobHelper | Geeks Lounge | 0 | 09-03-2007 01:20 PM |
| How many 4Test Script files should be present in the Suit file S1. | JobHelper | SilkTest | 0 | 12-28-2006 06:03 AM |
| PHP Code to email HTML Page along with PDF Attachment | Shivanna | PHP | 0 | 10-11-2006 05:57 AM |