For some reason, I need to get response data size for particular web pages. From Loadrunner, there is one simple method to call: web_get_int_property()
it supports:
- HTTP_INFO_RETURN_CODE
- HTTP_INFO_DOWNLOAD_SIZE
- HTTP_INFO_DOWNLOAD_TIME
- HTTP_INFO_TOTAL_REQUEST_STAT
- HTTP_INFO_TOTAL_RESPONSE_STAT
code sample:
...................
web_browser("www.google.com",
DESCRIPTION,
ACTION,
"Navigate=http://www.google.com/",
LAST);
downloadsize=web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);
lr_log_message("%s,size=%d",lr_eval_string("{username}"),downloadsize);
....................
another input from one's blog:
http://www.cptloadtest.com/2005/05/10/PageSizeMonitorInLoadRunner.aspx
it might useful for you to monitor your page size
Thursday, January 08, 2009
解惑
茌姓
茌[茌,读音作chí(ㄔˊ)]
一.姓氏渊源:
第一个渊源:源于姬姓,出自春秋时期曹国古茌丘,属于以居邑名称为氏。
春秋时期,周文王之子曹叔振铎(姬振铎)被其兄周武王封于曹(今山东定陶),建曹国,都陶丘,辖地大致为今山东定陶一带,为伯爵诸侯国。曹国有地名重邑,后改茌丘。公元前487年,宋国灭曹国,收其茌丘为茌邑,后改山茌城(今山东济南历城党家庄镇),其居人以邑为姓氏,称茌丘氏,后省文简化为茌氏。
第二个渊源:源于姜姓,出自炎帝大臣吴权之后裔吴中,属于以帝王赐爵名称为氏。
吴中(公元1373~1442年),武城人。著名明朝重臣。明朝洪武末年为营州后屯卫经历。明成祖朱棣取大宁,迎降。因运军饷、守御有功,晋升为右都御史。明永乐五年(公元1407年)改任工部尚书,后从北征,艰归,改任刑部尚书。明永乐十九年 (公元1421年),吴中与户部左侍郎夏原吉、兵部尚书方宾等同上奏北征军饷困难,因而违反了帝意,被关进监狱。明仁宗朱高炽即位后复官,加封太子少保。明宣德元年(公元1426年)从征乐安,明宣德三年(公元1428年)坐以官木石遗中官杨庆作宅,下狱,后被保释,夺禄一年。明正统六年(公元1441 年)复官,升任太子少保。
吴中勤敏多计算,先后在工部二十余年。今北京的宫殿、长、献、景三帝寝陵,皆分所营建。吴中职务填委,规画井然。然不恤工匠。湛于声色,时论鄙悖。
吴中于明正统七年(公元1442年)逝世,终年七十岁,追封茌平伯,赐谥为“荣襄”。在其后裔中,有以其封号为姓氏者,称茌氏。
二.迁徙分布:
今茌氏族人主要分布在江苏省徐州、丰县一带地区
茌[茌,读音作chí(ㄔˊ)]
一.姓氏渊源:
第一个渊源:源于姬姓,出自春秋时期曹国古茌丘,属于以居邑名称为氏。
春秋时期,周文王之子曹叔振铎(姬振铎)被其兄周武王封于曹(今山东定陶),建曹国,都陶丘,辖地大致为今山东定陶一带,为伯爵诸侯国。曹国有地名重邑,后改茌丘。公元前487年,宋国灭曹国,收其茌丘为茌邑,后改山茌城(今山东济南历城党家庄镇),其居人以邑为姓氏,称茌丘氏,后省文简化为茌氏。
第二个渊源:源于姜姓,出自炎帝大臣吴权之后裔吴中,属于以帝王赐爵名称为氏。
吴中(公元1373~1442年),武城人。著名明朝重臣。明朝洪武末年为营州后屯卫经历。明成祖朱棣取大宁,迎降。因运军饷、守御有功,晋升为右都御史。明永乐五年(公元1407年)改任工部尚书,后从北征,艰归,改任刑部尚书。明永乐十九年 (公元1421年),吴中与户部左侍郎夏原吉、兵部尚书方宾等同上奏北征军饷困难,因而违反了帝意,被关进监狱。明仁宗朱高炽即位后复官,加封太子少保。明宣德元年(公元1426年)从征乐安,明宣德三年(公元1428年)坐以官木石遗中官杨庆作宅,下狱,后被保释,夺禄一年。明正统六年(公元1441 年)复官,升任太子少保。
吴中勤敏多计算,先后在工部二十余年。今北京的宫殿、长、献、景三帝寝陵,皆分所营建。吴中职务填委,规画井然。然不恤工匠。湛于声色,时论鄙悖。
吴中于明正统七年(公元1442年)逝世,终年七十岁,追封茌平伯,赐谥为“荣襄”。在其后裔中,有以其封号为姓氏者,称茌氏。
二.迁徙分布:
今茌氏族人主要分布在江苏省徐州、丰县一带地区
AutoITX3, it helps to make automation happen
Once you got such an error, when you run in ruby:
Unknown OLE server: `AutoItX3.Control' (WI2OLERuntimeError)
that might mean you have not registed the AutoItX3.dll in your computer,
in current Watir version, AutoItX3.dll has been included in the watir folder,
so Run the command in "Run":
regsvr32 "C:\ruby\lib\ruby\gems\1.8\gems\watir-1.6.2\lib\watir\AutoItX3.dll"
note: you need to pick up your own path of where AutoItX3.dll locates.
then you will not get the errors :)
learn AutoItX3, please go to http://www.autoitscript.com/autoit3/index.shtml
I just want to use it to handle the popup windows when writing Watir scripts
Unknown OLE server: `AutoItX3.Control' (WI2OLERuntimeError)
that might mean you have not registed the AutoItX3.dll in your computer,
in current Watir version, AutoItX3.dll has been included in the watir folder,
so Run the command in "Run":
regsvr32 "C:\ruby\lib\ruby\gems\1.8\gems\watir-1.6.2\lib\watir\AutoItX3.dll"
note: you need to pick up your own path of where AutoItX3.dll locates.
then you will not get the errors :)
learn AutoItX3, please go to http://www.autoitscript.com/autoit3/index.shtml
I just want to use it to handle the popup windows when writing Watir scripts
How to handle the popup window using watir scripts
sometimes, we will meet the popup window issue with our automation scripts, it can not catch the window easily, so use the AutoItX3, we can solve this kind of problem well:
require "watir"
require "win32ole"
def check_for_popup_window
flag =0
autoit = WIN32OLE.new('AutoItX3.Control')
while (flag ==0)
# check the popup window status, set the timeout =1
flag = autoit.WinWait("Microsoft Internet Explorer", "", 1)
#another way to do this, you can get the popup info with autoit Spy tool
#autoit.ControlClick("Microsoft Internet Explorer", "", "[CLASS:Button; INSTANCE:1]")
puts(flag)
# If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}).
if (flag==1) then autoit.Send("{Enter}") end
sleep(0.5)
end
end
#main body of watir program:
ie = Watir::IE.new
ie.speed = :fast
puts "Step 5: Click one vendor detail link"
#create a new thread to call check for popup window method
popup = Thread.new {check_for_popup_window}
ie.goto test_vendorURI
sleep 1
#tear down the thread has been created
at_exit { Thread.kill(popup) }
require "watir"
require "win32ole"
def check_for_popup_window
flag =0
autoit = WIN32OLE.new('AutoItX3.Control')
while (flag ==0)
# check the popup window status, set the timeout =1
flag = autoit.WinWait("Microsoft Internet Explorer", "", 1)
#another way to do this, you can get the popup info with autoit Spy tool
#autoit.ControlClick("Microsoft Internet Explorer", "", "[CLASS:Button; INSTANCE:1]")
puts(flag)
# If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}).
if (flag==1) then autoit.Send("{Enter}") end
sleep(0.5)
end
end
#main body of watir program:
ie = Watir::IE.new
ie.speed = :fast
puts "Step 5: Click one vendor detail link"
#create a new thread to call check for popup window method
popup = Thread.new {check_for_popup_window}
ie.goto test_vendorURI
sleep 1
#tear down the thread has been created
at_exit { Thread.kill(popup) }
A simple example for Xpath on web service test
when you do automation test or performance test on web service, you may need to do some correlation work on dynamic value returned by server.
Take Jmeter as an example, for correlation work, there is two ways to catch dynamic value
1. using Regular Expression Extractor-- you can write simple Regular Expression to extract the value
2. using XPath Extractor--write Xpath to seek the value
Here is a simple example to show how you deal with web service correlation work using Xpath :
I want to get the token value returned by the server, here is the response XML:
true
3FBCB0BDA521B5BC1A399AC094063993D26BC70BA1E3175927D6F
Xpath: //*[local-name()='token']
how about there is the namespace in the XML?? just like this:
getResetPasswordTokenResponse xmlns:ns1="http://user.123.com/user_security_service">
true
3FBCB0BDA521B5BC1A399AC094063993D26BC70BA1E3175927D6F
XPath://*[local-name()='token' and namespace-uri()="http://api.user.123.com"]
it is simple, and user-friendly :)
at Last, you can test your Xpath expression here : http://www.mizar.dk/XPath/Default.aspx
hope this helps!
Take Jmeter as an example, for correlation work, there is two ways to catch dynamic value
1. using Regular Expression Extractor-- you can write simple Regular Expression to extract the value
2. using XPath Extractor--write Xpath to seek the value
Here is a simple example to show how you deal with web service correlation work using Xpath :
I want to get the token value returned by the server, here is the response XML:
Xpath: //*[local-name()='token']
how about there is the namespace in the XML?? just like this:
XPath://*[local-name()='token' and namespace-uri()="http://api.user.123.com"]
it is simple, and user-friendly :)
at Last, you can test your Xpath expression here : http://www.mizar.dk/XPath/Default.aspx
hope this helps!
using Xpath way in Watir with Caution---slowness
i am used to write watir scripts to do the single user performance test or launch it under load test, it helps a lot when I want to get the response time from real user experience perspective.
but there is some situation i need to use Xpath to get the object which is to be clicked....
ie.button(:xpath, "//div[@id='ContentWrapper']/div/div[3]/a/img").click
i find it is realllllly slow when Watir is seeking the object within the Dom, i realize this way is not suitable for me to get response time,just for automation test maybe....
for almost situation i need to click the objects, i always use:
ie.link(:index,"118").click
or I change Post into Get method to get the same thing, for example:
Change : ie.button(:xpath, "//div[@id='ContentWrapper']/div/div[3]/a/img").click
into :
ie.goto "http://1.2.3.4/search.do?para1=performance&pageNumber=1"
so anyway, I like Watir, but using Xpath way in Watir with Caution, it is a little bit slow....
but there is some situation i need to use Xpath to get the object which is to be clicked....
ie.button(:xpath, "//div[@id='ContentWrapper']/div/div[3]/a/img").click
i find it is realllllly slow when Watir is seeking the object within the Dom, i realize this way is not suitable for me to get response time,just for automation test maybe....
for almost situation i need to click the objects, i always use:
ie.link(:index,"118").click
or I change Post into Get method to get the same thing, for example:
Change : ie.button(:xpath, "//div[@id='ContentWrapper']/div/div[3]/a/img").click
into :
ie.goto "http://1.2.3.4/search.do?para1=performance&pageNumber=1"
so anyway, I like Watir, but using Xpath way in Watir with Caution, it is a little bit slow....
2009是憧憬的一年
经过2008这个多事之年,其实不想过多的回忆什么,倒是有种赶紧熬过2008年的感觉。。。。
冬天即将过去,春天还会远吗?
对于2009年,充满的更多是希望,想借个理由对自己说:新的开始,抛掉所有的不快,让我们重新上路。。。。。。
生活还将继续,而不同的是我们自己对待生活的态度:)
Happy 2009!! A brand New Life is Coming!
冬天即将过去,春天还会远吗?
对于2009年,充满的更多是希望,想借个理由对自己说:新的开始,抛掉所有的不快,让我们重新上路。。。。。。
生活还将继续,而不同的是我们自己对待生活的态度:)
Happy 2009!! A brand New Life is Coming!
I miss Sierra Nevada Beer
突然想起前年在san jose 酒吧里喝到的啤酒,Sierra Nevada,啤酒的色泽跟我们普通喝到的啤酒不同,有些偏深,喝到嘴里苦中带甜,有股花瓣的清香。。。。(不知道是不是给女士喝的,哈哈,不过确实听好喝,价格也不是很贵)

