joetree 发表于 2007-4-16 15:30:28

关于webload的关联的问题怎么解决???

求救!!!
哪个大哥大姐特别会用webload的?关于这个软件的关联的问题怎么解决???

[ 本帖最后由 joetree 于 2007-4-30 13:42 编辑 ]

keynes_2005 发表于 2007-4-25 11:31:06

很抱歉, 这个工具没有用过. 有用过这个工具的朋友, 给指个招呀!

joetree 发表于 2007-4-29 15:16:25

都没个会的呀...郁闷

Sunda.p 发表于 2007-4-29 16:34:13

大哥大姐帮帮忙吧 我也急需这个问题的解决方法
就当就小弟一命了
谢谢谢谢谢谢

pcl2004_27 发表于 2007-4-29 17:51:53

你把脚本贴出来

pcl2004_27 发表于 2007-4-29 17:57:02

请说明被测试应用系统是什么,是什么关联问题,哪方面关联问题
你是测试dotnet开发的aspnet程序出现的viewstate的问题还是业务出现的关联性问题
还是数据方面的关联问题还是session方面关联问题?

请把脚本贴出来,并把问题描述的清楚一些

joetree 发表于 2007-4-30 11:19:55

我最近在学用webload,这个软件是用的JavaScript脚本语言,使用解析DOM方式,模拟浏览网页时发包收包的动作来实现模拟用户访问页面,
关于关联,意思就是---LR里面那个关联的概念,
服务器有安全机制,对不同的用户会给不同的安全信息字符串,你回应服务器的反映信息里面要带上这个安全信息字符串,可是这个字符串是随机的,需要从服务器的反馈数据包里面去取得,然后把这个字符串赋给一个变量,以后需要这个字符串的时候就可以直接使用这个变量,脚本设计也如此,从而实现模拟不同用户正常访问页面.
在webload里面有
aaaa = extractValue( "wqwq", "12123"," wqwq123112123")
这个内置函数
aaaa就是我定义的后面所要引用的变量名
wqwq是我所规定的字符串左边界值
12123是我所规定的字符串右边界值
wqwq123112123是一个字符串,所取得的字符串从这个字符串里面取得,这个不一定写字符串,可以写变量,去掉引号就是用变量,变量值可以使用一些内置函数取得,比如我使用document.wlHeaders,可以从head头里面取得数据
可是我想从下面的数据取得....就不知道怎么取得了

附件是内制的一些函数的使用方式,不过我没找到能用的

wlHttp.Get("http://www.baidu.com/s?wd=aas&cl=3")
DumpHeaders()

function DumpHeaders() {
    var d=document.wlHeaders;
    var x=0;
    do{
           
       InfoMessage("HEADER#: " + x + " TITLE: " +d.key +
          "VALUE:"+d.value)
       joe = extractValue( "se", "1.0",d.key + "VALUE:"+d.value)
               if (joe != null)
               {       
                       InfoMessage(joe)       
                       break;
               }
       x++;
    } while (x < d.length)
    return;
   
}

这个是我自己写的一个函数,可以把Head头信息打印到屏幕上

joetree 发表于 2007-4-30 11:20:16

function InitAgenda()
{

InFile1 = CopyFile("C:\\as.txt")
Open(InFile1)
}
/***** WLIDE - GlobalInputFile : InFile1 (C:\\as.txt) - ID:15 *****/
strGlobalInputFileLine = GetLine(InFile1,",")
InFile1_Col1 = strGlobalInputFileLine

/***** WLIDE - BeginTransaction - ID:17 *****/
BeginTransaction("Transaction1")

/***** WLIDE - URL : http://www.baidu.com/ - ID:2 *****/
wlGlobals.GetFrames = false
// Request Headers:
// GET: http://www.baidu.com/
// Accept = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
// Accept-Language = zh-cn
// Accept-Encoding = gzip, deflate
// User-Agent = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)
// Host = www.baidu.com
// Proxy-Connection = Keep-Alive
// Cookie = BAIDUID=EB6E222395C81F19D633B74AA356ABE4

aaa = extractValue( "html", "head",InFile1_Col1 )
InfoMessage(aaa)

wlHttp.Header["Accept"] = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, \x2A/\x2A"
wlHttp.Header["Accept-Language"] = "zh-cn"
//wlHttp.Header["Accept-Encoding"] = "gzip, deflate"
wlHttp.Header["User-Agent"] = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)"
wlHttp.Header["Host"] = "www.baidu.com"
wlHttp.Header["Proxy-Connection"] = "Keep-Alive"
wlHttp.Header["Cookie"]= "BAIDUID=EB6E222395C81F19D633B74AA356ABE4"
wlHttp.Get("http://www.baidu.com/")

/***** WLIDE - SetTimer - ID:19 *****/
SetTimer("Timer1")

