Know that Google TE fewer people, because the research and development of early defect prevention and detection do enough, in addition to a variety of tests to build a good foundation, the RD design and code quality high graves and or test execution resources, so without much TE. But later want to add the TE, should be aware of existing quality assurance processes and the ability to model the existence of loopholes in the release part not handle, only to change their view to how much pressure people to change values
Technology Without Borders, to carry forward the selfless spirit of sharing
2013/03/25
About the the performance test tesseract-ocr tools to identify some of the ideas in the verification code
About the the performance test tesseract-ocr tools to identify some of the ideas in the verification code
The last week, I engaged in the verification code, fortunately tesseract-ocr tools can identify the characters stored in the local picture, is to take advantage of this, a lot of friends this function is used in the identification verification code (some verification code can not be identified, the accuracy is not high, it may hinder the identification to verify the presence of noise in the code). I is just copy or imitate the, solve the problem of the LoadRunner identify verification code, all C-based environments. Can see my blog post: http://www.cnblogs.com/zhuque/archive/2013/03/06/2946565.html
Tesseract-ocr tools for some verification code recognition accuracy is not too high, and even some picture identification simply does not come out, it is recommended that formal stress tests, do not use this method to solve the problem of verification code, the better approach is in code to solve, or using a universal verification code. Another method is the the login transaction code (involving verification code code) into vuser_init () to that after a successful login, the frequent pressure measured behind the transaction. But there are many transactions of the type of operation and verification code, such as: the payment of this you must use a universal verification code.
Do not tangle in the performance testing process verification code, after all, more than 98% of the performance test are specialized independent test environment can modify the code to solve the verification code problems, there are many ways. But does not rule out some metamorphosis the CTO or customer requirements online environment pressure measured, we can try to tesseract-ocr recognition verification code, if you can not identify, and then to try to remove the noise in the captcha identification. How to remove captcha the noise go after study, evidently, this is a big project.
LoadRunner using the system () function call Tesseract-OCR recognition verification code script code
Here is loadrunner script: C disk Establish test.bat batch:
Action ()
{
int flen; / / define an integer variable to hold the size of the file
long filedes; / / save the file handle
char file [256] = "c: \ \ test1.jpg"; / / save the file path and file name
char result [10]; / / store verification code
web_set_max_html_param_len ("2000000") ;
/ / set the page to receive the maximum number of bytes, the setting should be greater than the download file size
web_reg_save_param ("pic",
"LB =",
"RB =",
"Ord = 1",
"Search = Body",
LAST);
web_url ("randpiccloud", "URL = https://passport.csdn.net/ajax/verifyhandler.ashx?r_d=63178", LAST);
/ / Http://biz.ftuan.com/CheckImg.aspx
/ / Http://passport.ftuan.com/SecurityCode.aspx?refresh=Wed Mar 6 11:21:21 UTC +0800 2013
/ / Http://comment8.mydrivers.com/radompage.aspx?0. {Rnum}
/ / Https://passport.gaopeng.com/captcha?w=98&h=36&r=0.4655476964544505
/ / Https://passport.csdn.net/ajax/verifyhandler.ashx?r_d=63178
flen = web_get_int_property (HTTP_INFO_DOWNLOAD_SIZE); / / get file size
if (flen> 0)
{
if ((filedes = fopen (file, "wb")) == NULL)
{
lr_output_message ("oh cloud your Open File Failed!");
return -1;
}
fwrite (lr_eval_string ("{pic}"), flen, 1, filedes);
fclose (filedes);
}
system ("c: \ \ test.bat");
/ / Call the C drive under test.bat file, change the file as follows:
/ *
c:
cd C: \ Program Files \ Tesseract-OCR
tesseract.exe c: \ test1.jpg c: \ test-l
* /
/ / First, download the the Tesseract tools and installation, must cd to the installation directory in a batch file, or LR called the prompt "tesseract.exe than internal command"
if ((filedes = fopen ("c: \ \ test.txt", "rt")) == NULL)
{
lr_output_message ("oh, cloud your Open File Failed!");
return -1;
}
fread (result, 5,1, filedes); / / here to control the length of the verification code
fclose (filedes);
lr_output_message ("result:% s", result);
lr_save_string (result, "txtCheck"); / / pass validation code to txtCheck parameters
lr_output_message ("txtCheck:% s", lr_eval_string ("{txtCheck}")); / / lr_eval_string ("{txtCheck}") used in the following registry
return 0;
}
Tags:
performance testing model,
Ruby,
team management,
Watir,
WebLogic,
Windows
2013/03/24
Control of the entire page cache and update dynamic pages as static pages
Static pages we all know, WEB server sends back the contents of the file comes with a Last-Modified header information, and static files last modification time stored inside, so that when the next time the browser requests the file will get Last -Modified header information exists with the If-Modified-Since sent to the server, telling the server's local cache last modification time, will first determine the end of the file when the server receives the time information of the If-Modified-Since request modify the time is later than this time, the late update, will retransmission of the contents of the file, along with the latest Last-Modified header information to the client, if the time is equal to or more than this time early, it shows no update cache fully synchronized, it will send back a 304 Not Modified status code, and to stop retransmission file content, and can save unnecessary data transmission.
Above is a static page cache and update the control mechanism, generally all this is by the WEB server directly arranged deal, all without user intervention. Dynamic pages are not so lucky, because of the dynamic page requests are forwarded by the WEB server to a specific page handler to complete their cache and update the strategic issues, and not arranged, so these controls must programmers to complete. Unfortunately, however, the dynamic page handler is unable to automatically handle cache is a whole page-level cache, we can cache a variable in the code so that at the next call, but still a lot of code to be executed, they can as static pages to the client a Last-Modified header information, determine the time and data updated when the next request, in order to decide whether to repeat the process and send data?
From the above analysis it is entirely feasible, but it needs to do special processing script, which is a logic to regulate this update detection, of course, this is not the focus on this. Because the the client to accept last modified time to completely rely on the Last-Modified header information, so dynamic scripting can be sent back to the content is also output a time as a basis to judge, then the next time the client requests the same page (accurately, should with a URL address), Last-Modified header information received will be appended to the If-Modified-Since request over. To a dynamic page here, we can get included with the request last modify time, then the first judgment point in time whether there is a new deal with the data, there is no new data, then, we are on the direct end of the current script, you can save server resources. Of course, before the end of the script, you need to play a 304 status code, because let clients sure to use the cache, must also be dependent on the status code, so just use dynamic script sends back a 304 Not Modified header information can not only saving server script execution resources, but also save the flow can be described as killing two birds with one stone, and the application form is more flexible and more controllable.
订阅:
博文 (Atom)