不过还有一件印象深刻的是喝酒之前被服务员要求看护照,因为没带,所以问了句:“只带了国内身份证,能行不?”(注意,我的身份证还不是第二代的,还是最老款的那种,字迹还不是很清晰)
服务员看了看,说问问老板,说着拿着身份证去给经理过过眼
大概过了5分钟,他走过来,拿着啤酒单,对我微笑着说,没问题,您需要什么酒。。。同事都对我笑了,说明我看起来还年轻。。。。
新年了,祝大家有一个新的开始,如果国内有买这个酒的话,我想拿着它跟大家干杯!Cheers Up!
不过还有一件印象深刻的是喝酒之前被服务员要求看护照,因为没带,所以问了句:“只带了国内身份证,能行不?”(注意,我的身份证还不是第二代的,还是最老款的那种,字迹还不是很清晰)
服务员看了看,说问问老板,说着拿着身份证去给经理过过眼
大概过了5分钟,他走过来,拿着啤酒单,对我微笑着说,没问题,您需要什么酒。。。同事都对我笑了,说明我看起来还年轻。。。。
新年了,祝大家有一个新的开始,如果国内有买这个酒的话,我想拿着它跟大家干杯!Cheers Up!
Do not shout at your JBoss!
An interesting post by Brendan Gregg who did a very unthinkable experiment to his JBoss server.
So he found that when he shout at the JBoss server, the server will take a long Disk I/O latency....so he give us a "take away", do not shout at your Jboss if you want a high performance! :)
here is the link of Brendan Gregg's experiment:
http://blogs.sun.com/brendan/entry/unusual_disk_latency
So he found that when he shout at the JBoss server, the server will take a long Disk I/O latency....so he give us a "take away", do not shout at your Jboss if you want a high performance! :)
here is the link of Brendan Gregg's experiment:
http://blogs.sun.com/brendan/entry/unusual_disk_latency
Class SimpleDateFormat is not thread safe
One tiny find this week from our team,during I run the load testing and there is one step we need to fill the target date into the text box.
in our code, we need to parse date/time format using SimpleDateFormat class, so if IthreadA is parsing a value while threadB is changing the pattern, then error message bellowing could happen,"occasionally":
"This is a pitfall from JDK" :) I am not sure how many of you already release it....
You can look at the interesting article from Brian Goetz
http://www.ibm.com/developerworks/java/library/j-jtp09263.html
in our code, we need to parse date/time format using SimpleDateFormat class, so if IthreadA is parsing a value while threadB is changing the pattern, then error message bellowing could happen,"occasionally":
java.lang.NumberFormatException: For input string: ""So, we just simply change the definition of SimpleDateFormat object from class variable to local variable, this problem have been solved!
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Long.parseLong(Long.java:424)
at java.lang.Long.parseLong(Long.java:461)
at java.text.DigitList.getLong(DigitList.java:167)
at java.text.DecimalFormat.parse(DecimalFormat.java:1271)
at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1375)
at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1124)
at java.text.DateFormat.parse(DateFormat.java:333)
at com.XXXX.struts.DateConverter.convert(DateConverter.java:41)
at org.apache.commons.beanutils.ConvertUtilsBean.convert(ConvertUtilsBean.java:428)
"This is a pitfall from JDK" :) I am not sure how many of you already release it....
You can look at the interesting article from Brian Goetz
http://www.ibm.com/developerworks/java/library/j-jtp09263.html
Subscribe to:
Posts (Atom)