stevecaozhe 发表于 2009-2-19 14:44:45

脚本中globals.h是干什么的?

脚本中globals.h是干什么的?因为我在回放脚本时报错,不知道跟这个有没有关系?
下面是错误:
Error: Exception was raised when calling per-process-init function in extension lrwreplaymain.dll: System Exceptions: EXCEPTION_ACCESS_VIOLATION
Error: Thread Context: Call to service of the driver failed, reason - thread context wasn't initialized on this thread.

fish_yy 发表于 2009-2-19 17:26:18

看名字!

guandarong 发表于 2009-2-19 17:36:54

把那个删了,删了后就可以录制web(http/html)脚本,那个好像是由于另一个协议会用到,好像是 web services

chare 发表于 2009-2-19 20:43:26

For the Web(HTTP/HTML) protocol,

globals.h is created to contain:

#ifndef _GLOBALS_H
#define _GLOBALS_H

//--------------------------
// Include Files
#include "lrun.h"
#include "web_api.h"
#include "lrw_custom_body.h"
        // recorded for web_custom_request functions.
//--------------------------
// Global Variables

#endif // _GLOBALS_H

所以你删除了就可能出现一些问题

stevecaozhe 发表于 2009-2-20 11:16:11

各位老大,我到底是删还是不删啊
这个globals.h是隐藏文件,我看一些教材上都没提到啊

guandarong 发表于 2009-2-20 13:45:40

一个字----删

zynuage 发表于 2009-2-20 13:46:38

可以不用管它。只要是不影响测试就行了,你也可以删除试试看,看看会发生什么情况,删除之前做好备份。

aman_cao 发表于 2009-2-20 14:03:05

头包含文件

stevecaozhe 发表于 2009-2-20 14:53:04

各位高手,我运行时报错,
Error: Exception was raised when calling per-process-init function in extension lrwreplaymain.dll: System Exceptions: EXCEPTION_ACCESS_VIOLATION
Error: Thread Context: Call to service of the driver failed, reason - thread context wasn't initialized on this thread.
删掉这个文件之后错误依旧,请大家帮我看看,谢谢!
我是用web (http/html)协议来录的脚本,录制应该很成功,在回放的时候就出现这个错误,我找了好久,以前也有人遇到过,但是都没有最终的解决方案,拜求各位了,我前天刚刚学LR,不要让我这么受打击啊

aman_cao 发表于 2009-2-20 15:25:28

环境是什么?最好把脚本也贴出来,只给这样的信息,怕是帮不了你

guandarong 发表于 2009-2-20 17:36:56

你这是第几次录制脚本啊?LR是什么版本的?对了,LR不支持vistart和IE7

chenyingli 发表于 2009-2-20 18:06:34

教本里面有没有自己定义过的变量?把变量定义放到globals.h里面去。

stevecaozhe 发表于 2009-2-23 10:02:28

