测试容易漏测点——url规范化

上一篇 / 下一篇  2017-02-13 15:39:09

很多时候,我们测试会着重注意功能场景的测试,一些细枝末节的地方会漏掉,虽然不是重要的功能,但是也要尤为注意。常常漏测的问题主要有三个:1.页面的标题和icon错误;2.弹出框标题和页面标题不一致;3.页面url不规范

这里主要介绍一下url规范化。

URL组成:
protocol :// hostname[:port] / path / [;parameters][?query]#fragment
  协议://主机名[:端口]/ 路径/[:参数] [?查询]#Fragment

不规范的URL:
1 URL中多余的字符
1.1 子域名的URL中包含"www":  "http://www.shuchao.cnblogs.com/"
1.2 含有默认端口: "http://www.cnblogs.com:80/shuchao/"
1.3 松散的URL: "http://www.chapters.indigo.ca/books/amazon-sucks-donkey-balls/9780470170779-item.html"
1.4 多余默认文件名index.html,default.aspx等:"http://www.cnblogs.com/shuchao/index.html"
1.5 文件路径中
     (1) 多余的"/":"http://www.cnblogs.com/shuchao//"
     (2) 多余的点修饰串:"x/y/z/http://www.cnblogs.com/a/b/http://www.cnblogs.com/../page.html"
1.6 查询串中多余的
     (1) ? (空查询串):http://www.cnblogs.com/shuchao? 
     (2) & 
     (3) 无用的查询变量:http://www.example.com/display?id=123&fake=fake
2 URL缺少字符串
2.1 缺少"/":"http://www.cnblogs.com/shuchao"
2.2 查询串缺少名称或者值:"http://www.example.com/display?id=" 或者 "http://www.example.com/display?=123"
3 其他不规范的URL
3.1 "http://shuchao.cnblogs.com/" 与 "http://www.cnblogs.com/shuchao/"其实是相同的内容
3.2 使用IP代替域名
3.3 含有扩充字符(extended characters),大小写敏感("http://www.google.cn/Intl/zh-CN/about.html" 和"http://www.google.cn/intl/zh-CN/about.html")
3.4 "+"和"%20"混用
3.5 查询变量顺序混乱:"http://www.example.com/test.aspx?bar=1&a=test"
3.6 含临时的状态变量:http://www.example.com/test?back=/prevpage.aspx

URL规范化过程:
1.URL协议名和主机名小写化
HTTP://WWW.EXAMPLE.com/test   -> http://www.example.com/test
2.escape序列转化为大写,因为escape序列大小敏感
%3a ->%3A
3.删除Fragment(#)
http://www.example.com/test/index.html#seo -> http://www.example.com/test/index.html
4.删除空查询串的'?'
http://www.example.com/test?  ->  http://www.example.com/test
5.删除默认后缀
http://www.example.com/test/index.html   ->  http://www.example.com/test/
6.删除多余的点修复符
  http://www.example.com/../a/b/../c/./d.html -> http://www.example.com/a/c/d.html 
7.删除多余的"www"
http://www.test.example.com/  -> http://test.example.com/
8.对查询变量排序
 http://www.example.com/test?id=123&fakefoo=fakebar → http://www.example.com/test?id=123 \
9.删除取默认值的变量
http://www.example.com/test?id=&sort=ascending → http://www.example.com/test
10.删除多余的查询串,如?,&
 http://www.example.com/test? → http://www.example.com/test
11.Dust 规则(Schonfeld 等人提出的启发式方法)
http://www.example.com/test?id=123 -> http://www.example.com/test_123

TAG:

 

评分:0

我来说两句

我的栏目

日历

« 2024-04-23  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 139133
  • 日志数: 63
  • 建立时间: 2016-03-09
  • 更新时间: 2017-06-06

RSS订阅

Open Toolbar