|
在网上搜到的,一会试下,看能不能解决我的问题。
你曾经遇到下面的问题么?
1、进程间的通信?
2、Action之间的信息传递?
3、在BPT框架中,模块间的信息传递?
4、机器间的信息传递?
5、当你的进程没有结束时,如何把信息保存在内存中?
6、如果以上的问题你还不能回答,那么现在有答案给你。
知识收件匣感到自豪的是,目前一个最新的解决方案来克服上述问题—知识收件匣的共享仓库
什么是知识收件匣的共享仓库?
知识收件匣的共享仓库是一个基于Activex的COM组件,允许你创建逻辑的仓库,存储对象和值。这种信息在没有被覆盖之前一直保存在系统中。简单的QTP代码如下:
'Create the shared store
Set SharedStore = CreateObject ("KnowledgeInbox.SharedStore")
'Add a new store
Set Store = oSharedStore.AddStore("GeneralTest")
'Create a dictionary object in shared store
Set Dict = oSharedStore.CreateObject("Scripting.Dictionary")
'Add the dictionary object to the store
oStore.AddItem "TestDictionary" , oDict
'Update some values in dictionary
oDict("CA") = "California"
'Destroy the object
Set Dict = Nothing
'Instruct shared to store to remain in memory
oSharedStore.PersistInMemory = True
'Destroy the shared store
Set SharedStore = Nothing
关闭QTP并打开一个VBScript的记事本
'Create the shared object store
Set SharedStore = CreateObject ("KnowledgeInbox.SharedStore")
'Get the specified store
Set Store = oSharedStore.GetStore("GeneralTest")
'Get the specified object from the store
Set Dict = oStore.GetItem ("TestDictionary")
'Will display california
MsgBox oDict("CA")
'Now instruct shared store to unload when destroyed
oSharedStore.PersistInMemory = False
'Destroy the shared store
Set SharedStore = Nothing
你曾经遇到下面的问题么?
1、进程间的通信?
2、Action之间的信息传递?
3、在BPT框架中,模块间的信息传递?
4、机器间的信息传递?
5、当你的进程没有结束时,如何把信息保存在内存中?
6、如果以上的问题你还不能回答,那么现在有答案给你。
知识收件匣感到自豪的是,目前一个最新的解决方案来克服上述问题—知识收件匣的共享仓库
什么是知识收件匣的共享仓库?
知识收件匣的共享仓库是一个基于Activex的COM组件,允许你创建逻辑的仓库,存储对象和值。这种信息在没有被覆盖之前一直保存在系统中。简单的QTP代码如下:
'Create the shared store
Set SharedStore = CreateObject ("KnowledgeInbox.SharedStore")
'Add a new store
Set Store = oSharedStore.AddStore("GeneralTest")
'Create a dictionary object in shared store
Set Dict = oSharedStore.CreateObject("Scripting.Dictionary")
'Add the dictionary object to the store
oStore.AddItem "TestDictionary" , oDict
'Update some values in dictionary
oDict("CA") = "California"
'Destroy the object
Set Dict = Nothing
'Instruct shared to store to remain in memory
oSharedStore.PersistInMemory = True
'Destroy the shared store
Set SharedStore = Nothing
关闭QTP并打开一个VBScript的记事本
'Create the shared object store
Set SharedStore = CreateObject ("KnowledgeInbox.SharedStore")
'Get the specified store
Set Store = oSharedStore.GetStore("GeneralTest")
'Get the specified object from the store
Set Dict = oStore.GetItem ("TestDictionary")
'Will display california
MsgBox oDict("CA")
'Now instruct shared store to unload when destroyed
oSharedStore.PersistInMemory = False
'Destroy the shared store
Set SharedStore = Nothing
|
|