感谢大家的支持,我的配置是 windows xp , loadrunner 9.0,IE7的,我在tomcat上部署的application, 下面是脚本,我是把所有的脚本都放在action里面的,脚本里应该没定义变量,不过我以前的其他的脚本定义过,不过不管是不是定义过变量的脚本,一直是报这个错误,而且是一开始就报错。请各位帮帮忙!谢谢!:handshake
Action()
{

        web_url("index.jsp",
                "URL=http://localhost:8080/tms/index.jsp",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t1.inf",
                "Mode=HTTP",
                LAST);

        web_concurrent_start(NULL);

        web_url("command.js",
                "URL=http://localhost:8080/tms/scripts/command.js",
                "Resource=1",
                "RecContentType=text/javascript",
                "Referer=http://localhost:8080/tms/index.jsp",
                "Snapshot=t2.inf",
                LAST);

        web_url("common.js",
                "URL=http://localhost:8080/tms/scripts/common.js",
                "Resource=1",
                "RecContentType=text/javascript",
                "Referer=http://localhost:8080/tms/index.jsp",
                "Snapshot=t3.inf",
                LAST);

        web_url("CheckData.js",
                "URL=http://localhost:8080/tms/scripts/CheckData.js",
                "Resource=1",
                "RecContentType=text/javascript",
                "Referer=http://localhost:8080/tms/index.jsp",
                "Snapshot=t4.inf",
                LAST);

        web_url("Public.js",
                "URL=http://localhost:8080/tms/scripts/Public.js",
                "Resource=1",
                "RecContentType=text/javascript",
                "Referer=http://localhost:8080/tms/index.jsp",
                "Snapshot=t5.inf",
                LAST);

        web_url("calendar-win2k-cold-1.css",
                "URL=http://localhost:8080/tms/scripts/jscalendarcss/calendar-win2k-cold-1.css",
                "Resource=1",
                "RecContentType=text/css",
                "Referer=http://localhost:8080/tms/index.jsp",
                "Snapshot=t6.inf",
                LAST);

        web_url("jscalendar.js",
                "URL=http://localhost:8080/tms/scripts/jscalendar.js",
                "Resource=1",
                "RecContentType=text/javascript",
                "Referer=http://localhost:8080/tms/index.jsp",
                "Snapshot=t7.inf",
                LAST);

        web_url("tms.css",
                "URL=http://localhost:8080/tms/styles/tms.css",
                "Resource=1",
                "RecContentType=text/css",
                "Referer=http://localhost:8080/tms/index.jsp",
                "Snapshot=t8.inf",
                LAST);

        web_url("calendar-en.js",
                "URL=http://localhost:8080/tms/scripts/lang/calendar-en.js",
                "Resource=1",
                "RecContentType=text/javascript",
                "Referer=http://localhost:8080/tms/index.jsp",
                "Snapshot=t9.inf",
                LAST);

        web_url("calendar-setup.js",
                "URL=http://localhost:8080/tms/scripts/calendar-setup.js",
                "Resource=1",
                "RecContentType=text/javascript",
                "Referer=http://localhost:8080/tms/index.jsp",
                "Snapshot=t10.inf",
                LAST);

        web_url("formsValidation.js",
                "URL=http://localhost:8080/tms/scripts/formsValidation.js",
                "Resource=1",
                "RecContentType=text/javascript",
                "Referer=http://localhost:8080/tms/index.jsp",
                "Snapshot=t11.inf",
                LAST);

        web_url("tms_login.jpg",
                "URL=http://localhost:8080/tms/images/tms_login.jpg",
                "Resource=1",
                "RecContentType=image/jpeg",
                "Referer=http://localhost:8080/tms/index.jsp",
                "Snapshot=t12.inf",
                LAST);

        web_concurrent_end(NULL);

        lr_think_time(12);

        web_submit_data("userManager.do",
                "Action=http://localhost:8080/tms/admin/userManager.do",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://localhost:8080/tms/index.jsp",
                "Snapshot=t13.inf",
                "Mode=HTTP",
                ITEMDATA,
                "Name=name", "Value=admin", ENDITEM,
                "Name=password", "Value=5468321", ENDITEM,
                "Name=selectLang", "Value=en_US", ENDITEM,
                "Name=button", "Value=Login", ENDITEM,
                "Name=method", "Value=login", ENDITEM,
                "Name=request-id", "Value=0.5010057153414529", ENDITEM,
                LAST);

        web_concurrent_start(NULL);

        web_url("main_top.jsp",
                "URL=http://localhost:8080/tms/main_top.jsp",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://localhost:8080/tms/admin/userManager.do",
                "Snapshot=t14.inf",
                "Mode=HTTP",
                LAST);

        web_url("main_left.jsp",
                "URL=http://localhost:8080/tms/main_left.jsp",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://localhost:8080/tms/admin/userManager.do",
                "Snapshot=t15.inf",
                "Mode=HTTP",
                LAST);

        web_url("desktop.jsp",
                "URL=http://localhost:8080/tms/desktop.jsp",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://localhost:8080/tms/admin/userManager.do",
                "Snapshot=t16.inf",
                "Mode=HTTP",
                LAST);

        web_concurrent_end(NULL);

        web_concurrent_start(NULL);

        web_url("BB_title_1024.jpg",
                "URL=http://localhost:8080/tms/images/BB_title_1024.jpg",
                "Resource=1",
                "RecContentType=image/jpeg",
                "Referer=http://localhost:8080/tms/main_top.jsp",
                "Snapshot=t17.inf",
                LAST);

        web_url("BB_title_800.jpg",
                "URL=http://localhost:8080/tms/images/BB_title_800.jpg",
                "Resource=1",
                "RecContentType=image/jpeg",
                "Referer=http://localhost:8080/tms/main_top.jsp",
                "Snapshot=t18.inf",
                LAST);

        web_url("BB_title_1280.jpg",
                "URL=http://localhost:8080/tms/images/BB_title_1280.jpg",
                "Resource=1",
                "RecContentType=image/jpeg",
                "Referer=http://localhost:8080/tms/main_top.jsp",
                "Snapshot=t19.inf",
                LAST);

        web_concurrent_end(NULL);

        web_concurrent_start(NULL);

        web_url("global.css",
                "URL=http://localhost:8080/tms/styles/global.css",
                "Resource=1",
                "RecContentType=text/css",
                "Referer=http://localhost:8080/tms/main_left.jsp",
                "Snapshot=t20.inf",
                LAST);

        web_url("plus_folder.jpg",
                "URL=http://localhost:8080/tms/images/menu/plus_folder.jpg",
                "Resource=1",
                "RecContentType=image/jpeg",
                "Referer=http://localhost:8080/tms/main_left.jsp",
                "Snapshot=t21.inf",
                LAST);

        web_url("minus_folder.jpg",
                "URL=http://localhost:8080/tms/images/menu/minus_folder.jpg",
                "Resource=1",
                "RecContentType=image/jpeg",
                "Referer=http://localhost:8080/tms/main_left.jsp",
                "Snapshot=t22.inf",
                LAST);

        web_url("leaf.jpg",
                "URL=http://localhost:8080/tms/images/menu/leaf.jpg",
                "Resource=1",
                "RecContentType=image/jpeg",
                "Referer=http://localhost:8080/tms/main_left.jsp",
                "Snapshot=t23.inf",
                LAST);

        web_concurrent_end(NULL);

        web_concurrent_start(NULL);

        web_url("scrolling_table_body.js",
                "URL=http://localhost:8080/tms/scripts/scrolling_table_body.js",
                "Resource=1",
                "RecContentType=text/javascript",
                "Referer=http://localhost:8080/tms/desktop.jsp",
                "Snapshot=t24.inf",
                LAST);

        web_url("menu_tracker_off.jpg",
                "URL=http://localhost:8080/tms/images/menu_tracker_off.jpg",
                "Resource=1",
                "RecContentType=image/jpeg",
                "Referer=http://localhost:8080/tms/desktop.jsp",
                "Snapshot=t25.inf",
                LAST);

        web_url("tms_overview.gif",
                "URL=http://localhost:8080/tms/images/tms_overview.gif",
                "Resource=1",
                "RecContentType=image/gif",
                "Referer=http://localhost:8080/tms/desktop.jsp",
                "Snapshot=t26.inf",
                LAST);

        web_url("shera.jpg",
                "URL=http://localhost:8080/tms/images/shera.jpg",
                "Resource=1",
                "RecContentType=image/jpeg",
                "Referer=http://localhost:8080/tms/desktop.jsp",
                "Snapshot=t27.inf",
                LAST);

        web_concurrent_end(NULL);

        lr_think_time(7);

        web_url("   Logout",
                "URL=http://localhost:8080/tms/admin/logout.jsp",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://localhost:8080/tms/main_left.jsp",
                "Snapshot=t28.inf",
                "Mode=HTTP",
                LAST);

        web_submit_data("userManager.do_2",
                "Action=http://localhost:8080/tms/admin/userManager.do",
                "Method=GET",
                "EncType=",
                "RecContentType=text/html",
                "Referer=http://localhost:8080/tms/admin/logout.jsp",
                "Snapshot=t29.inf",
                "Mode=HTTP",
                ITEMDATA,
                "Name=method", "Value=logout", ENDITEM,
                LAST);

        return 0;
}

