LR Introduction to using proxy recording scripts
When you use LR to record browser requests, there is often a situation where browsers cannot be opened. The use of LR-brought proxy, can effectively solve the problem, and the supported browser is no longer limited to IE, Firefox, and even can record the mobile phone browser issued requests;
The agent needs to use the LoadRunner installation directory, the bin directory under the Wplus_init_wsock.exe, the specific operation is as follows:
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/82/07/wKiom1dH8XqC0BWBAAUZ7FezuHk623.png-wh_500x0-wm_3 -wmp_4-s_189300640.png "title=" B1.png "alt=" Wkiom1dh8xqc0bwbaauz7fezuhk623.png-wh_50 "/>
1. Open LoadRunner Virtual User Generator, select Web (http/html) protocol
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/82/07/wKiom1dH8ciRu2oNAAAwFuImvpE644.png-wh_500x0-wm_3 -wmp_4-s_4258989525.png "style=" Float:none; "title=" B2.png "alt=" Wkiom1dh8ciru2onaaawfuimvpe644.png-wh_50 "/>
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/82/06/wKioL1dH8r_Rt_KHAABX0wibzUA592.png-wh_500x0-wm_3 -wmp_4-s_1292008153.png "style=" Float:none; "title=" B3.png "alt=" Wkiol1dh8r_rt_khaabx0wibzua592.png-wh_50 "/>
2. in the Script editing screen, click the Record Settings button 650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/82/07/wKiom1dH8f-yP4S1AAAMduLpoCk627.png-wh_ 500x0-wm_3-wmp_4-s_4024131172.png "title=" B4.png "alt=" wkiom1dh8f-yp4s1aaamdulpock627.png-wh_50 "/> Click New Entry in the recording options-network-portmapping interface to fill in the proxy information as shown
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/82/06/wKioL1dH8zqijqJ5AALtMI-Oow4040.png-wh_500x0-wm_3 -wmp_4-s_1902418271.png "style=" Float:none; "title=" B5.png "alt=" Wkiol1dh8zqijqj5aaltmi-oow4040.png-wh_50 "/>
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/82/07/wKiom1dH8kOCufHqAAC6gHXs1QE840.png-wh_500x0-wm_3 -wmp_4-s_372020750.png "style=" Float:none; "title=" B6.png "alt=" Wkiom1dh8kocufhqaac6ghxs1qe840.png-wh_50 "/>
notes: The address and port of the server are filled out according to the actual project situation; The proxy port number is customized, and the browser needs this information when it opens the agent;
3. Open the proxy in the browser (for example in Chrome)
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/82/07/wKiom1dH8oXiiXKUAAFjQXKlJTo517.png-wh_500x0-wm_3 -wmp_4-s_2600847857.png "title=" B7.png "alt=" Wkiom1dh8oxiixkuaafjqxkljto517.png-wh_50 "/>
4. Click the Record button in LR 650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/82/06/wKioL1dH86Ty8mVEAAAdsD5eudE969.png-wh_ 500x0-wm_3-wmp_4-s_1185159413.png "title=" B8.png "alt=" Wkiol1dh86ty8mveaaadsd5eude969.png-wh_50 "/> for recording, The recording interface is set up as follows, click the OK button (the Wplus_init_wsock.exe file is opened automatically)
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/82/06/wKioL1dH88fyKc7yAADljAHL7LE299.png-wh_500x0-wm_3 -wmp_4-s_4240797756.png "title=" B9.png "alt=" Wkiol1dh88fykc7yaadljahl7le299.png-wh_50 "/>
5. Open the Http://192.168.163.128/bbs/forum.php (sample project) on the Chrome browser and the action is recorded LoadRunner
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/82/07/wKiom1dH8xHwTRFlAAD0N5AK9mU279.png-wh_500x0-wm_3 -wmp_4-s_2012826091.png "style=" Float:none; "title=" B10.png "alt=" Wkiom1dh8xhwtrflaad0n5ak9mu279.png-wh_50 "/>
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/82/06/wKioL1dH9Ajy7Of2AACnTty0HjY452.png-wh_500x0-wm_3 -wmp_4-s_3949928642.png "style=" Float:none; "title=" B11.png "alt=" Wkiol1dh9ajy7of2aacntty0hjy452.png-wh_50 "/>
6. if you want to record a request sent by your phone browser, set your phone to development mode, turn on the phone's agent (replace the steps to turn on browser proxy), and do the same.
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/82/07/wKiom1dH82rzWJC1AADBKhmgbwc750.png-wh_500x0-wm_3 -wmp_4-s_3224826915.png "title=" B12.png "alt=" Wkiom1dh82rzwjc1aadbkhmgbwc750.png-wh_50 "/>
Precautions:
1 after use, remove the agent from your phone or browser
2 , when playing back the script under the agent recording, if you want playback to be replayed in another browser or phone, you need to add the header information to the script, for example, as shown below:
Add Web_add_header ("User-agent", "mozilla*********firefox/17.0") in the script;
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/82/06/wKioL1dH9JWR_cpbAALqvHQO1Fk074.png-wh_500x0-wm_3 -wmp_4-s_110508086.png "title=" B13.png "alt=" Wkiol1dh9jwr_cpbaalqvhqo1fk074.png-wh_50 "/>
You can also modify the default browser information in the Run settings
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/82/07/wKiom1dH862AsPqnAAN3z9_MKHY272.png-wh_500x0-wm_3 -wmp_4-s_3318103289.png "title=" B14.png "alt=" Wkiom1dh862aspqnaan3z9_mkhy272.png-wh_50 "/>
Post-language:
The first to write technical articles, is to do their own study to record, if there are errors in the mistakes, please give us a lot of advice.
This article is from the "yingying" blog, make sure to keep this source http://7297445.blog.51cto.com/7287445/1783838
LoadRunner Agent Recording Script method introduction