在testcomplete中搜索xml文件中的特定属性值

时间:2016-04-27 10:15:33

标签: javascript c# xml xml-parsing testcomplete

我有一个xml文件,其中我需要特定标记的值。我使用testcomplete作为工具并使用c#脚本对其进行编码。有关如何操作的任何建议吗?

2 个答案:

答案 0 :(得分:1)

要在TestComplete中使用XML文件,您可以使用以下对象:

XML DOM objects. You can use these objects to work with any XML file. Working with these objects requires more efforts and knowledge of XML DOM. However, we suggest that you use these objects to work with XML files.

TestComplete’s Storages object. You use the methods and properties of this object to write data to and read it from XML files. However, this object works only with XML files created with the Storage.XML method (such files have a specific format, they include sections, subsections and options). For more information on this, see Section Object. If you try to open an XML file that has another format by using the Storage.XML method, an error will occur.

enter link description here

答案 1 :(得分:0)

嗯,TestComplete附带了一个非常有用的帮助文件,该文件也可用online。例如,Working With XML Files From Scripts主题解释了如何使用示例以多种方式解决您的任务。