51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 7736|回复: 1
打印 上一主题 下一主题

【推荐原文】LoadRunner 9.0: RDP Protocol Basics

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2008-9-5 14:57:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Loadtester Incorporated
09/17/2007

原文作者:Tim Chase
原文出处:http://www.loadtester.com/
推荐理由:知名软件全面解析
原文内容:

LoadRunner 9.0: RDP Protocol Basics


by Tim Chase
Loadtester Incorporated
09/17/2007


--------------------------------------------------------------------------------

When HP released LoadRunner version 9, several new protocols were introduced.  One of these protocols was Microsoft Remote Desktop Protocol (RDP).  It allows the scripting of Terminal Server sessions.  From a scripting standpoint, it looks similar to earlier versions of the Citric ICA LoadRunner protocol.  Many of the same best practices used when recording Citrix can be used when recoding RDP sessions.  Before we go into the specifics of how LoadRunner implements the RDP protocol, let’s talk a little about what RDP actually is.  

What is RDP?

Terminal Server is an add-on to Microsoft Windows Server.  It allows you to run sessions on the server from a local computer.  When you log into a terminal server from a local computer, it does all of the processing on the server and presents the client with a GUI that shows what is happing on the server.  RDP is the protocol that is used to connect the local client to the Terminal Server.  

Before recording a script, it is important to understand how RDP works.  When a user logs on to a Terminal Server machine, the user is basically seeing a picture of what is happening on the server.  As the user types and clicks, the picture displayed to the user is refreshed.  Because of this, LoadRunner has no idea what is shown on the screen to the user.  All it can see is a picture.  This is important to keep in mind when replaying the script because synchronization points will have to be setup to make sure that the script replays correctly.

Planning

Since RDP is a GUI based script, it is important to plan your businesses processes out well before starting to script.  Before sitting down to script, go through the business processes outside of LoadRunner a few times to avoid mistakes during recording.  After recording, it is possible to go back and edit the script if you make a mistake.  But since an RDP script will contains lots of mouse clicks, windows syncs, and key typing, it will not be overly easy to read.  Planning beforehand can help cut down on the amount of editing that has to be done which will ultimately save on time and help the cleanliness of the script

Recording Levels

When recording RDP scripts, one of the recording options to pay attention to is the recording level.  This setting determines how low-level to record the script.  The default option is ‘High’.  This means that when recording, any typing captured is shown in the script as rdp_type and double mouse clicks are recorded as rdp_mouse_double_click.  Also any modifier keys (control, alt, shift) are recorded into the steps when they occur.  The next recording level down is ‘Low’.  The main difference with this level is that typing is recorded as rdp_key (one key at a time.)  The last recording level is ‘Raw’. This generates the script using key_up, key_down, mouse_up, and mouse_down functions.  Also no modifier keys are available.  When recording, always start recording at the highest level.  This will help make the script more readable and maintainable.  If there are problems encountered when recording the script, then move down a recording level.

Image Synchronization

After the recording, getting RDP scripts to play back successfully can be tricky.  The key is to get synchronization to work properly.  Synchronization in RDP involves basically drawing a box around an area on the screen where you want your script to wait before continuing.  There are a few things to remember when creating synchronization points for the RDP protocol.  


Sync points can be created during recording and after.  During recording, they can be created by using the button on the recording toolbar. After recording, they can be created from snapshots in the treeview.
Keep the sync areas small.  Focus only on the specific area that needs to appear before the script can continue.  The smaller the area, the fewer sync problems that will exist.
If a sync fails during playback, a dialog box will appear.  The box will allow you to see the recorded snapshot and the snapshot found during replay.  If the new snapshot is fine, you can append its value to the script.  If not, you can stop the script and debug.
RDP syncing contains a feature called tolerance.  It allows a little leeway in synchronization.  The tolerance can be set at Low, Medium, High, and Exact.  The stricter the tolerance, the more exact the recording snapshot and the playback snapshot have to look like each other.  If the syncs are failing a lot on playback for reasons that aren’t intuitive, try lowering the tolerance.

Shifting Coordinates

One of the most interesting features of the RDP protocol is shifting coordinates.  Sometimes the position of objects moves in an application.  In other protocols, this would require either a lot of script edits or a rewriting of the script.  The RDP protocol tries to automatically fix the problem.  It notices that the coordinates of an object have changed, so it modifies the function associated with the object and any others that depend on that object.  As an example, let’s say a script was recorded against an application that had a pop-up window where the user had to enter a name and then click enter.  If that pop-up window appeared in a different place on playback, not only would it adjust any functions dealing with that window, it would also adjust the functions for typing the name and clicking the enter button.

The Not So Good

There are a couple of problems with the RDP protocol.  The first is that it does not support connecting to Windows XP.  If you try to record a script against XP, LoadRunner won’t error, but it will give you just a blank script.  In order to record correctly, LoadRunner needs to record against a machine that is running Windows Terminal Server.

The second problem is that RDP does not support object recognition.  LoadRunner cannot see any information about the objects being displayed.  This means that the script is going to be totally dependent on bitmap synchronization.  Another downside to this is that the amount of error checking you can do is very limited.  Object recognition is great for error checking because you can grab text from the screen to make sure that the application is displaying what is expected.

Conclusion

The RDP and Citrix protocols are very similar.  Anyone familiar with Citrix should be able to learn this protocol quickly.  It also has some nice features like shifting coordinates and tolerance that other protocols don’t have.  This protocol is new with LoadRunner 9.0, so it is still very immature.  As more people start to use it, I would expect updates to appear in future feature packs.  Hopefully before long they can incorporate a type of object recognition which would really improve the usability of this protocol.     


Tim Chase is a Sr. Systems Engineer  for Loadtester Incorporated. He is a Certified LoadRunner Product Consultant and Instructor. You can reach him via e-mail at tchase 'at' Loadtester.com
单选投票, 共有 1 人参与投票
100.00% (1)
0.00% (0)
您所在的用户组没有投票权限
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2010-5-28 09:56:07 | 只看该作者

LoadRunner 9.0:RDP协议基础

在惠普发布LoadRunner 9.0 版本中,介绍了几个新的协议。微软远程桌面协议(RDP)是这些协议其中之一。它可以在终端服务器会话脚本。脚本从一个角度来看,它看起来像早期版本的Citric ICA LoadRunner的协议。使用 Citrix 录制许多相同的最佳实践时需要重新编码 RDP 会话。在我们进入如何实现LoadRunner的RDP协议的具体细节前,让我们谈一下究竟什么是RDP?
回复

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-11-23 18:00 , Processed in 0.080616 second(s), 29 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表