在 XML 文件中搜索 TestComplete 中的特定属性值

search an xml file for specific attribute values in testcomplete

本文关键字:属性 TestComplete XML 文件 搜索      更新时间:2023-09-26

我有一个xml文件,我需要特定标签的值。我正在使用testcomplete作为工具,并使用c#脚本对其进行编码。关于如何做到这一点的任何建议?

若要在 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.

在此处输入链接说明

好吧,TestComplete 附带了一个非常有用的帮助文件,也可以在线获得。例如,使用脚本中的 XML 文件主题通过示例说明了如何以多种方式解决任务。