日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

loadrunner支持https协议的操作方法-经验总结

發布時間:2023/11/27 生活经验 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 loadrunner支持https协议的操作方法-经验总结 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

問題:用戶portal支持https協議,用loadrunner錄制登陸腳本時發現未錄制到用戶名和密碼

?

錄制到的腳本如下:

login()

{

?

????????lr_think_time(10);

?

????????web_url("verifycode.jsp",

??????????????????"URL=https://192.168.211.246:56661/portal/common/jsp/verifycode.jsp?codeSource=loginverifycode&time=1330596177343",

??????????????????"Resource=1",

??????????????????"RecContentType=image/jpeg",

??????????????????"Referer=https://192.168.211.246:56661/portal/indexAction",

??????????????????"Snapshot=t2.inf",

??????????????????LAST);

?

????????web_url("192.168.211.246:38787_2",

??????????????????"URL=http://192.168.211.246:38787/",

??????????????????"Resource=0",

??????????????????"RecContentType=text/html",

??????????????????"Referer=https://192.168.211.246:56661/portal/indexAction",

??????????????????"Snapshot=t3.inf",

??????????????????"Mode=HTML",

??????????????????EXTRARES,

??????????????????"Url=https://192.168.211.246:56661/portal/common/style/image/head/topbg_line.jpg", "Referer=https://192.168.211.246:56661/portal/indexAction", ENDITEM,

??????????????????"Url=https://192.168.211.246:56661/portal/common/style/image/shadowLW.jpg", "Referer=https://192.168.211.246:56661/portal/indexAction", ENDITEM,

??????????????????"Url=https://192.168.211.246:56661/portal/common/style/image/tabM.jpg", "Referer=https://192.168.211.246:56661/portal/indexAction", ENDITEM,

??????????????????"Url=https://192.168.211.246:56661/portal/common/style/image/tabBg.jpg", "Referer=https://192.168.211.246:56661/portal/indexAction", ENDITEM,

??????????????????"Url=https://192.168.211.246:56661/portal/common/style/image/shadowRW.jpg", "Referer=https://192.168.211.246:56661/portal/indexAction", ENDITEM,

??????????????????"Url=https://192.168.211.246:56661/portal/common/style/image/titleHot.gif", "Referer=https://192.168.211.246:56661/portal/indexAction", ENDITEM,

??????????????????"Url=https://192.168.211.246:56661/portal/common/style/image/head/contanta_pic_y.gif", "Referer=https://192.168.211.246:56661/portal/indexAction", ENDITEM,

??????????????????"Url=https://192.168.211.246:56661/portal/common/style/image/titleHot2.gif", "Referer=https://192.168.211.246:56661/portal/indexAction", ENDITEM,

??????????????????"Url=https://192.168.211.246:56661/portal/common/style/image/shadowB.jpg", "Referer=https://192.168.211.246:56661/portal/indexAction", ENDITEM,

??????????????????"Url=https://192.168.211.246:56661/portal/common/style/image/titleMyoder.gif", "Referer=https://192.168.211.246:56661/portal/indexAction", ENDITEM,

??????????????????LAST);

?

????????web_url("subscribeInfoQuery.action",

??????????????????"URL=https://192.168.211.246:56661/portal/subscribeInfoQuery.action",

??????????????????"Resource=0",

??????????????????"RecContentType=text/html",

??????????????????"Referer=https://192.168.211.246:56661/portal/indexAction",

??????????????????"Snapshot=t4.inf",

??????????????????"Mode=HTML",

??????????????????LAST);

?

????????return 0;

}

?

?

思考:是否是loadrunner不支持https

?

解決:通過查找一些資料,其實loadrunner支持https協議,但需要在錄制腳本時做一些修改,操作步驟如下:

1、證書的準備

常見的證書為:*.pfx格式,該種格式的證書可以通過雙擊運行安裝到IE瀏覽器上。用戶在訪問的時候就可以使用到。

但這種證書并不是LoadRunner所使用的類型,因此需要對其進行轉換。將其轉換為*.pem格式。

轉換方法如下:

a)????????安裝openssl

b)????????運行C:\<OpenSSL>/bin文件夾的openssl二進制文件,它將啟動OpenSSL命令提示符

c)????????執行以下命令:pkcs12 -in D:\test1.pfx -out D:\test01.pemnodes

d)????????執行后,將會在指定目錄生成test01.pem文件,這個文件將會在下一個步驟,對LoadRunner進行配置的時候使用到。

?

2LR配置

啟動LoadRunner,打開Recording Option選項。

[圖片]

留意紅色框中的選項。

選擇后,單擊New Enty

[圖片]

紅框中的配置為服務器的ip和端口號,按照測試所需要的實際地址進行配置就可以

配置后,將Use specified client-side certificate[Base64/PEM]鉤選,為使用客戶端證書訪問。

單擊...選擇剛剛轉換生成的客戶端證書。

[圖片]

如果你為證書有設置密碼,在這里也需要輸入。

到此為止所有與http區別的配置就完成了。

錄制后,可以在腳本的開始,看到LoadRunner新生成的語句

web_set_certificate_ex("CertFilePath=test01.pem",???//密鑰文件

???????????????"CertFormat=PEM",

???????????????"KeyFilePath=test01.pem",???//密鑰文件

???????????????"KeyFormat=PEM",?????????

???????????????"Password=123456",????????//密鑰密碼

???????????????"CertIndex=1",

???????????????LAST);

?

3、完成上面兩步后可以正常錄制腳本

?

或者使用:

測webservice遇到https的請求,是在事務開始前加web_set_sockets_option("SSL_VERSION","TLS");

轉載于:https://www.cnblogs.com/HCT118/p/5377231.html

總結

以上是生活随笔為你收集整理的loadrunner支持https协议的操作方法-经验总结的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。