⑴ 接口测试都有哪些,比如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。可查看平均响应时间、最长响应时间等。