您可以创建许多定制文件。启动 Functional Tester 时,它读取所有的定制文件并将详细信息存储在共享的内存中。共享内存中还包含对定制文件的更多引用。
定制文件是 XML 文件,包含许多标记为 <Section></Section> 标记的段落。每段均有名称,且标记间包含内容。以下示例显示脚本段:
<Section L=".ConfigFileSection"> <Name>Section Name</Name> . . Section content . </Section >
段是可选的,您还可以在定制文件中插入空段。每段包含其自身的语法。对于需要在两种组件模型中(Java™和 .NET)实现的段组件,应该包含两个 <ComponentModel> 标记,Java 和 .NET:
<ComponentModel L=".ComponentModel"> <Name>Java</Name> </ComponentModel> <ComponentModel L=".ComponentModel"> <Name>Net</Name> </ComponentModel>
proxies 段是最常用的段。它包含每个测试域用来指定部署代理类的 <DomainImplementation> 标记,以及为代理所使用的关联测试应用程序 (AUI) 类名。在 <DomainImplementation> 标记内,将 <Obj L=".Proxy"> 标记用于建立的每个代理类,而 <UsedBy> 标记指定 AUT 控件的类名。
如果希望为类似的控件使用同一代理,那么可以为单个代理类包含多个 <UsedBy> 标记。
必须适当地使用 <Section> 标记,满足部署到 Functional Tester 框架中的需求和扩展组件。
以下是主定制文件的完整语法。
<?xml version="1.0" encoding="UTF-8"?> <ConfigFile L=".ConfigFile"> <--Proxy Section: all the proxies are defined here domain wise--> <Section L=".ConfigFileSection"> <Name>proxies</Name> <Val L=".ProxyManager"> <DomainImplementation L=".DomainImplementation"> <Name>Java</Name> <Obj L=".Proxy"> <ClassName></ClassName> <Replaces/> <UsedBy></UsedBy> . . </Obj> . . </DomainImplementation> <DomainImplementation L=".DomainImplementation"> <Name>Net</Name> <Obj L=".Proxy"> <ClassName></ClassName> <Replaces/> <UsedBy></UsedBy> . . </Obj> . . </DomainImplementation> <DomainImplementation L=".DomainImplementation"> <Name>Win</Name> <Obj L=".Proxy"> <ClassName></ClassName> <Replaces/> <UsedBy></UsedBy> . . </Obj> . . </DomainImplementation> . . </Val> </Section> <--ValueManager Section: all newly defined Value and Valuemanager classes are defined here --> <Section L=".ConfigFileSection"> <Name>valueManagers</Name> <Val L=".ValueManagerManager"> <ComponentModel L=".ComponentModel"> <Name>Java</Name> <Obj L=".ValueManager"> <Id></Id> <ValueClass></ValueClass> <Manager></Manager> </Obj> </ComponentModel> <ComponentModel L=".ComponentModel"> <Name>Net</Name> <Obj L=".ValueManager"> <Id></Id> <ValueClass></ValueClass> <Manager></Manager> </Obj> </ComponentModel> </Val> </Section> <--Value Converter Section: --> <Section L=".ConfigFileSection"> <Name>valueConverters</Name> <Val L=".ValueConverterManager"> </Val> </Section> <--Property Converter Section: --> <Section L=".ConfigFileSection"> <Name>propertyConverters</Name> <Val L=".PropertyConverterManager"> <ComponentModel L=".ComponentModel"> <Name>Java</Name> <Obj L=".PropertyConverter"> <Property></Property> <Converter></Converter> </Obj> </ComponentModel> <ComponentModel L=".ComponentModel"> <Name>Net</Name> <Obj L=".PropertyConverter"> <Property></Property> <Converter></Converter> </Obj> </ComponentModel> </Val> </Section> <--Options Converter Section: --> <Section L=".ConfigFileSection"> <Name>options</Name> <Val L=".Options"> <Obj L=".Option"> <Name></Name> <Type></Type> <ReadOnly></ReadOnly> <DefaultValue/> <Description></Description> <Label/> <Category></Category> <LegalValues/> </Obj> </Val> </Section> <-- RoleMap Section: --> <Section L=".ConfigFileSection"> <Name>roleMap</Name> <Val L=".RoleMap"> <Role L=".Role"> <Name></Name> <Icon></Icon> </Role> </Val> </Section> <--TestObject Section: canonical name for all the newly created testobjects defined here --> <Section L=".ConfigFileSection"> <Name>testObjects</Name> <Val L=".TestObjectManager"> <ComponentModel L=".ComponentModel"> <Name>Java</Name> <Obj L=".TestObject"> <CanonicalName></CanonicalName> <TestObject></TestObject> </Obj> . . </ComponentModel> <ComponentModel L=".ComponentModel"> <Name>Net</Name> <Obj L=".TestObject"> <CanonicalName></CanonicalName> <TestObject></TestObject> </Obj> . . </ComponentModel> </Val> </Section> </ConfigFile>