流行的软件测试工具介绍

作者: oychw | 来源:发表于2018-06-09 11:22 被阅读86次

接口测试

POSTMAN(推荐)

Postman的主要功能

模拟各种HTTP请求:从常用的GET,POST到基于REST的PUT,DELETE ...等等甚至还可以送出档案,送出额外的头。

收集功能:收集是请求的集合,在做完单一个测试的时候,你可以把这次的要求存到特定的收藏里面,如此一来,下次要测试的时候,就不需要重新输入。
养成习惯以后,网站API的每个方法都写好存进去,以后在开发的时候,就可以迅速得看到结果。而收藏还可以导入或是分享出来,让团队里面的其他人,可以一起使用你建立起来的集合。

整理過後的回傳結果:一般在用其他工具來測試的時候,回傳的東西通常都是純文字的生的,但如果是JSON,就是塞成一整行的JSON。这会造成阅读时的障碍,而Postman可以针对回传资料的格式自动美化,JSON,XML或是HTML都会整理成人类可以阅读的型态。

设定环境:Postman可以自由新增环境,一般我们可能会有多种环境,发展,分期或地方,而这几种环境的请求的URL也各不相同新增环境,可以让我们设定一些环境变数,使得切换环境测试的时候,不用重写请求。

[图片上传失败...(image-720fb7-1528514469024)]

另外还支持使用js自定义测试脚本,测试结果还可以存储在云端。

火狐上有类似插件:https://addons.mozilla.org/zh-cn/firefox/addon/poster/,已经比较久没有更新。

  • 技术支持 钉钉群:21745728(可以加钉钉pythontesting邀请加入) qq群:144081101 591302926 567351477

  • 道家技术-手相手诊看相中医等钉钉群21734177 qq群:391441566 184175668 338228106 看手相、面相、舌相、抽签、体质识别。服务费50元每人次起。请联系钉钉或者微信pythontesting

接口自动化性能测试数据分析人工智能从业专家一对一线上培训大纲

HTTPie(推荐)

image.png

HTTPie是HTTP 的命令行客户端。其目标是让 CLI 和 web 服务之间的交互尽可能的人性化。

这个工具提供了简洁的 http 命令,允许通过自然的语法发送任意 HTTP 请求数据,展示色彩化的输出。HTTPie 可用于与 HTTP 服务器做测试、调试和常规交互。

image.png

主要特性:

直观的语法
格式化和色彩化的终端输出
内置 JSON 支持
表单和文件上传
HTTPS、代理和认证
任意请求数据
自定义头部
持久性会话
类 Wget 下载
支持 Python 2.6, 2.7 和 3.x
支持 Linux, Mac OS X 和 Windows
插件
文档
测试覆盖率

HTTPie 是用 Python 编写,用到了 Requests 和 Pygments 这些出色的库。

主页:https://github.com/jakubroztocil/httpie

目前在 Github 获得了 20k+ star。

使用 HTTP GET 方法时,就无需明确指定 HTTP 方法。

<pre class="brush:python;toolbar: true; auto-links: false; hljs xml" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-size: 13px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"># http httpie.org
HTTP/1.1 302 Found
Connection: close
Content-Length: 292
Content-Type: text/html; charset=iso-8859-1
Date: Wed, 04 May 2016 02:11:06 GMT
Location: https://github.com/jkbrzt/httpie
Server: Apache/2.2.15 (CentOS)
X-Awesome: Thanks for trying HTTPie :)<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>302 Found</title></head><body><h1>Found</h1><p>The document has moved <a href="https://github.com/jkbrzt/httpie">here</a>.</p>


<address>Apache/2.2.15 (CentOS) Server at httpie.org Port 80</address></body></html></pre>

查看头部

<pre class="brush:python;toolbar: true; auto-links: false; hljs yaml" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-size: 13px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"># http HEAD http://my.oschina.net/u/1433482/blog/661671?fromerr=RoeLpIRFHTTP/1.1 200 OKConnection: keep-aliveContent-Length: 0Date: Wed, 04 May 2016 02:57:34 GMTServer: TengineSet-Cookie: aliyungf_tc=AQAAAB6D8xIlBgUAY0NpccWR0vhW8yqz; Path=/; HttpOnly</pre>

POST