/***** WLIDE - BuildingBlock:ValueExtraction - ID:14 *****/

bbb = extractValue( "html", "head",InFile1_Col1)
InfoMessage(bbb)

// Status = HTTP/1.1 200 OK
// Response Headers:
// GET: http://www.baidu.com/
// Date = Thu, 12 Apr 2007 07:33:40 GMT
// Server = BWS/1.0
// Content-Length = 3723
// Content-Type = text/html
// Expires = Thu, 12 Apr 2007 07:33:41 GMT
// Cache-Control = max-age=1

/***** WLIDE - URL : http://www.baidu.com/s?wd=aas&cl=3 - ID:4 *****/
// Request Headers:
// GET: http://www.baidu.com/s?wd=aas&cl=3
// Accept = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
// Referer = http://www.baidu.com
// Accept-Language = zh-cn
// Accept-Encoding = gzip, deflate
// User-Agent = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)
// Host = www.baidu.com
// Proxy-Connection = Keep-Alive
// Cookie = BAIDUID=EB6E222395C81F19D633B74AA356ABE4
wlHttp.Header["Accept"] = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, \x2A/\x2A"
wlHttp.Header["Referer"] = "http://www.baidu.com"
wlHttp.Header["Accept-Language"] = "zh-cn"
//wlHttp.Header["Accept-Encoding"] = "gzip, deflate"
wlHttp.Header["User-Agent"] = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)"
wlHttp.Header["Host"] = "www.baidu.com"
wlHttp.Header["Proxy-Connection"] = "Keep-Alive"
wlHttp.Header["Cookie"] = "BAIDUID=EB6E222395C81F19D633B74AA356ABE4"
wlHttp.FormData["wd"] = "aas"
wlHttp.FormData["cl"] = "3"
wlHttp.Get("http://www.baidu.com/s?wd=aas&cl=3")


// Status = HTTP/1.1 200 OK
// Response Headers:
// GET: http://www.baidu.com/s?wd=aas&cl=3
// Date = Thu, 12 Apr 2007 07:33:44 GMT
// Server = BWS/1.0
// Content-Length = 20066
// Content-Type = text/html

/***** WLIDE - URL : http://c.baidu.com/c.gif?t=0&q=aas&p=0&pn=1 - ID:5 *****/
// Request Headers:
// GET: http://c.baidu.com/c.gif?t=0&q=aas&p=0&pn=1
// Accept = */*
// Referer = http://www.baidu.com/s?wd=aas&cl=3
// Accept-Language = zh-cn
// Accept-Encoding = gzip, deflate
// User-Agent = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)
// Host = c.baidu.com
// Proxy-Connection = Keep-Alive
// Cookie = BAIDUID=EB6E222395C81F19D633B74AA356ABE4
wlHttp.Header["Accept"] = "\x2A/\x2A"
wlHttp.Header["Referer"] = "http://www.baidu.com/s?wd=aas&cl=3"
wlHttp.Header["Accept-Language"] = "zh-cn"
//wlHttp.Header["Accept-Encoding"] = "gzip, deflate"
wlHttp.Header["User-Agent"] = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)"
wlHttp.Header["Host"] = "c.baidu.com"
wlHttp.Header["Proxy-Connection"] = "Keep-Alive"
wlHttp.Header["Cookie"] = "BAIDUID=EB6E222395C81F19D633B74AA356ABE4"
wlHttp.FormData["t"] = "0"
wlHttp.FormData["q"] = "aas"
wlHttp.FormData["p"] = "0"
wlHttp.FormData["pn"] = "1"
wlHttp.Get("http://c.baidu.com/c.gif")
DumpHeaders()

// Status = HTTP/1.1 204 No Content
// Response Headers:
// GET: http://c.baidu.com/c.gif?t=0&q=aas&p=0&pn=1
// Cache-Control = private
// Content-Type = text/html
// Server = BWS/1.0
// Content-Length = 0

/***** WLIDE - JavaScriptObject - ID:26 *****/

/***** WLIDE - BuildingBlock:ValueExtraction - ID:25 *****/




function DumpHeaders() {
    var d=document.wlHeaders;
    var x=0;
    do{
           
       InfoMessage("HEADER#: " + x + " TITLE: " +d.key +
          "VALUE:"+d.value)
       joe = extractValue( "se", "1.0",d.key + "VALUE:"+d.value)
               if (joe != null)
               {       
                       InfoMessage(joe)       
                       break;
               }
       x++;
    } while (x < d.length)
    return;
   
}

