51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2968|回复: 5
打印 上一主题 下一主题

[求助] QTP 脚本问题,请大家帮忙看看,谢谢~

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2012-3-2 16:12:36 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Set f = fso.GetFolder(Environment("TestDir")),不知道这一句是什么意思啊?fso.GetFolder后面不是应该跟一个路径的吗?
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2012-3-2 16:14:53 | 只看该作者
如果大家有关于VBScript的中文教程,麻烦发我一份吧~
邮箱 beibei168169@163.com,谢谢各位了~
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2012-3-2 16:34:01 | 只看该作者
这个QTP调用自己的环境变量,
File->Test Settings中environment项TestDir
Path of the folder in which the test is located

从qtp帮助中复制了详细信息,你参考下吧

Environment Object
Description
Enables you to work with environment variables.

You can set or retrieve the value of environment variables using the Environment object. You can retrieve the value of any environment variable. You can set the value of only user-defined, environment variables.

Syntax
To set the value of a user-defined, environment variable:

Environment (VariableName) = NewValue

To retrieve the value of a loaded environment variable:

CurrValue = Environment (VariableName)


Argument
Type
Description

VariableName  String  The name of the environment variable.  
NewValue  Variant  The new value of the environment variable.  
CurrValue  Variant  The current value of the environment variable.  


Example
The following example creates a new internal user-defined variable named MyVariable with a value of 10, and then retrieves the variable value and stores it in the MyValue variable.

Environment.Value("MyVariable")=10

MyValue=Environment.Value("MyVariable")
回复 支持 反对

使用道具 举报

该用户从未签到

4#
发表于 2012-3-2 16:34:19 | 只看该作者
这个QTP调用自己的环境变量,
File->Test Settings中environment项TestDir
Path of the folder in which the test is located

从qtp帮助中复制了详细信息,你参考下吧

Environment Object
Description
Enables you to work with environment variables.

You can set or retrieve the value of environment variables using the Environment object. You can retrieve the value of any environment variable. You can set the value of only user-defined, environment variables.

Syntax
To set the value of a user-defined, environment variable:

Environment (VariableName) = NewValue

To retrieve the value of a loaded environment variable:

CurrValue = Environment (VariableName)


Argument
Type
Description

VariableName  String  The name of the environment variable.  
NewValue  Variant  The new value of the environment variable.  
CurrValue  Variant  The current value of the environment variable.  


Example
The following example creates a new internal user-defined variable named MyVariable with a value of 10, and then retrieves the variable value and stores it in the MyValue variable.

Environment.Value("MyVariable")=10

MyValue=Environment.Value("MyVariable")
回复 支持 反对

使用道具 举报

该用户从未签到

5#
 楼主| 发表于 2012-3-2 16:37:44 | 只看该作者
回复 3# lotus


    谢谢啊~讲的很清楚呢~
回复 支持 反对

使用道具 举报

该用户从未签到

6#
发表于 2012-3-26 21:59:20 | 只看该作者
Environment("TestDir")
调用QTP环境变量。
回复 支持 反对

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-6-22 09:29 , Processed in 0.075663 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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