<pre class="brush:python;toolbar: true; auto-links: false; hljs typescript" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-size: 13px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"># http -f POST http://httpbin.org/post key1=value1 key2=valuesHTTP/1.1 200 OK
Access-Control-Allow-Credentials: trueAccess-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 441Content-Type: application/jsonDate: Wed, 04 May 2016 02:20:37 GMT
Server: nginx
{
"args": {},
"data": "",
"files": {},
"form": {
"key1": "value1",
"key2": "values" },
"headers": {
"Accept": "/",
"Accept-Encoding": "gzip, deflate",
"Content-Length": "23",
"Content-Type": "application/x-www-form-urlencoded; charset=utf-8",
"Host": "httpbin.org",
"User-Agent": "HTTPie/0.9.3" },
"json": null,
"origin": "113.105.67.99",
"url": "http://httpbin.org/post"}
文件下载:http http://automationtesting.sinaapp.com/chrome/site/logo.png > test.png</pre>

curl

  • 背景

    越来越多的应用程序迁移到Web上,为此大量需要HTTP脚本自动地从网络中提取信息,模拟用户post或上传数据到web服务器。

    Curl是用于做各种URL操作和传输的命令行工具。本文关注HTTP请求。并假定你已经会使用 'curl --help'或'curl --manual'获取帮助。

    Curl主要负责发送数据和获取返回,更复杂的功能比如循环请使用python之类的脚本语言。

  • HTTP协议

    HTTP是用来从Web服务器获取数据的协议。它是基于TCP/IP非常简单的协议。该协议还允许信息从客户端发送到服务器。

    HTTP是客户端发送到服务器请求特定的动作的普通ASCII文本行以及服务器返回实际内容前的几行。

    Curl发送一个HTTP请求。该请求包含方法(如GET,POST,HEAD等),请求头,有时还有请求体。 HTTP服务器响应包含状态行,响应头和通常有body。 body部分是你请求的明文数据比如实际的HTML或图像等。

  • 查看协议
    使用curl的选项--verbose(-v的缩写)会显示curl发送到服务器的命令及其他文本信息。

    --trace和--trace-ASCII甚至提供了更多细节。