stevecaozhe 发表于 2009-2-23 10:15:13

上面是用url-based录制的脚本,这是用html-based录制的脚本,发生的错误是一样的,我只是用action 录制,脚本如下:

Action()
{

        web_url("index.jsp",
                "URL=http://localhost:8080/tms/index.jsp",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t1.inf",
                "Mode=HTML",
                LAST);

        lr_think_time(9);

        web_submit_data("userManager.do",
                "Action=http://localhost:8080/tms/admin/userManager.do",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://localhost:8080/tms/index.jsp",
                "Snapshot=t2.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=name", "Value=admin", ENDITEM,
                "Name=password", "Value=5468321", ENDITEM,
                "Name=selectLang", "Value=en_US", ENDITEM,
                "Name=button", "Value=Login", ENDITEM,
                "Name=method", "Value=login", ENDITEM,
                "Name=request-id", "Value=0.7339455498276033", ENDITEM,
                LAST);

        lr_think_time(9);

        web_link("   Logout",
                "Text=   Logout",
                "Snapshot=t3.inf",
                LAST);

        web_submit_form("userManager.do_2",
                "Snapshot=t4.inf",
                ITEMDATA,
                LAST);

        return 0;
}

zdp417 发表于 2009-3-3 12:54:41

楼主,你的问题解决了吗,我也遇到同样的问题,如有解决办法请支援一下,不胜感激:)

laipi 发表于 2009-3-26 09:51:41

楼主,你的问题解决了吗,我也遇到同样的问题

楼主,你的问题解决了吗,我也遇到同样的问题

laipi 发表于 2009-3-26 09:53:06

楼主,你的问题解决了吗,我也遇到同样的问题

楼主,你的问题解决了吗,我也遇到同样的问题

jacktanzi 发表于 2009-4-17 09:57:46

楼主,你的问题解决了吗,我也遇到同样的问题

我也同意问题,怎么办

云层 发表于 2009-4-18 17:22:40

globals.h是用来定义头文件和全局变量的
你的错误和这个文件无关,可能是系统的问题,换个lr试试

志大才疏 发表于 2009-4-19 01:10:37

.h 头文件吗   就像C语言里似的。
页: [1] 2
查看完整版本: 脚本中globals.h是干什么的?