/***** WLIDE - URL : http://www.baidu.com/s?ie=gb2312&bs=aas&sr=&z=&cl=3&f=8&wd=fddf&ct=0 - ID:7 *****/
// Request Headers:
// GET: http://www.baidu.com/s?ie=gb2312&bs=aas&sr=&z=&cl=3&f=8&wd=fddf&ct=0
// Accept = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
// Referer = http://www.baidu.com/s?wd=aas&cl=3
// Accept-Language = zh-cn
// Accept-Encoding = gzip, deflate
// User-Agent = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)
// Host = www.baidu.com
// Proxy-Connection = Keep-Alive
// Cookie = BAIDUID=EB6E222395C81F19D633B74AA356ABE4
wlHttp.Header["Accept"] = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, \x2A/\x2A"
wlHttp.Header["Referer"] = "http://www.baidu.com/s?wd=aas&cl=3"
wlHttp.Header["Accept-Language"] = "zh-cn"
//wlHttp.Header["Accept-Encoding"] = "gzip, deflate"
wlHttp.Header["User-Agent"] = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)"
wlHttp.Header["Host"] = "www.baidu.com"
wlHttp.Header["Proxy-Connection"] = "Keep-Alive"
wlHttp.Header["Cookie"] = "BAIDUID=EB6E222395C81F19D633B74AA356ABE4"
wlHttp.FormData["ie"] = "gb2312"
wlHttp.FormData["bs"] = "aas"
wlHttp.FormData["sr"] = "$WL$EMPTY$STRING$"
wlHttp.FormData["z"] = "$WL$EMPTY$STRING$"
wlHttp.FormData["cl"] = "3"
wlHttp.FormData["f"] = "8"
wlHttp.FormData["wd"] = "fddf"
wlHttp.FormData["ct"] = "0"
wlHttp.Get("http://www.baidu.com/s")



// Status = HTTP/1.1 200 OK
// Response Headers:
// GET: http://www.baidu.com/s?ie=gb2312&bs=aas&sr=&z=&cl=3&f=8&wd=fddf&ct=0
// Date = Thu, 12 Apr 2007 07:33:50 GMT
// Server = BWS/1.0
// Content-Length = 18034
// Content-Type = text/html

joetree 发表于 2007-4-30 11:20:28

/***** WLIDE - URL : http://c.baidu.com/c.gif?t=0&q=fddf&p=0&pn=1 - ID:8 *****/
// Request Headers:
// GET: http://c.baidu.com/c.gif?t=0&q=fddf&p=0&pn=1
// Accept = */*
// Referer = http://www.baidu.com/s?ie=gb2312&bs=aas&sr=&z=&cl=3&f=8&wd=fddf&ct=0
// Accept-Language = zh-cn
// Accept-Encoding = gzip, deflate
// User-Agent = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)
// Host = c.baidu.com
// Proxy-Connection = Keep-Alive
// Cookie = BAIDUID=EB6E222395C81F19D633B74AA356ABE4
wlHttp.Header["Accept"] = "\x2A/\x2A"
wlHttp.Header["Referer"] = "http://www.baidu.com/s?ie=gb2312&bs=aas&sr=&z=&cl=3&f=8&wd=fddf&ct=0"
wlHttp.Header["Accept-Language"] = "zh-cn"
//wlHttp.Header["Accept-Encoding"] = "gzip, deflate"
wlHttp.Header["User-Agent"] = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)"
wlHttp.Header["Host"] = "c.baidu.com"
wlHttp.Header["Proxy-Connection"] = "Keep-Alive"
wlHttp.Header["Cookie"] = "BAIDUID=EB6E222395C81F19D633B74AA356ABE4"
wlHttp.FormData["t"] = "0"
wlHttp.FormData["q"] = "fddf"
wlHttp.FormData["p"] = "0"
wlHttp.FormData["pn"] = "1"
wlHttp.Get("http://c.baidu.com/c.gif")


// Status = HTTP/1.1 204 No Content
// Response Headers:
// GET: http://c.baidu.com/c.gif?t=0&q=fddf&p=0&pn=1
// Cache-Control = private
// Content-Type = text/html
// Server = BWS/1.0
// Content-Length = 0

/***** WLIDE - SendTimer - ID:20 *****/
SendTimer("Timer1")

/***** WLIDE - JavaScriptObject - ID:27 *****/


wlHttp.Get("http://www.baidu.com")

// Cookie is captured and set in variable myCookie
myCookie = wlHtml.GetHeaderValue("cookie")

// Cookie is then displayed
InfoMessage("cookie is " + myCookie)

