13.导入外部xml文件的环境变量,并取其值实例
'导入外部文件
Environment.LoadFromFile("D:\test\test.xml")
'读取环境变量的myusername 值
myusername=Environment.Value("myusername")
'读取环境变量的 mypassword值
mypassword=Environment.Value("mypassword")
'读取环境变量的myvarian 值
myvariant=Environment.Value("myvariant")
Reporter.ReportEvent micdone,"读取test.xml文件","myusername="&myusername&",mypassword = "&mypassword&",myvariant = "&myvariant
外部test.xml文件内容如下:
<Environment>
</Environment>
提示:附加一个小实例
'获取当前导入的环境变量文件名
filename=Environment.ExternalFileName
Reporter.ReportEvent micDone,