LoadRunner8.1学习笔记3
1. 运行脚本录制,出现IE错误,显示内存不能为写;
答案:
Application: Mercury LoadRunner 8.1 x86
Environment: Windows+IE
Scenario:用LR调起IE
Tool: Process Explorer
Truth: LoadRunner 调用起IE的过程是, vugen.exe(虚拟用户生成器)传递先前设置好的iexplore.exe路径(Program to record中设置)、要测试的URL网址(URL Address中设置),把字符串参数传递给CMD命令,运行命令:
"F:\Program Files\Internet Explorer\iexplore.exe" http://www.microsoft.com/
打开URL网页,录制过程。
Conclusion: LoadRunner启用系统的服务、进程,应该都用的是命令行,似乎所有第三方自动化测试软件都采用的这个策略,比如QTP等。用第三方的工具如LoadRunner 做自动化测试,实在不如有资源自己写个支持库,如果公司有足够的资源。
问题:LoadRunner为什么总用命令行(Win下) ,也就是shell命令来启动系统的资源?为什么不直接用系统的函数?实际上Win下Shell执行一个程序是调用CreateProcess激活程序产生进程。
Case:
1.LoadRunner能支持Standalone的IE7脚本录制,在XPSP2+IE7上验证通过;
2.LoadRunner不兼容Windows Vista,vugen.exe(Mercury Virtual User Generator)启动失败,错误提示"Action",跟UAC安全特性无关,初步分析跟当前用户的Temp路径改变有关;
3.Windows 2003 SP2上无法录制IE6/7,导致IE Crash,iedw.exe(IE Crash Detection)报告错误事件,错误代码0xc0000005,ie在地址00CD4548 push 1Ah段中断。初步分析原因是Windows Server默认对IE加载DEP(数据执行保护)特性,而Vugen.exe刚好又跟DEP冲突。
原因是:
No events recorded in VuGen when trying to record an application on Windows 2003 SP1 or Windows XP SP2
Windows 2003 & XP SP2 have a DEP (Data Execution Prevention) feature which prevents VuGen recording.
解决方案:
Control Panel->System -> "Advanced" tab->Performance section "Settings" button ->"Data Execution Prevention" tab->add the client program(vugen.exe) in "Turn on DEP for all programs and services except those I select" or choose "Turn on DEP for essential windows programs and services only." and a reboot is required.
Appendix:
1. 长文件名或路径用空格要求引号
2. 文件的长路径转换为短路径(dos格式)
[C#]
using System.Runtime.InteropServices;
定义:
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern int GetShortPathName(
[MarshalAs(UnmanagedType.LPTStr)] string path,
[MarshalAs(UnmanagedType.LPTStr)] StringBuilder shortPath, int shortPathLength);
引用:
StringBuilder shortPath = new StringBuilder(80);
int result = GetShortPathName(@"F:\Program Files\Internet Explorer\iexplore.exe", shortPath, shortPath.Capacity);
string s = shortPath.ToString();
MessageBox.Show(s.ToString());
结果:
F:\PROGRA~1\INTERN~1\iexplore.exe
2. 虽然进行以上步骤,但是IE还是出错;
答案:
下面的地址已经不对了,网站他们已经改版过了,现在的下载非常的复杂,先到下面网址
http://support.openview.hp.com/selfsolve/document/KM85552?searchIdentifier=-12507534:11a9eaa168c:-7fef&resultType=document&documentURL=KM85552&resultsURL=/selfsolve/patches&allowReturn=true
然后需要注册,这个是免费注册的。然后才能下载相关的补丁,而且所有补丁的都是在8.0下面的 不是在8.04下面;
Internet Explorer 7 (IE 7) support for LoadRunner 8.1 Feature Pack 4,必须先安装LoadRunner 8.1 Feature Pack 4
Patch Installation
To install this patch, run LR81FP4P125.exe, available from the Patches database.
Limitations
· Some versions of JInitiator may cause IE to crash when recording the Oracle NCA protocol on IE 7 platforms.
· Cannot record the FTP protocol upload or download operations on IE 7 platforms.
· Does not support tabbed browsing.
If you record using VuGen on IE 7 platforms, then Internet Explorer will open with this feature disabled.
· The current version of Mercury Diagnostics does not support IE 7. Diagnostics version 6.5 will support IE 7.
4.Linux Shell基本工作原理
系统初启后,核心为每个终端用户建立一个进程去执行Shell解释程序。它的执行过程基本上按如下步骤:
(1)读取用户由键盘输入的命令行。
(2)分析命令,以命令名作为文件名,并将其它参数改造为系统调用execve( )内部处理所要求的形式。
execve()函数将执行一个程序。execve()用来执行参数filename字符串所代表的文件路径,第二个参数系利用数组指针来传递给执行文件,最后一个参数则为传递给执行文件的新环境变量数组。
#include
int execve (const char *filename, const char *argv [], const char *envp[]);
(3)终端进程调用fork( )建立一个当前进程的子进程。
#include /*包含了pid_t的定义*/
#include /*包含系统调用fork的说明*/
unisigned int pid_t fork(void);
(4)终端进程本身用系统调用wait4( )来等待子进程完成(如果是后台命令,则不等待)。当子进程运行时调用execve( ),子进程根据文件名(即命令名)到目录中查找有关文件(这是命令解释程序构成的文件),将它调入内存,执行这个程序(解释这条命令)。
#include
#include
#include
#include
pid_t wait4(pid_t pid, int *status, int options,struct rusage *rusage);
(5)如果命令末尾有&号(后台命令符号),则终端进程不用系统调用wait4( )等待,立即发提示符,让用户输入下一个命令,转⑴。如果命令末尾没有&号,则终端进程要一直等待,当子进程(即运行命令的进程)完成处理后终止,向父进程(终端进程)报告,此时终端进程醒来,在做必要的判别等工作后,终端进程发提示符,让用户输入新的命令,重复上述处理过程。
5. Responsibilities of the Shell
The shell is ultimately responsible for making sure that any commands typed at the prompt get executed properly. Included in those responsibilities are:
1. Reading input and parsing the command line
2. Evaluating special characters, such as wildcards and the history character
3. Setting up pipes, redirection, and background processing
4. Handling signals
5. Setting up programs for execution
3. 安装好补丁后,仍然不可以录制,出错为IE自动关闭;
答案:关闭IE的相关加载项:China Merchants Bank发行的Web Protect既可;
答案:
Application: Mercury LoadRunner 8.1 x86
Environment: Windows+IE
Scenario:用LR调起IE
Tool: Process Explorer
Truth: LoadRunner 调用起IE的过程是, vugen.exe(虚拟用户生成器)传递先前设置好的iexplore.exe路径(Program to record中设置)、要测试的URL网址(URL Address中设置),把字符串参数传递给CMD命令,运行命令:
"F:\Program Files\Internet Explorer\iexplore.exe" http://www.microsoft.com/
打开URL网页,录制过程。
Conclusion: LoadRunner启用系统的服务、进程,应该都用的是命令行,似乎所有第三方自动化测试软件都采用的这个策略,比如QTP等。用第三方的工具如LoadRunner 做自动化测试,实在不如有资源自己写个支持库,如果公司有足够的资源。
问题:LoadRunner为什么总用命令行(Win下) ,也就是shell命令来启动系统的资源?为什么不直接用系统的函数?实际上Win下Shell执行一个程序是调用CreateProcess激活程序产生进程。
Case:
1.LoadRunner能支持Standalone的IE7脚本录制,在XPSP2+IE7上验证通过;
2.LoadRunner不兼容Windows Vista,vugen.exe(Mercury Virtual User Generator)启动失败,错误提示"Action",跟UAC安全特性无关,初步分析跟当前用户的Temp路径改变有关;
3.Windows 2003 SP2上无法录制IE6/7,导致IE Crash,iedw.exe(IE Crash Detection)报告错误事件,错误代码0xc0000005,ie在地址00CD4548 push 1Ah段中断。初步分析原因是Windows Server默认对IE加载DEP(数据执行保护)特性,而Vugen.exe刚好又跟DEP冲突。
原因是:
No events recorded in VuGen when trying to record an application on Windows 2003 SP1 or Windows XP SP2
Windows 2003 & XP SP2 have a DEP (Data Execution Prevention) feature which prevents VuGen recording.
解决方案:
Control Panel->System -> "Advanced" tab->Performance section "Settings" button ->"Data Execution Prevention" tab->add the client program(vugen.exe) in "Turn on DEP for all programs and services except those I select" or choose "Turn on DEP for essential windows programs and services only." and a reboot is required.
Appendix:
1. 长文件名或路径用空格要求引号
2. 文件的长路径转换为短路径(dos格式)
[C#]
using System.Runtime.InteropServices;
定义:
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern int GetShortPathName(
[MarshalAs(UnmanagedType.LPTStr)] string path,
[MarshalAs(UnmanagedType.LPTStr)] StringBuilder shortPath, int shortPathLength);
引用:
StringBuilder shortPath = new StringBuilder(80);
int result = GetShortPathName(@"F:\Program Files\Internet Explorer\iexplore.exe", shortPath, shortPath.Capacity);
string s = shortPath.ToString();
MessageBox.Show(s.ToString());
结果:
F:\PROGRA~1\INTERN~1\iexplore.exe
2. 虽然进行以上步骤,但是IE还是出错;
答案:
下面的地址已经不对了,网站他们已经改版过了,现在的下载非常的复杂,先到下面网址
http://support.openview.hp.com/selfsolve/document/KM85552?searchIdentifier=-12507534:11a9eaa168c:-7fef&resultType=document&documentURL=KM85552&resultsURL=/selfsolve/patches&allowReturn=true
然后需要注册,这个是免费注册的。然后才能下载相关的补丁,而且所有补丁的都是在8.0下面的 不是在8.04下面;
Internet Explorer 7 (IE 7) support for LoadRunner 8.1 Feature Pack 4,必须先安装LoadRunner 8.1 Feature Pack 4
Patch Installation
To install this patch, run LR81FP4P125.exe, available from the Patches database.
Limitations
· Some versions of JInitiator may cause IE to crash when recording the Oracle NCA protocol on IE 7 platforms.
· Cannot record the FTP protocol upload or download operations on IE 7 platforms.
· Does not support tabbed browsing.
If you record using VuGen on IE 7 platforms, then Internet Explorer will open with this feature disabled.
· The current version of Mercury Diagnostics does not support IE 7. Diagnostics version 6.5 will support IE 7.
4.Linux Shell基本工作原理
系统初启后,核心为每个终端用户建立一个进程去执行Shell解释程序。它的执行过程基本上按如下步骤:
(1)读取用户由键盘输入的命令行。
(2)分析命令,以命令名作为文件名,并将其它参数改造为系统调用execve( )内部处理所要求的形式。
execve()函数将执行一个程序。execve()用来执行参数filename字符串所代表的文件路径,第二个参数系利用数组指针来传递给执行文件,最后一个参数则为传递给执行文件的新环境变量数组。
#include
int execve (const char *filename, const char *argv [], const char *envp[]);
(3)终端进程调用fork( )建立一个当前进程的子进程。
#include /*包含了pid_t的定义*/
#include /*包含系统调用fork的说明*/
unisigned int pid_t fork(void);
(4)终端进程本身用系统调用wait4( )来等待子进程完成(如果是后台命令,则不等待)。当子进程运行时调用execve( ),子进程根据文件名(即命令名)到目录中查找有关文件(这是命令解释程序构成的文件),将它调入内存,执行这个程序(解释这条命令)。
#include
#include
#include
#include
pid_t wait4(pid_t pid, int *status, int options,struct rusage *rusage);
(5)如果命令末尾有&号(后台命令符号),则终端进程不用系统调用wait4( )等待,立即发提示符,让用户输入下一个命令,转⑴。如果命令末尾没有&号,则终端进程要一直等待,当子进程(即运行命令的进程)完成处理后终止,向父进程(终端进程)报告,此时终端进程醒来,在做必要的判别等工作后,终端进程发提示符,让用户输入新的命令,重复上述处理过程。
5. Responsibilities of the Shell
The shell is ultimately responsible for making sure that any commands typed at the prompt get executed properly. Included in those responsibilities are:
1. Reading input and parsing the command line
2. Evaluating special characters, such as wildcards and the history character
3. Setting up pipes, redirection, and background processing
4. Handling signals
5. Setting up programs for execution
3. 安装好补丁后,仍然不可以录制,出错为IE自动关闭;
答案:关闭IE的相关加载项:China Merchants Bank发行的Web Protect既可;