|
我用LoadRunner9.0录制cs架构的应用,应用的客户端为C#做的,脚本可以正常录制,但回放是报错,错误信息如下:
Error: Failed to compile virtual user.
Notify: __________________________________________________
Notify: Project "C:\Documents and Settings\yaoliming.WONDERS_FILES\Local Settings\Temp\noname6\Script.sln" (Build target(s)):
Notify:
Notify: __________________________________________________
Notify: Project "C:\Documents and Settings\yaoliming.WONDERS_FILES\Local Settings\Temp\noname6\Script.sln" is building "C:\Documents and Settings\yaoliming.WONDERS_FILES\Local Settings\Temp\noname6\Script.csproj" (default targets):
Notify:
Notify: vuser_init.cs(36,12): warning CS1030: #warning: ': Code Generation Error'
Error: vuser_init.cs(42,4): error CS0103: The name 'NetworkCredential_1' does not exist in the current context
Error: vuser_init.cs(45,4): error CS0103: The name 'NetworkCredential_1' does not exist in the current context
Error: vuser_init.cs(48,4): error CS0103: The name 'NetworkCredential_1' does not exist in the current context
出错的脚本为:
lr.log("Event 5: NetworkCredential_1.UserName = \"anonymous\";");
NetworkCredential_1.UserName = "anonymous";
lr.log("Event 6: NetworkCredential_1.Password = \"anonymous@\";");
NetworkCredential_1.Password = "anonymous@";
lr.log("Event 7: NetworkCredential_1.Domain = string.Empty;");
NetworkCredential_1.Domain = string.Empty;
出错脚本为登陆页面,实际用户名密码为:admin 8888 Domain:SZPD
从录制脚本看信息都是匿名的,不知道是不是错到这里,但把脚本修改如下:
lr.log("Event 5: NetworkCredential_1.UserName = \"admin\";");
NetworkCredential_1.UserName = "admin";
lr.log("Event 6: NetworkCredential_1.Password = \"8888\";");
NetworkCredential_1.Password = "8888";
lr.log("Event 7: NetworkCredential_1.Domain = "SZPD";");
NetworkCredential_1.Domain = "SZPD";
运行结果仍然报错,那位高手能指导一下,十分感觉,由于项目需要很紧急:) |
|