/***** WLIDE - URL : http://www.baidu.com/s?ie=gb2312&bs=fddf&sr=&z=&cl=3&f=8&wd=asdasd&ct=0 - ID:10 *****/
// Request Headers:
// GET: http://www.baidu.com/s?ie=gb2312&bs=fddf&sr=&z=&cl=3&f=8&wd=asdasd&ct=0
// Accept = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
// Referer = http://www.baidu.com/s?ie=gb2312&bs=aas&sr=&z=&cl=3&f=8&wd=fddf&ct=0
// Accept-Language = zh-cn
// Accept-Encoding = gzip, deflate
// User-Agent = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)
// Host = www.baidu.com
// Proxy-Connection = Keep-Alive
// Cookie = BAIDUID=EB6E222395C81F19D633B74AA356ABE4
wlHttp.Header["Accept"] = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, \x2A/\x2A"
wlHttp.Header["Referer"] = "http://www.baidu.com/s?ie=gb2312&bs=aas&sr=&z=&cl=3&f=8&wd=fddf&ct=0"
wlHttp.Header["Accept-Language"] = "zh-cn"
//wlHttp.Header["Accept-Encoding"] = "gzip, deflate"
wlHttp.Header["User-Agent"] = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)"
wlHttp.Header["Host"] = "www.baidu.com"
wlHttp.Header["Proxy-Connection"] = "Keep-Alive"
wlHttp.Header["Cookie"] = "BAIDUID=EB6E222395C81F19D633B74AA356ABE4"
wlHttp.FormData["ie"] = "gb2312"
wlHttp.FormData["bs"] = "fddf"
wlHttp.FormData["sr"] = "$WL$EMPTY$STRING$"
wlHttp.FormData["z"] = "$WL$EMPTY$STRING$"
wlHttp.FormData["cl"] = "3"
wlHttp.FormData["f"] = "8"
wlHttp.FormData["wd"] = joe
wlHttp.FormData["ct"] = "0"
wlHttp.Get("http://www.baidu.com/s")



// Status = HTTP/1.1 200 OK
// Response Headers:
// GET: http://www.baidu.com/s?ie=gb2312&bs=fddf&sr=&z=&cl=3&f=8&wd=asdasd&ct=0
// Date = Thu, 12 Apr 2007 07:33:53 GMT
// Server = BWS/1.0
// Content-Length = 18520
// Content-Type = text/html

/***** WLIDE - EndTransaction - ID:18 *****/
EndTransaction("Transaction1",WLSuccess,false)

/***** WLIDE - URL : http://c.baidu.com/c.gif?t=0&q=asdasd&p=0&pn=1 - ID:11 *****/
// Request Headers:
// GET: http://c.baidu.com/c.gif?t=0&q=asdasd&p=0&pn=1
// Accept = */*
// Referer = http://www.baidu.com/s?ie=gb2312&bs=fddf&sr=&z=&cl=3&f=8&wd=asdasd&ct=0
// Accept-Language = zh-cn
// Accept-Encoding = gzip, deflate
// User-Agent = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)
// Host = c.baidu.com
// Proxy-Connection = Keep-Alive
// Cookie = BAIDUID=EB6E222395C81F19D633B74AA356ABE4
wlHttp.Header["Accept"] = "\x2A/\x2A"
wlHttp.Header["Referer"] = "http://www.baidu.com/s?ie=gb2312&bs=fddf&sr=&z=&cl=3&f=8&wd=asdasd&ct=0"
wlHttp.Header["Accept-Language"] = "zh-cn"
//wlHttp.Header["Accept-Encoding"] = "gzip, deflate"
wlHttp.Header["User-Agent"] = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)"
wlHttp.Header["Host"] = "c.baidu.com"
wlHttp.Header["Proxy-Connection"] = "Keep-Alive"
wlHttp.Header["Cookie"] = "BAIDUID=EB6E222395C81F19D633B74AA356ABE4"
wlHttp.FormData["t"] = "0"
wlHttp.FormData["q"] = aaa
wlHttp.FormData["p"] = "0"
wlHttp.FormData["pn"] = "1"
wlHttp.Get("http://c.baidu.com/c.gif")



// Status = HTTP/1.1 204 No Content
// Response Headers:
// GET: http://c.baidu.com/c.gif?t=0&q=asdasd&p=0&pn=1
// Cache-Control = private
// Content-Type = text/html
// Server = BWS/1.0
// Content-Length = 0

这个是全部脚本,不过我感觉给出脚本也没用,关联问题对于压力测试软件很常见,是个普遍的问题.....应该对于一款压力测试软件来说,有一个普遍的解决方法....而且我问过老测试工程师,他们说webload6.0以上的版本绝对可以实现关联......时间长了,忘了而已,再说这个软件参数化,集合点,事件添加都很全...不可能没有关联这个功能

joetree 发表于 2007-4-30 13:43:59

回复 #6 pcl2004_27 的帖子

为什么我不能发附件??sdlkfj9

这个文档你要吗?是它官方的一个脚本编译说明

junny 发表于 2007-7-21 14:01:25

http://hi.baidu.com/junny%5Fz/blog/item/3fe4742cf41bf4ee8a13999b.html      这里有webload做关联的方法,你可以看下。
页: [1]
查看完整版本: 关于webload的关联的问题怎么解决???