<pre class="brush:python;toolbar: true; auto-links: false; hljs dust" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-size: 13px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"># curl -v http://automationtesting.sinaapp.com/

  • About to connect() to automationtesting.sinaapp.com port 80 (#0)
  • Trying 113.17.175.80...
  • Connected to automationtesting.sinaapp.com (113.17.175.80) port 80 (#0)

GET / HTTP/1.1
User-Agent: curl/7.29.0
Host: automationtesting.sinaapp.com
Accept: /
< HTTP/1.1 200 Ok< Server: nginx< Date: Tue, 19 Aug 2014 06:48:37 GMT< Content-Type: text/html;charset=utf-8< Transfer-Encoding: chunked< Connection: keep-alive< X-Powered-By-360WZB: wangzhan.360.cn< via: yq26.pyruntime< VAR-Cache: MISS< cache-control: max-age=14400< age: 0<
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">...

curl --trace-ascii debugdump.txt http://automationtesting.sinaapp.com/<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> ...</pre>

  • 查看时间

<pre class="brush:python;toolbar: true; auto-links: false; hljs xml" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-size: 13px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"># curl curl --trace-ascii d.txt --trace-time http://automationtesting.sinaapp.com/<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">...</pre>

  • 查看响应

    默认情况下curl发送响应到stdout。可以使用-o或-O重定向。

  • URL

    统一资源定位符的格式是互联网上资源的地址。比如http://automationtesting.sinaapp.com/。 标准参见:RFC3986。

  • 域名解析
    主机名使用DNS解析或/etc/hosts解析为IP地址,也可以在URL中指定IP地址,而不是名称来指定IP地址。

    通过--resolve可以自定义域名解析: 对于开发等尝试的情况下,你可以点出一个不同的IP地址,比原本可以使用,用卷曲的--resolve选项的主机名:

<pre class="brush:python;toolbar: true; auto-links: false; hljs xml" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-size: 13px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"># curl --resolve www.example.org:8080:127.0.0.1 http://www.example.org/<!doctype html><html><head> <title>Example Domain</title> <meta charset="utf-8" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style type="text/css"> body {
background-color: #f0f0f2;
margin: 0;
padding: 0;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;</pre>

  • 端口和代理

<pre class="brush:python;toolbar: true; auto-links: false; hljs powershell" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-size: 13px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"># curl http://www.example.org:1234/# curl --proxy http://proxy.example.org:4321 http://remote.example.org/</pre>

  • 用户名和密码

<pre class="brush:python;toolbar: true; auto-links: false; hljs cpp" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-size: 13px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"># curl http://user:password@example.org/# curl -u user:password http://example.org/</pre>

  • 抓取网页

  • GET

<pre class="brush:python;toolbar: true; auto-links: false; hljs xml" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-size: 13px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"># curl http://curl.haxx.se<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>curl and libcurl</title># curl -i http://curl.haxx.se
HTTP/1.1 200 OK
Date: Tue, 19 Aug 2014 07:35:43 GMT
Server: Apache/2.4.9 (Debian)
Last-Modified: Tue, 19 Aug 2014 07:25:16 GMT
ETag: "238f-500f6639411b0"
Accept-Ranges: bytes
Content-Length: 9103
Vary: Accept-Encoding
Content-Type: text/html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head></pre>

--include (-i) 可以额外显示响应头。

  • HEAD

    --head (-I)只请求头部。但是有些网站未必支持。

  • 表单

  • GET

<pre class="brush:html;toolbar: true; auto-links: false; hljs xml" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-size: 13px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"><form method="GET" action="junk.cgi"> <input type=text name="birthyear"> <input type=submit name=press value="OK"> </form></pre>

输入'1905',点击OK, 会生成"junk.cgi?birthyear=1905&press=OK"之类的东东。比如第一页是 "www.hotmail.com/when/birth.html",第2也可能是 "www.hotmail.com/when/junk.cgi?birthyear=1905&press=OK"。

<pre class="brush:python;toolbar: true; auto-links: false; hljs xml" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-size: 13px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"># curl "http://www.hotmail.com/when/junk.cgi?birthyear=1905&press=OK"<html><head><title>Object moved</title></head><body><h2>Object
moved to <a href="https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=12&ct=1408435781&rver=6.4.6456.0&wp=MBI&wreply=http:%2F%2Fmail.live.com%2Fwhen%2Fjunk.cgi%3Fbirthyear%3D1905%26press%3DOK&lc=1033&id=64855&mkt=en-US&cbcxt=mai&snsc=1">here</a>.</h2></body></html></pre>

  • POST

    POST的保密性更好:

<pre class="brush:python;toolbar: true; auto-links: false; hljs kotlin" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-size: 13px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"># curl --data "key1=value1&key2=values" http://httpbin.org/post{
"args": {},
"data": "",
"files": {},
"form": {
"key1": "value1",
"key2": "values" },
"headers": {
"Accept": "/",
"Content-Length": "23",
"Content-Type": "application/x-www-form-urlencoded",
"Host": "httpbin.org",
"User-Agent": "curl/7.29.0" },
"json": null,
"origin": "116.31.94.43",
"url": "http://httpbin.org/post"}</pre>

更多实例:

<pre class="brush:python;toolbar: true; auto-links: false; hljs groovy" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-size: 13px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">curl --data "birthyear=1905&press=%20OK%20" http://www.example.com/when.cgi</pre>

上面内容默认使用application/x-www-form-urlencoded类型。如果需要使用未编码的数据:

<pre class="brush:python;toolbar: true; auto-links: false; hljs groovy" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-size: 13px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">curl --data-urlencode "name=I am Daniel" http://www.example.com</pre>

  • 文件上传POST

    定义在RFC 1867中:

<pre class="brush:html;toolbar: true; auto-links: false; hljs xml" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-size: 13px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"><form method="POST" enctype='multipart/form-data' action="upload.cgi"> <input type=file name=upload> <input type=submit name=press value="OK"></form></pre>

执行方式:

<pre class="brush:python;toolbar: true; auto-links: false; hljs nginx" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; display: block; overflow-x: auto; padding: 2px; background: rgb(63, 63, 63); color: rgb(220, 220, 220); border-radius: 3px; line-height: 1.4; word-wrap: normal; font-size: 13px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">curl --form upload=@localfilename --form press=OK [URL]</pre>

相关库,python的https://pypi.python.org/pypi/pycurl。

网络工具

ATC

主页 http://facebook.github.io/augmented-traffic-control/

代码托管:https://github.com/facebook/augmented-traffic-control

ATC(Augmented Traffic Control)允许控制设备与Internet的连接,用于模拟网络条件,比如高速,移动,甚至有问题的网络。涉及带宽、延时、丢包、包损坏、包乱序等情况。
因为ATC在网关上运行时,通过它连入网络的设备可以在基于Django的web页面上面配置相关网络参数。
ATC基于python2.7,使用iptables和TC内部,所以它仅支持Linux平台。

image.png

该环境在centos7上面比较容易搭架,通过无线网卡放出wifi即可。

OCR

tesseract

开源OCR引擎。多用于破解简单的验证码。

开源,地址: https://github.com/tesseract-ocr/tesseract

python相关库:

https://pypi.python.org/pypi/pytesseract Python-tesseract is a python wrapper for google's Tesseract-OCR

https://pypi.python.org/pypi/tesserwrap Basic python bindings to the Tesseract C++ API

https://pypi.python.org/pypi/nidaba Expandable and scalable OCR pipeline

https://pypi.python.org/pypi/pyocr A Python wrapper for OCR engines (Tesseract, Cuneiform, etc)

https://pypi.python.org/pypi/pypdfocr Converts a scanned PDF into an OCR'ed pdf using Tesseract-OCR and Ghostscript

https://pypi.python.org/pypi/ocrodjvu ocrodjvu is a wrapper for OCR systems that allows you to perform OCR on DjVu files.

https://pypi.python.org/pypi/7lk_ocr_deploy Some deploy packages for ocr.

https://pypi.python.org/pypi/ocrmypdf OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched

https://pypi.python.org/pypi/kraken OCR engine compatible with ocropus

持续集成

Buildbot(推荐)

Buildbot是python实现的开源持续构建和持续交付工具,为Mozilla, Chromium, WebKit等知名项目使用。

与Jenkins相比,Buildbot在大陆使用者较少。原因在于Jenkins的界面相对较美观,更容易上手;Jenkins的中文文档比较丰富。但是Jenkins因为资源消耗庞大、不太方便定制而不受一些有实力的公司欢迎。这些不少把目光聚焦在Buildbot。

究竟Buildbot有哪些优点让这些公司青睐呢?Buildbot基于python网络框架Twisted,分布式做得好。Buildbot可以直接使用python包,轻松拥有上万库,具备强大的扩展能力。如果你觉得Jenkins已经轻松地满足你的需求,你不需要Buildbot。如果你在Jenkins时觉得效率低下、扩展困难、一些用python等脚本可以实现的动作在Jenkins困难重重,那么可以看看Buildbot。

image.png

相关库:

https://pypi.python.org/pypi/mozci

It is a commandline client and python library to interact with Mozilla's Buildbot CI (and TaskCluster in the future). It simplifies and unifies querying and triggering jobs.

https://pypi.python.org/pypi/buildbot-www

Buildbot UI

https://pypi.python.org/pypi/buildbot-waterfall-view

Buildbot Waterfall View plugin

https://pypi.python.org/pypi/buildbot-console-view

Buildbot Console View plugin.

https://pypi.python.org/pypi/buildbot-slave

Buildbot Slave Daemon

WAF

主页:https://waf.io/

相关工具:https://pypi.python.org/pypi/waftools

行为驱动

Python: behave, Lettuce、pytest-bdd、lettuce_webdriver、expects、ensure、behave-django、Morelia

Ruby: Cucumber, Spinach
Java: JBehave, JDave, Cucumber
C#: NBehave, SpecFlow, Cucumber
PHP: Behat, Codeception, PhpUnit + Selenium
JavaScript: Cucumber-JS, Yadda, Jasmine-species
Flex: Cucumber

语法标准:Gherkin
GUI编辑器:Squish等。

web测试

Firefox MeasureIt

MeasureIt是一把屏幕尺子,通过它可以丈量页面元素的尺寸。

image.png

Firesizer

用于测试分辨率。较新版本火狐需要The Addon Bar插件的支持。

image.png

FireShot

FireShot 创建完整的网页截图。

截图可以被快速注释以及:

上传到 Picasa、Flickr、ImageShack...

以 PNG、GIF、JPEG、PDF 、BMP格式保存到磁盘

复制到剪贴板

打印

使用电子邮件发送

在外部编辑器中打开

SPOF-O-MATC

SPOF-O-MATIC是一款检测的第三方失败的Chrome扩展。

iMacros

如果你喜欢FireFox网页浏览器,但是厌倦了重复性的任务比如每天访问相同的网站,填写表单,记忆密码,那么iMacros(Firefox版)就是你梦想的解决方案! iMacros设计用来自动执行网页上最具重复性的任务。如果有什么行动你需要重复,只需在iMacros中记录它。下次你需要做它时,只需点击一个按钮整个宏就会运行!有了iMacros,你就可以轻松快速的填写表单,记忆密码,从其它网站下载信息,抓取网页(从多个网站中获取信息),还有更多。你可以在你的计算机上保留宏供自己使用,或者将它们放入网页,博客,公司内部网或者如何社交书签服务和其他人一起分享。使用的极限只取决与你的想象力!*** 任何你用FireFox做的,iMacros都可以自动执行它。***

免费版本支持Firefox、Chrome、Internet Explorer。

收费版本通过屏幕和图片识别技术支持Adobe Flash, Adobe Flex, Silverlight和Java applet。

免费版本无控制流功能。

Telerik

商业工具:Telerik, 基于windows,可以测试web、桌面、移动应用。它是用于功能测试,自动化测试,性能测试和移动应用测试。特性包括:

无脚本测试录制回放。

测试跨流行的浏览器

支持HTML,AJAX,Silverlight、.NET应用程序测试。

能集成在Visual Studio Team Foundation Server中。

能与Nunit, MbUnit等XUnit集成单元测试。

与CruiseControl、MS Build Server, and TeamCity集成,MS构建服务器,以及TeamCity的。

Bug跟踪工具的集成。

Fiddler Web调试集成。

与HP Quality Center集成。

twill

twill是一门简单的语言,允许用户用命令行界面浏览网页。还支持表格,cookies等最标准的Web功能。

twill通过简单的Python接口支持自动化的Web测试。

twill是Python开源软件。

下载:https://pypi.python.org/pypi/twill/
主页:http://twill.idyll.org/
不需要太多编程基础,推荐初学者使用。

测试框架

Robot Framework

Robot Framework是开源的自动化测试验收测试框架,测试用例基于关键字驱动,使用表格式语法。表格可以写在纯文本,HTML,制表符分隔值(TSV),或reST格式的文件中表示。

基于Robot Framework封装开发了大量库,比如appium、selenium。

下面列出部分Robot Framework,它们都可以在https://pypi.python.org
搜索到。

robotframework-httplibrary、robotframework-imaplibrary、robotframework-ioslibrary、robotframework-sshlibrary、robotframework-tools、robotframework-pabot(并行测试)、robotframework-databaselibrary、robotframework-extendedselenium2library、plone.app.robotframework、robotframework-seleniumlibrary、robotframework-ride(编辑器)、robotframework-requests(网络请求)、robotframework-pageobjects、robotremoteserver、TestLink-API-Python-client、robotsuite

Robot Framework的长处在与漂亮的报表、不懂编程也可以使用。缺点是深入使用需要库的开发工作量比较大,有很多python中能直接使用的功能不能调用,对于懂代码的人,不如直接使用pytest等框架来得直接。

参考资料:http://blog.chinaunix.net/uid-20393955-id-3072256.html 后期会撤掉该文。

性能测试

Profile工具

PHP: http://php.net/manual/zh/book.xhprof.php

funkload

Functional and load web tester.
https://pypi.python.org/pypi/funkload
http://funkload.nuxeo.org

Multi-Mechanize(推荐)

Multi-Mechanize 是一个开源的性能和负载测试框架,它并发运行多个 Python 脚本对网站或者服务生成负载(组合事务)。测试输出报告保存为HTML或JMeter的兼容的XML。Multi-Mechanize最常用于web性能 和可扩展性(scalability)测试,也适用于任何python可以访问的API。尤其适合后台性能测试。稍微懂点编程的话,这个工具会远强过商业 的性能测试工具。

主要特性:

支持各种 HTTP methods

高级超链接和HTML表单支持

支持 SSL

自动处理 Cookies

可设置HTTP头

自动处理重定向

支持代理

支持 HTTP 认证

[图片上传失败...(image-e91924-1528514468997)]

Locust(推荐)

Locust是易于使用、分布式的用户负载测试工具。用于网站(或其他系统)的负载测试,计算出系统可以处理并发用户数。

测试时大量蝗虫会攻击你的网站。每只蝗虫(或叫测试用户)可以自定义、测试过程由web界面实时监控。这能帮助测试并确定瓶颈。

Locust 完全基于的事件,单机可以支持数千用户。它不使用回调,而是基于轻量进程gevent, 能简单地实线各种场景。


image.png

Loader.io

Loader.io是一个免费的负载测试服务,可以对你的webapps和API进行上千并发连接的压力测试。上传token文件验证网站之后即可实时或定时测试。

主页:https://loader.io/

GTmetrix

https://gtmetrix.com/ 基于Google的Pagespeed和Yslow,还可以监控网站。

收集关键性能指标如页面加载时间,总页面大小和请求的总数。

在真实Android设备上分析页面。

从世界各地测试你的页面。

主页:https://gtmetrix.com/

LoadWise

LoadWise是一个简单的性能负载测试工具,使用Firefox浏览器脚本记录器。 也可用于功能测试,免费版本只支持三个用户。

Badboy

Badboy是一个功能强大的开源工具,专门用于复杂的Web应用的自动化测试和负载测试。支持录制/回放界面、性能测试、报告等功能,很多地方和JMeter类似,在处理AJAX方面更好。

Webperformance

Webperformance是一个商业负载测试工具,无需安装应用程序和配置服务器。测试启动可以创建基于URL和录制。

主页:http://www.webperformance.com/

WebPagetest

WebPagetest是用于测量和分析网页性能的开源工具。提交URL后它产生的页面级指标问题的报告,包括加载时间,所有加载时间,第一个字节的时间,开始渲染时间,速度指标,DOM元素和返回码。

主页:http://www.webpagetest.org/

百度也提供了类似功能,参见:http://developer.baidu.com/apm/

SourceMonitor

免费程序SourceMonitor可查看软件源代码大小及相对模块复杂度。

分析速度:一万行/秒

支持C++, C, C#, VB.NET, Java, Delphi, Visual Basic (VB6) or HTML

在软件开发过程中保存检查点指标

显示和打印度量表格和图表,包括Kiviat图。

主页:http://www.campwoodsw.com/sourcemonitor.html

性能测试参考资料:

https://blazemeter.com/blog/open-source-load-testing-tools-which-one-should-you-use

移动测试

Eggplant

使用VNC server之类的网关。 支持iOS, Android,Windows Phone, BlackBerry,是基于图像识别的测试工具。脚本:SenseTalk。不受坐标限制。

脚本跨OS、不会修改应用,能完全控制设备。

    商业软件 [http://www.testplant.com/eggplant/testing-tools/](http://www.testplant.com/eggplant/testing-tools/)

CPU Monitor Advanced Lite

来自Google Play,用于监控CPU,可以保存历史记录,并以图形直观展示,但是大陆的应用市场貌似搜索不到,如果能安装请在博客http://my.oschina.net/u/1433482留言,多谢。

通常使用替代:CPU Monitor(豌豆荚)、CPU-Z等。

TestObject

TestObject是拥有成百上千真实设备的测试平台,可以直接通过浏览器访问。上载APP然后可以查看执行情况,支持Robotium, Espresso和Appium。

通常用于安卓机型的测试。

商业软件:https://testobject.com/

有几个类似的提供云测试服务的公司:

云测汇:https://www.yuncehui.cn/ 专注于性能测试

Testin: 即云测,http://testin.cn/ 支持Robotium、淘宝Athrun框架

易测云:支持Robotium、Athrun、Guerrilla等开源测试框架,并使用基于控件识别的、东软自主研发的测试工具Radar。http://www.yiceyun.com/

以上几家没有TestObject强大,但是有中国特色的选择之一。

其他

Powerfuzzer是开源的、高度自动化的,完全可定制,基于其他fuzzer的python web fuzzer。主要针对HTTP协议,生成大量随机数据,试图crash网站。最近更新时间2009,比较久远,为此不做详细介绍。

相关文章

网友评论

    本文标题:流行的软件测试工具介绍

    本文链接:https://www.haomeiwen.com/subject/twlteftx.html