9/12 Running SAPGUI Vuser Scripts
这一章讲SAPGUI脚本在run的过程中的一些注意事项
When working with SAPGUI Vuser Scripts, you may encounter optional windows in the SAPGUI client—windows that were present during recording, but do not exist during replay.
这个是说在脚本回放的时候有些选项的窗口不显示了,所以我们也抓不到了
下面这个方法可以解决这个问题:
VuGen's optional window mechanism performs the actions on a window only after verifying that it exists. The Vuser checks if the window indicated in the Select active window step exists. If the window is found during replay, it performs the actions as they were recorded in the script. If it does not exist, the Vuser ignores all window actions until the next Select active window step. Note that only SAPGUI steps (beginning with a sapgui prefix) are ignored.
To use this feature, in Tree view select the appropriate Select Active Window step and choose Run steps for window only if it exists from the right-click menu.
To disable this feature and attempt to run these steps at all times, regardless of whether the Vuser finds the window or not, choose Always run steps for this window from the right-click menu.
上面说的我也没做过试验,明天看看再说
SAPGUI Advanced Run-Time Settings
Each Vuser invokes a separate SAPfewgsvr.exe process during test execution. In some instances, the process stays active even after the replay session has ended. You can check the Windows Task Manager to see if the process is still active.
这个是说每一个用户都有一个自己的sap进程,然后这个进程还不能自动关闭当这么用户退出时,下面我们可以设置这个
The Advanced SAPGUI settings let you set a timeout for this application.
When the timeout is reached, VuGen closes any SAPfewgsvr processes not previously terminated.
➤ Replay using running SAPlogon application. Instructs the Vusers to use the SAPlogon application that is currently running for replay.
➤ Set SAPfewgsvr application timeout. Allows you to modify the SAPfewgsvr.exe process timeout.
➤ Timeout to SAPfewgsvr. The SAPfewgsvr.exe process timeout in seconds. The default is 300 seconds.
上面的这个是说如何设置sap线程的timeout, 当然也可以使用原来的,第一个选项就是这样,后两个是说设置时间的.
Tips for Replaying in a Scenario or Session Step
The following sections provide configuration tips for running the script on a Controller or Console or Load Generator machine.
Controller and Console Settings
When working with a LoadRunner scenario or session step, set the following values when running your script in a load test configuration:
➤ Ramp-up. One by one (to insure proper logon) in the Scheduler.
➤ Think time. Random think time in the Run-Time settings.
➤ Users per load generator. 50 Vusers for machine with 512 MB of memory in the Load Generators dialog box.
Load Generator Setting
这里是说如何设置generator来使其更好运行,首先关闭generator,然后再运行launch_service\bin\magentproc.exe, 这样我们就启动了新的generator程序,然后再在任务栏里面检查一下
When running your script in a scenario or session step, check the agent mode and configure the terminal sessions on the Load Generator machines.
➤ Agent Mode. Make sure that the LoadRunner (or Performance Center) Remote Agent is running in Process mode. Service mode is not supported.
To check this, move your mouse over the agent’s icon in the Windows task bar area, and read the description. If the description reads LoadRunner Agent Service, it is running as a service.
To restart the agent as a process:
1 Stop the agent. Right-click the LoadRunner Agent icon and select Close.
2 Run magentproc.exe, located in the launch_service\bin directory, under the LoadRunner or Tuning Module installation.
3 To ensure that the correct Agent is launched the next time you start your machine, change the Start type of the Agent Service from Automatic to Manual. Then add a shortcut to magentproc.exe to the Windows Startup folder.
由于sap需要占用较多的图形资源,如果我们希望一台512M机器能够跑>50个用户,可以采用terminal server sessions, 具体就是在Start > Programs > Mercury Loadrunner > Advanced Settings里面选择Enable Terminal Service option,然后重新启动generator session, 本机安装ts server,xp自带,然后用ts client连接,再这个新的user session里面再次启动generator,注意,这时,其实你的机器上面已经启动了两个generator session.
好了,完成这步我们还需要设置sencraio, 这个主要就是增加agent机器的设置,里面有一个terminal service的选项,仔细看看不难理解,然后就是新的server的名称,对,就是对应你的那个ts client连接的那个session, 在terminal service managerment里有由一个session的显示,看看你从ts client连接上去的id是多少,把该id+1然后写在那台机器名字的后面就可以了,中间加冒号
例如id=0 机器名RobinGe, 那一个server就是RobinGe,在这里面设置ts 选项,另一个server的名字就是RobinGe:1
如果还不能正常连接的话可以试试RobinGe:0什么的 呵呵,这个我也不好说了
Terminal Sessions. Machines running SAPGUI Vusers may be limited in the number of Vusers that can run, due to the graphic resources available to that machine. To increase the number of Vusers per machine, open additional terminal server sessions on the Load Generator machines. Choose Agent Configuration from Start > Programs > Mercury <product_name> > Advanced Settings, and select the Enable Terminal Service option. You specify the number of terminal sessions in the Load generator machine properties. For more information, refer to Configuring Terminal Services in the Mercury LoadRunner Controller User’s Guide.