发布新日志

  • LoadRunner案例分析之五

    2007-05-14 15:11:41

    最近被一个代理的问题搞的纠缠不清。我这个人其实很多时候是不求甚解的那种。自打上次跟Zee版主交流了以后,很受打击,惭愧的要命。打算以后改改这个毛病。凡是要探个究竟,正所谓惩前毖后,治病救人嘛。:)

    问题是这样的,VUGen里面录制的脚本,回放的时候出错,错误信息是:

    [Net An. Warning ( 218: 9f0)] Request Connection: Remote Server @ 66.102.7.147:80 (Service=) Failed attempt #3. Unable to connect to remote server: rc = -1 , le = 0)
    [Net An. Error ( 218: 9f0)] Request Connection: Remote Server @ 66.102.7.147:80 (Service=) NOT PROXIED! (REASON: Unable to connect to remote server: rc = -1 , le = 0)

    重新安装了LoadRunner,结果同样。从错误的表面看是代理的问题,但是本机上网不需要任何代理。也没有设置任何的代理。搜了一下,发现了问题的解决方法。其实挺搞笑的。居然是杀毒软件的问题。

    下面是详细的讨论经过(英文的,大家将就看,看不懂就查查辞典)

    ==================================================
    I’ve installed LR on a new machine and I’m encountering an error at record time. This is the error as recorded against loading the Google home page, along with the three warnings that proceed it:

    [Net An. Warning ( 218: 9f0)] Request Connection: Remote Server @ 66.102.7.147:80 (Service=) Failed attempt #1. Unable to connect to remote server: rc = -1 , le = 0)
    [Net An. Warning ( 218: 9f0)] Request Connection: Remote Server @ 66.102.7.147:80 (Service=) Failed attempt #2. Unable to connect to remote server: rc = -1 , le = 0)
    [Net An. Warning ( 218: 9f0)] Request Connection: Remote Server @ 66.102.7.147:80 (Service=) Failed attempt #3. Unable to connect to remote server: rc = -1 , le = 0)
    [Net An. Error ( 218: 9f0)] Request Connection: Remote Server @ 66.102.7.147:80 (Service=) NOT PROXIED! (REASON: Unable to connect to remote server: rc = -1 , le = 0)

    I’ve reinstalled LR twice with the same results.

    One other thing I’ve noticed is that under Run-time Settings, the browser emulation was set to IE 4 and no O/S. I installed LR on a second machine and the setting is IE 6/NT 5.1. The recorder also worked as expected. However this is an older box and I’d rather not use it.

    The Mercury forums point to possible spyware, but the new machine is clean. If anyone has any information it would be most appreciated.

    1. What version of LoadRunner or PerformanceCenter are you using? 8.1.0.0
    2. What is the protocol you are recording? HTTP/HTML
    2.1 If HTML - are you using HTML-Advanced with URLs or, NO
    2.2 URL mode with Concurrent groups, or NO
    2.3 URL mode without Concurrent groups? NO
    3. Which LoadRunner/PerformanceCenter feature or service packs are you using? None
    4. What kind of LoadRunner license do you have - Subscrīption, Perpetual, Virtual User days, or Evaluation? (choose the one that fits your license model) Evaluation
    4.1 If subscrīption, is subscrīption current or expired?
    5. What platform(s) and Operating Systems? Include version and service packs. IE 6.0 SP2 and XP SP 2
    6. If you have filed a service request with Mercury, what have they told you at this point with respect to your issue?
    I’ll be filing an SR today.

    Thanks,

    Dan
    ==================================================
    Dan, since you are using the evaluation version, please turn your questions to your field sales engineer for HP|Mercury or your VAR for assistance prior to your sale. It is their job to make sure all engineering issues are addressed prior to your purchase of LoadRunner, just as it is the sales representative’s job to make sure all organizational and logistical issues are addressed prior to your purchase. If your VAR or vendor sales engineer is unresponsive to your inquiries, then seek a new representative to work with. However, it has been my experience that a slight threat to go with another vendor that can better support your environment tends to light the fire under most sales types, particularly with a product like LoadRunner that easily can exceed $100,000.00 USD when optioned out.

    Thank you for your interest in evaluating LoadRunner prior to your purchase.

    James Pulley
    ====================================================
    Thanks for the suggestion.

    The controller license is purchased and this is the machine designated for activation. I’m dealing with Mercury on this issue as well.

    This is not the first time I’ve had installation issues with a Mercury product and I’m sure it won’t be the last. As I mentioned this is a new laptop so maybe that has something to do with it. But I’ve seen one other post in this forum describing my same problem and there was no resolution so I’m not optimistic that this will be resolved quickly.

    If Mercury/HP provides a solution I’ll post it here.
    ======================================================
    A Mercury engineer provided a workaround for this recording error. Under Tools -> Recording Options -> Network -> Port Mapping, the capture level was changed from ‘Socket Level Data’ to ‘WinINet level data’.

    When I get the fix for ‘Socket Level Data’ recording error on this PC, I’ll post it here.

    Dan
    =========================================================
    Thanks, Dan. You may not know it, but it all too rare for people to come back and post solutions, so we are truly grateful.
    ================================================
    Thanks for that Peter. I find it worthwhile to post resolutions as I hope they can help others.

    So I solved my problem. Digging into the process explorer pointed to the biolsp.dll from Wave Systems. I Googled it and found several discussion forums indicating it causes problems with other applications as well. The patch download link on the Wave website was dead. I don’t need bio security on my Dell so I uninstalled the whole program group. VUGEN is now working as expected.

    Good luck to all,

    Dan
    ====================
    so let me get this straight…you have to disable the bio security on the computer to get it to work? Seems like an interesting problem if you are required to have the security on as a company policy.
    ================
    That’s a great point jamesso and I agree; this wasn’t the solution I was looking for. Unfortunately there is more going on here. We aquired a term license with Mercury/HP and it activated the virtual users two weeks ago, even though the installation on the controller did not go as planned. But I’m at the point now where we’ve already burnt too much and can’t afford to burn any more of the license. I have to get back on track with the client so I’m going with this for now.

    Regards,

    Dan

    ======================
    So the term license started before you could actually get a controller working to use them….hmmm. Is HP flexible enough to own this problem and give you time that you lost?
    =======================
    Time will tell jamesso. I do want that time back and I am looking for consideration, but at this point I’m not optimistic.

    I don’t mind saying at this point that I was unhappy with being tied to a start date to begin with. This is the first time I’ve worked with a term license from HP and I would be very happy if it is my last. In my previous term engagements I used Segue/Borland. With their model I activated the license the day I was ready which got the project more value, more flexibility, and less waste.

    ===========================
    Hi Dan,

    i had same problem with new LR 8.1 installation with trial 10 days licenses…and my friend with 8 years LR experience say me possible solution(99%):

    you need to disable(sometimes uninstall) any antivirus software during installation process (LR need to notify USER before starting installation process, but i not find it),
    after restart the PC you can to enable AV again.

    Try and Enjoy
    =======================



    原帖:http://www.rickyzhu.com/2007/04/24/case-five-of-loadrunner/trackback/

  • LoadRunner案例分析之四

    2007-05-14 15:10:52

    最近在论坛上看到几次这样的问题,今天突然想起来,觉得比较典型,有必要分析一下。

    这个问题的具体描述大概是这样的:在web应用下,模拟十个用户并发进行数据的添加,结果每次执行全部成功,但是数据却不是十条,每次数据不一样,但是都比十小。

    乍一看,可能是数据参数化的问题,其实仔细想想,道理其实很简单。是数据库的问题。
    大多数的数据库都有记录锁的问题,第一次的数据操作没有commit之前,第二次对同样表进行的操作可能就没 有办法成功。所以每次数据的条数都达不到十条。但是为什么每次都不一样呢?这个问题也容易解释,因为每次的操作服务器的响应时间是不同的,所以不同虚拟用 户的提交时间也不是不同的,这样一来,就导致每次提交成功的数据量不一致。导致每次结果的条数可能是不同的。

    其实这个问题,跟LoadRunner的使用并没多大关系,而主要是对数据库的了解和应用执行机制的了解。如何解决这个问题,我现在还没有好的思路,是否对应用程序写数据库的过程作一些改进?大家可以一起探讨。



    原帖:http://www.rickyzhu.com/2007/04/22/case-four-of-loadrunner/trackback/

  • LoadRunner案例分析之三

    2007-05-14 15:10:13

    把昨天的功课补了,本来打算昨天分析一个典型案例,可惜太忙了。所以这么说。

    以前一直没有解决的问题,利用LoadRunner测试一个应用的时候,需要验证域用户,所以即使录制成功,每次回放的时候都提示错误,用户名和密 码不对,对此耿耿于怀了很久。今天居然解决了。解决方法就是一个简单的函数调用: web_set_user,此函数的解释和用法如下:

    The web_set_user function is a Service function that specifies a login string and password for a Web server or proxy server. It can be called more than once if several proxy servers require authentication. web_set_user overrides the run-time proxy authentication settings for user name and password.

    When you log onto a server that requires user and password validation, VuGen records a web_set_user statement containing the login details. However, there are some more stringent, authentication methods for which VuGen is unable to insert web_set_user statements. See User Authentication for more detail. In such cases, you can add web_set_user into your scrīpt manually.

    When you run the scrīpt, LoadRunner automatically submits the user authorization along with every subsequent request to that server. At the end of the scrīpt, LoadRunner resets the authorization.

    This function is supported for all Web Vusers, and for WAP Vusers running in HTTP mode only. It is not supported for WAP Vusers running in Wireless Session Protocol (WSP) replay mode.

    Example 3
    The following example was inserted manually by the user into the scrīpt as the Web server “mansfield” uses NTLM authentication. VuGen cannot record NTLM or Digest authentication. Note that for NTLM authentication the domain name “mansfield” followed by a double backslash must be prepended to the user name:

    web_set_user(”mansfield\\freddy”, “XYZ”, “mansfield:80″);

    原来一直没有想到域的设置,结果一直不行,现在可以了。
    另外一个问题跟之前这个有关系,那就是验证码的问题,之前曾经看过段念(关河大侠)的关于验证码的是三个解决方案,这里是第四种解决方案。对于一些比较简单有规律的验证码可以搞定。对于复杂的比如有干扰的,或者没有规律的则参考关大侠的其他解决方案。

    这个应用经过源代码分析,发现每次客户端请求过来的验证码都可以取到,格式如下固定,是四个数字的组合。经过多次尝试发现如下规律:
    验证码如下: 52|52|52|51|46|47|49|55|
    对应界面的验证码是: 6039
    规律是第2,5,8,9位的值减去46对应的即是验证码。
    有了这个规律,就可以通过关联提前取得服务器的验证码,然后通过简单的计算,得到结果。详细代码如下:

    1. #include "web_api.h"

    Action()
    {

    // char* str = “52|52|52|51|46|47|49|55|”;
    char result[64];
    int num1;
    int num2;
    int num3;
    int num4;

    int temp1;
    int temp2;
    int temp3;
    int temp4;

    web_set_user(”XXXXDomain\\szXXXX”,
    lr_decrypt(”46246a2633f042c67758b9ddc2b863038aa063c03d7e”),
    “XXXX.XXXX.com.cn:8080″);

    web_reg_save_param(”check”, “LB=Image=”, “RB=\\”, LAST);

    web_url(”Register”,
    “URL=http://XXXX.XXXX.com.cn:8080/xx/main/Register”,
    “Resource=0″,
    “RecContentType=text/html”,
    “Referer=”,
    “Snapshot=t1.inf”,
    “Mode=HTML”,
    LAST);

    lr_think_time( 6 );

    sscanf(lr_eval_string(”{check}”), “%d|%d|%d|%d|%d|%d|%d|%d”, &temp1, &num1, &temp2, &temp3, &num2, &temp4, &num3, &num4);

    num1 -= 46;
    num2 -= 46;
    num3 -= 46;
    num4 -= 46;

    sprintf(result, “%d%d%d%d”, num1, num2, num3, num4);

    lr_log_message(”getvalue : %s”, result);

    web_submit_form(”Register;jsessionid=6726009A7D21963602B166D91C883413″,
    “Snapshot=t2.inf”,
    ITEMDATA,
    “Name=Register.reason”, “Value= “, ENDITEM,
    “Name=set_attach”, “Value=result”, ENDITEM,
    LAST);

    return 0;
    }



    原帖:http://www.rickyzhu.com/2007/04/17/case-three-of-loadrunner/trackback/


  • LoadRunner案例分析之二

    2007-05-14 15:08:55

    昨天在广州交流会开始之前,一个朋友问起这样一个问题:他们公司的系统上线以后,用户分布在各个不同的地区,而且接入系统的方式和带宽也不同,这种情况下进行性能测试,如何保证更加真实的模拟用户行为?用LoadRunner可以做到吗?

    回答当然是肯定的,其实这些都是简单问题的组合,这样的问题考察的也是你对工具的熟悉和掌握程度。在VUGen里面,是可以通过RTS (runTimeSetting)来模拟一个单个用户更加真实的行为,比如思考时间,网络带宽,是否清除cache等等。同样的设置也可以在场景中进行设 置。而且LoadRunner提供设置不同用户组不同RunTimeSetting的功能。以达到模拟不同用户行为的更加真实组合。
    假设有三种不同带宽的用户,而且上传和下载的带宽也有所不同,那么可以录制两个脚本,分别模拟上传和下载的用户行为,再Controller里面,建立六 个不同的脚本组,脚本组的用户数可以按照绝对或者百比分的方法分布。比如100,50,200用户或者20%,40%,40%等,这取决于你的业务模型。 然后设置不同的带宽和分布情况。这样不同用户组的虚拟用户模拟出来的就是不同带宽的用户实际接入情况。就可以满足之前的问题的要求。参考下图:




    原帖:http://www.rickyzhu.com/2007/04/01/case-two-of-loadrunner/

  • LoadRunner案例分析之一

    2007-05-14 15:07:52

    昨天和Zee兄交流的时候,探讨了最近无忧测试论坛上的两个问题,我们俩的看法基本一致.

    第一个问题:是如何利用LoadRunner判断HTTP服务器的返回状态. 两种方法,第一种方法是利用LR的内置函数web_get_int_property, 如下是一个简单的例子:

    Action.c
    {
    int HttpRetCode;
    web_url(”my_home”, “URL=http://my_home”, “TargetFrame=_TOP”, LAST);
    HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
    if (HttpRetCode == 200)
    lr_log_message(”The scrīpt successfully accessed the My_home home page”);
    else
    lr_log_message(”The scrīpt failed to access the My_home home page “);
    }

    另外一种就是最原始的办法,也是Zee兄这种高手才最先想到的,自己取HTTP服务器的数据,然后利用关联函数分析啊. (果然是高啊). 其实所有的东西都可以从服务器的返回取,然后自己动手解析,呵呵. 举个不太恰当的例子: 你需要一套家具,可以去家具市场挑,当然也可以自己买木材原料和工具,动手加工. 那才是最合乎自己需要的. 这样一比喻, Zee兄弟似乎成了木匠了,嘻嘻~~

    第二个问题:动态数据参数化的问题.

    其实第一次看到这个问题,我没有马上反应过来,后来仔细想想, 明白了. 就是需要参数化的数据不是静态的,是动态的. 比如从数据库中选出来的.

    针对这个问题,我跟Zee兄弟的看法一致,应该提前从数据源(比如数据库)把数据选取出来,然后在执行的时候直接进行参数化的选取. 反之,如果在程序执行期间,进行数据的选取,将可能带来数据库服务器的强大压力,因为参加并发执行的每个虚拟用户都去数据库搜刮一下,对数据库将是多么严 峻的考验啊.

    朋友或者同事之间的探讨是加深对问题理解和增加知识面,扩展视野最直接的途径和方法,加强沟通,keep in touch.

    原帖:

    http://www.rickyzhu.com/2007/03/23/case-one-of-loadrunner/

数据统计

  • 访问量: 28169
  • 日志数: 29
  • 图片数: 2
  • 书签数: 1
  • 建立时间: 2006-12-28
  • 更新时间: 2007-05-14

RSS订阅

Open Toolbar