`
lingxiayidu-WJX
  • 浏览: 2889 次
最近访客 更多访客>>
社区版块
存档分类
最新评论

LR 的关联

    博客分类:
  • LR
 
阅读更多

1. Correlation Overview

     Correlation is used when a recorded script includes a dynamic value(such as a session ID) and cannot replay. To resolve this, you make the dynamic value into a variable thereby enabling your script to replay successfully.

     For example, many applications and web sites identy a session by the current date and time. If your try to replay a script, it will fail because the current time is different than the recorded time. Correlating the data enables you to save the dynamic data and use it throughout the scenario run.

     When a correlation is created, VuGen adds a function that extracts the dynamic value to a parameter. Appropriate occurrences of the original value are replaced with a parameter.

 

2. Correlation Vs. Parameterization

    Parameterization is used when you want to take a value and turn it inton a variable in order to make your script more realistic. For example, if your are filling out a form on a website, your may want to vary the value entered for a particular filed.

    Correlation is used when a recording script included a dynamic value and cannot replay. To resolve this,

your make the dynamic value into a variable thereby enabling your script to replay successfully.

 

3. Determining which values to correlate

    Once you generate a list of differences, you need to determine which ones to correlate. If you mistakenly correlate a difference that did not require correlation, your replay may be adversely affected.

The following strings most probably require correlation:

- Login string. A login string with dynamic data such as a session ID or a timestamp.

- Date/Time Stamp. Any string using a date or time stamp, or other user credentials.

- Common Prefix. A common prefix, such as SessionID or CurrentID, followed by a string of characters.

 

4. How to correlate Scripts - Web(HTTP/HTML)

    This task describes the different ways to correlate web(HTTP/HTML) protocol scripts.

 - Scan for correlations

    a. Select Vuser > Scan for correlations. This scans the entire script for mismatches between recording and replay snapshot data in web steps. The search occurs in all server reponses.

    b. If mismatches are found they will be dispayed in the Correlation Results tab of output window.

    c. When a mismatch is correlated, VuGen adds a Web_reg_save_param_* function and saves the original value in a comment in the script. Appropriate occurrences of the original value in web steps are replaced with a parameter.

- Manual Correlation

  If the scan for correlation did not resolve all correlation-based errors in your script, you can attempt to manually correlate your script as follows:

  a. Search for values that need correlation manually. There are a number of ways to manually search for values that need correlation. For details. see How to Search for values that Need Correlation.

  b. Correlate the value

  Select one of the following methods:

  Correlate from snapshots.  Highlight the value to correlate, right-click, and select Create Correlation.

  Manually add correlation functions. Manually insert the relevant correlation functions into your script. For details, see how to Mannually Correlate Web Scripts.

 

How to Search for values that Need Correlation

The following steps describe different ways to search for values that need correlation.

1. Search by Compring Scripts

2. Replay log search

a. Scan the script in script view for strings that may need correlation such as hash string, random strings, session ID's,etc.

b. Search the generation log for the first time that the string appears(this is the response from the server)

c. Search the extended replay log for the same response. Check to seen if this response contains a different string within the same boundaries as the original suspected string. If yes, this string requires correlation.

 

How to Manually Correlate Web Scripts

1. Locate the string and its details

    Identify the statement that contains dynamic data and the patterns that characterize the locations of the data. These patterns may be boundaries or xpaths.

    a. Identify Patterns using Boundaries

        Use these guidelines to determin and set the boundaries of the dynamic data:

        - Analyze the location of the dynamic data within the HTTP response

        - Identify the string that is immediately to the left of the dynamic data. This string defines the left boundary of dynamic data.

       - Identify the string that is immediately to the right of the dynamic data. This string defines the right boundary of the dynamic data.

       - The right and left boundaries should be as unique as possible to better locate the strings.

    b. Identify Patterns using Xpaths

        Use the snapshot pane to manually search for the xpath of the desired string.

     

2. Add web_reg_save_param_* function

    Add a Web_reg_save_param_ex or web_reg_save_param_xpath function into the script befor the statement that contains the dynamic data.

3. Replace data with parameter

 

 

 

分享到:
评论

相关推荐

    LR 关联高级篇

    通过上述讨论,我们可以看出LR关联是性能测试中的核心技能之一,理解并熟练掌握关联技术对于创建精确、可重复的测试脚本至关重要。通过博客链接提供的资源(https://solem.iteye.com/blog/1591662),你可以深入学习...

    LR 关联(correlation)-参数化用法

    LR关联(correlation)是LoadRunner测试工具中一个关键的概念,它涉及到脚本的参数化,以确保在多用户并发测试中模拟真实用户行为的准确性。在LoadRunner脚本录制过程中,VuGen捕获客户端(浏览器)和服务器之间的...

    LR关联及实例应用.doc

    LR关联,全称为LoadRunner的关联,是性能测试工具LoadRunner中的一个重要概念,它涉及到的是在负载测试过程中如何处理动态数据的问题。LoadRunner是一款由Micro Focus公司开发的强大性能测试工具,广泛应用于企业级...

    LR系统讲座之关联函数(视频)

    LR系统讲座之关联函数是关于LoadRunner工具的一个深入学习主题,LoadRunner是一款强大的负载和性能测试工具,由HP(现已被Micro Focus收购)开发。在性能测试领域,关联函数是LoadRunner中的一个重要概念,用于模拟...

    LR自动关联和手动关联

    "LR自动关联和手动关联"是指在LoadRunner中处理动态数据的两种方式。自动关联是LoadRunner的一项功能,它尝试识别并处理脚本中的动态数据,而手动关联则需要测试人员介入,查找并替换脚本中的特定数据。 当浏览器...

    LR 教程_关联(Correlation).pdf

    ### LR 教程_关联(Correlation)详解 #### 一、引言 在软件测试领域,特别是性能测试中,关联技术(Correlation)是非常重要的一个环节。它主要用于解决脚本回放过程中出现的一些问题,比如由于服务器动态生成的...

    LR 教程_关联(Correlation)

    关联(Correlation)在LoadRunner测试中的重要性 在LoadRunner进行性能测试时,关联(Correlation)是一项关键的技术,用于解决动态数据的问题。当录制脚本时,LoadRunner的VuGen工具会捕获客户端(浏览器)和...

    新建 LR手动关联Microsoft Office Word 文档.docx

    【LR手动关联Microsoft Office Word 文档.docx】的测试用例主要涉及LoadRunner(LR)自动化测试工具中的一项关键技能——动态数据关联。关联在性能测试中至关重要,因为它是处理服务器响应中动态变化数据的关键方法...

    LR手动关联Microsoft Office Word 文档.docx

    根据给定文件的信息,本文将深入探讨LR(LoadRunner)中的手动关联技术及其在Microsoft Office Word文档中的应用。本文旨在帮助读者理解关联的基本概念、重要性以及如何在LoadRunner环境中手动执行关联操作。 ### ...

    lr自动关联

    【LR自动关联】是LoadRunner性能测试中的一个重要概念,它涉及到如何在脚本录制与回放过程中正确处理动态数据,确保测试的准确性。LoadRunner是一款功能强大的企业级性能测试工具,能够模拟大量用户并发执行业务操作...

    LR手动关联参数化问题总结

    ### LR手动关联参数化问题总结 #### 一、手动关联的重要性及应用场景 在LoadRunner(以下简称LR)测试过程中,手动关联是一项重要的技能,用于解决测试脚本中因使用静态Session ID而导致的问题。当服务器为每次...

    LR培训心得——LR详细整个过程的详细介绍

    ### LR培训心得——LR详细整个过程的详细介绍 #### 一、准备培训环境 ...通过上述步骤,不仅可以成功录制和优化脚本,还能深入了解LR的各项功能,特别是关联和参数化技术的应用,这对于高效地进行性能测试至关重要。

    lr界面分析2

    LR,全称LoadRunner,是HP公司推出的一款强大的性能测试工具,主要用于模拟大量用户并发访问应用系统,以此来测试系统的性能、稳定性和容量。在"lr界面分析2"这个主题中,我们将深入探讨LR工具的用户界面以及如何...

    lr界面分析3

    LR(LoadRunner)是一款强大的负载测试工具,由Micro Focus公司开发,主要用于软件性能测试和功能测试。在"LR界面分析3"中,我们将深入探讨LR的用户界面、工作流程以及关键功能,帮助你更好地理解和使用这个强大的...

    LR测试工具操作

    在复杂的Web应用测试中,LR的关联功能显得尤为重要。关联可以帮助脚本自动捕获和使用动态生成的值,比如在页面跳转过程中产生的session ID。正确设置关联能有效避免因动态数据变化导致的测试失败,确保测试结果的...

    LR函数经验分享

    4. `lrd_stmt`:将SQL语句与光标关联。 5. `lrd_bind_col`:将主机变量绑定到列。 6. `lrd_exec`:执行SQL语句。 7. `lrd_fetch`:提取结果集中的一条记录。 8. `lrd_commit`:提交数据库事务。 9. `lrd_close_...

    4 实验四:LR分析程序的设计与实现

    2. 使用闭包运算,找出与每个状态关联的所有项。 3. 对于每个状态和输入符号,决定是否需要移进或者是否有归约操作。 4. 如果存在归约操作,更新ACTION表;如果需要移进,更新GOTO表。 5. 重复上述过程,直到没有新...

    LR登录添加参数化

    - **关联**:如果登录过程中有验证码或者session ID等需要维持的会话信息,需要进行关联操作,确保每次登录都对应正确的会话。 ### 2. LR添加人员参数化 添加人员的过程也类似,可能涉及更复杂的表单填写。关键...

Global site tag (gtag.js) - Google Analytics