⑴ 介面測試都有哪些,比如http訪問的
在Google已安裝完成的介面測試工具的postman的程序之後,點擊進入桌面的chrome應用啟動器。
進入到應用啟動器界面中之後版,可以看到是postman的應權用圖標程序。點擊進入。
進入到postman的歡迎的界面中,如果有賬號可以進行點擊登錄賬號,無賬號可以點擊Go to the app進入。
這樣就進入到postman界面中,進行對網路網址進行測試話,選擇get請求,把網路網址在輸入框中輸入。http://www.fulinmenst.com/
輸入完成之後,然後進行點擊send。
如果測試用成功,返回的status為200 ok,而在下列的是放回的網路首頁的元素信息。這樣網路首頁介面測試就成功了。
⑵ http介面測試有什麼好工具
個人推薦:易文檔
一個在線介面文檔編輯工具,里邊也支持多種請求方式的介面測試功能。
⑶ firefox http測試工具有哪些
最常用的就是httpwatch,另外還有HttpFox等等,在火狐全球擴展中心,以Http關鍵詞搜索,然後根據下載量就可以判斷出來哪種更受歡迎了。
⑷ 如何使用postman對http協議介面測試
⑸ http介面測試如何測試,給一個介面怎麼知道傳入 如 https://d.jd.com/lab/
你這個就是普通的get請求
⑹ 推薦幾個java的, http協議測試工具
apachebench,openstr
你去找看。。這兩個。。
⑺ 火狐有http請求測試工具有哪些
類似功能的很多,例如httpwatch、HttpFox等等,還有非常著名的擴展Firebug,都有這個功能,在火狐擴展中心下載安裝即可。
⑻ 什麼測試工具可以壓力測試HTTPS POST的
什麼測試工具可以壓力測試HTTPS POST的
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Provides http server communications options using [Stream]
* Mainly used to communiated with http
* Add Support HTTP/1.1 by Default
* Only Support Connection Close Mode
*
* @ anthony
*/
class Http {
/**
* @var array default header options
*/
public static $default_options = array (
'User-Agent'=> 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4',
'Connection'=> 'Close' //Need to close the request every time for HTTP 1.1
);
/**
* return Array lines of headers
* Overwrite by $options
*
* @param Array $options, key value pairs of Header options
*
* @return Array,Array line of headers
*/
private static function getHeaders($options){
if ($options === NULL) {
// Use default options
$options = self::$default_options;
} else {
//Merge the $options with $default_options, if the value set in $options,
//Value in $default_options will be overwrite
$options =$options + self::$default_options ;
}
$headers = array();
foreach($options as $k=>$v){
$headers[] = $k.': '.$v;
}
return $headers;
}
/**
* Returns the output of a http URL.
* may be used.
*
* @param string http base URL or FULL url
* @param array Header options
* @param array $data Get Param
* @param array &$reponse header, if Assigned,the response header will be populated
*
* @return string, Raw String of Http body
*/
public static function get($url, array $options = NULL,$data = NULL,&$response_header = NULL) {
$headers = self::getHeaders($options);
$params = array('http' => array(
'method' => 'GET',
//Defautl HTTP 1.1 and with Connection Close
'protocol_version'=>'1.1'
));
if ($options!== null) {
$params['http']['header'] = $headers;
}
if($data){
$url .= '?'.http_build_query($data);
}
$ctx = stream_context_create($params);
$fp = fopen($url, 'rb', false, $ctx);
if (!$fp) {
throw new Exception("Connection failed: $url");
}
if($response_header !== NULL){
$response_header = stream_get_meta_data($fp);
}
$response = stream_get_contents($fp);
if ($response === false) {
throw new Exception("Reading data Failed: $url");
}
fclose($fp);
return $response;
}
/**
* Post with request options and data
*
* @param String url, FULL url
* @param Array $options , key=>value pairs array
* @param Array $data ,Post Data pairs
* @param array &$reponse header, if Assigned,the response header will be populated
*
* @return string, Raw String of Http body
*/
public static function post($url, $options = null,$data=NULL,&$response_header = NULL) {
//Restricted the Form formate
if(is_array($data)){
$data = http_build_query($data);
}
$options['Content-type'] = 'application/x-www-form-urlencoded';
$options['Content-Length'] = strlen($data);
$params = array('http' => array(
'method' => 'POST',
'content' => $data
));
$headers = self::getHeaders($options);
$params['http']['header'] = $headers;
$ctx = stream_context_create($params);
$fp = fopen($url, 'rb', false, $ctx);
if (!$fp) {
throw new Exception("Connection Failed: $url ");
}
if($response_header !== NULL){
$response_header = stream_get_meta_data($fp);
}
$response = stream_get_contents($fp);
if ($response === false) {
throw new Exception("Reading data failed: $url");
}
fclose($fp);
return $response;
}
/**
* Inflate zipped content
*
* @param String $_content, gzipped content
*
* @return String, Inflated content
*/
public static function inflate($_content){
//deflate add 10 charaters before inflate format and 8 charaters checksum append
//gzdecode is not availible for ALL PHP even gzencode is avalible
$_content = substr($_content, 10,-8);
return gzinflate($_content);
}
/**
* Check if the reponse content is zipped from response header
*
* @param Array $_response_header, Response header captured from get/post
*
* @return Boolean, True for zipped contented
*/
public static function isZipped($_response_header){
if (preg_grep('/^Content-Encoding:s*gzip/',$_response_header['wrapper_data'])){
return TRUE;
}else{
return False;
}
}
} // End http
⑼ 介面測試工具jmeter怎麼樣
如何用Jmeter做壓力測試
Jmeter是一個性能測試工具,同loadrunner類似,他功能較多,我們常用的功能是用jmeter模擬多瀏覽器對網站做壓力測試。
下載jmeter地址 :http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi
我們一般的網站,在進入業務功能前先需登錄,然後才能訪問業務功能。下面介紹如何用jmeter登錄系統再對主業務做壓力測試。
1. 運行jmeter
2. 左邊樹將出現測試計劃、工作台兩根節點。
3. 選擇測試計劃,按右鍵-》添加-》threads(users)線程組
線程組能設置以多少個線程並發做壓力測試。
在「循環次數」設置不選擇永遠,循環次數設置1。
4. 現在先介紹如何設置登錄http請求,選擇線程組,右鍵――添加――》sampler-―》http 請求。
http請求即模仿瀏覽器的訪問。
在「伺服器名稱或ip」設置127.0.0.1,埠號設置:8080,「方法」設置post,路徑設置網站登錄的地址,如「/exam/operatorAction」。
登錄需傳入用戶、密碼。在「同請求一起發送參數」列表中添加參數。參數值根據web應用設置。如login_user=0001;login_password=1;actFlag=login
5. 登錄成功後,網站一般將跳入主頁面。在jmap中可做判斷,判斷是否登錄後按預想進入主頁面(此步驟也可不設)。選擇4中的「http請求」,右鍵――》添加――》斷言――》響應斷言。「Apply to」設置Main smaple only;「要測試的響應欄位」設置「url樣本」;「模式匹配規則」設置「包括」,「要測試的模式」增加頁面跳轉到的主頁面,如:「studentMain.jsp」
6. 一般網站登錄後,在tomcat中生成了session,之後訪問其他頁面將無需再次登錄,前提是瀏覽器需支持cookie。在jmap中也同樣,如要繼續訪問其他頁面,還需做下面關鍵的設置。
選擇「線程組」――》右鍵――》添加――》配置元件――》Http cookie管理器。加了此步驟後,http請求將具備cookie功能,即登錄成功後訪問其他頁面將不會跳轉到登錄頁面重新登錄。
7. 對目標頁面反復壓力測試。
7.1 如何使被測頁面反復訪問達到測壓效果。選「線程組」―》右鍵――》邏輯控制器――》循環控制器。循環次數中選擇「永遠」。
7.2 選擇剛加的「循環控制器」,右鍵――》添加――》sampler-―》http 請求,按4步驟設置ip、埠,http請求方法為「get」,路徑為被壓力測試的url,如:「exam/business/studentExam.action.StudentExamAction?action=goIntoMockExam」。
按上面的設置後,已完成配置,可做壓力測試。只需點菜單「運行」――》啟動,即運行壓力測試。
8. jmeter提供了許多壓力結果查看工具。是壓力測試時非常好的分析工具。下面幾種查看工具可有選擇的添加。
8.1 察看結果樹。他記錄每次請求發送數據、響應返回數據。選擇「線程組」――》右鍵――》添加――》察看結果樹。
8.2 用表格查看結果。可查看每次請求的響應時間等。選擇「線程組」――》右鍵――》添加――》用表格查看結果。
8.3 Summary Report。可查看平均響應時間、最長響應時間等。