我想TestCondition
在循环中使用在xml中定义的逗号分隔的属性值来进一步执行我的代码。请找到示例xml,如下所示:
<DrWatson>
<Bugs Name="Testing New things" TestCondition="STATE,STATUS">
<Bug>
<family>ESG</family>
<product>Dr.Watson</product>
<version>Xpress API</version>
<productarea>1</productarea>
<subarea>Blank</subarea>
<title>Bug.AddNote#1 : Dr.Watson Framework by Aman</title>
<description>test</description>
<appLanguages>English~~Bug</appLanguages>
<platforms>Win XP All~~English~~Bug</platforms>
<state>Open</state>
<status>NeedsReview</status>
<reason>Blank</reason>
<failureType>Unspecified</failureType>
<Frequency>Unknown</Frequency>
<severity>0</severity>
<priority>0</priority>
<methodFound>Blank</methodFound>
<foundInBuild>1</foundInBuild>
<dev>bansal</dev>
<qe>sdawar</qe>
<keyword>Blank</keyword>
<duplicateId>Blank</duplicateId>
<note></note>
</Bug>
<Bug>
<family>ESG</family>
<product>Dr.Watson</product>
<version>Xpress API</version>
<productarea>1</productarea>
<subarea>Blank</subarea>
<title>Bug.AddNote#1 : Dr.Watson Framework by Aman</title>
<description>test</description>
<appLanguages>English~~Bug</appLanguages>
<platforms>Win XP All~~English~~Bug</platforms>
<state>Open</state>
<status>ToFix</status>
<reason>Blank</reason>
<failureType>Unspecified</failureType>
<Frequency>Unknown</Frequency>
<severity>0</severity>
<priority>0</priority>
<methodFound>Blank</methodFound>
<foundInBuild>1</foundInBuild>
<dev>bansal</dev>
<qe>sdawar</qe>
<keyword>Blank</keyword>
<duplicateId>Blank</duplicateId>
<note></note>
</Bug>
</Bugs>
<Bugs Name="STATUS" TestCondition="STATUS">
<Bug>
<family>ESG</family>
<product>Dr.Watson</product>
<version>Xpress API</version>
<productarea>1</productarea>
<subarea>Blank</subarea>
<title>Bug.AddNote#1 : Dr.Watson Framework by Aman</title>
<description>test</description>
<appLanguages>English~~Bug</appLanguages>
<platforms>Win XP All~~English~~Bug</platforms>
<state>Open</state>
<status>NeedsReview</status>
<reason>Blank</reason>
<failureType>Unspecified</failureType>
<Frequency>Unknown</Frequency>
<severity>0</severity>
<priority>0</priority>
<methodFound>Blank</methodFound>
<foundInBuild>1</foundInBuild>
<dev>bansal</dev>
<qe>sdawar</qe>
<keyword>Blank</keyword>
<duplicateId>Blank</duplicateId>
<note></note>
</Bug>
<Bug>
<family>ESG</family>
<product>Dr.Watson</product>
<version>Xpress API</version>
<productarea>1</productarea>
<subarea>Blank</subarea>
<title>Bug.AddNote#1 : Dr.Watson Framework by Aman</title>
<description>test</description>
<appLanguages>English~~Bug</appLanguages>
<platforms>Win XP All~~English~~Bug</platforms>
<state>Open</state>
<status>ToFix</status>
<reason>Blank</reason>
<failureType>Unspecified</failureType>
<Frequency>Unknown</Frequency>
<severity>0</severity>
<priority>0</priority>
<methodFound>Blank</methodFound>
<foundInBuild>1</foundInBuild>
<dev>bansal</dev>
<qe>sdawar</qe>
<keyword>Blank</keyword>
<duplicateId>Blank</duplicateId>
<note></note>
</Bug>
</Bugs>
</DrWatson>
我在代码中调用单个属性值,如下所示:
attrVal_New = Update_Bugs[m].Attributes["TestCondition"].Value;
string attributelowercase = attrVal_New.ToLower();
m++;
我想要的是TestCondition
一一使用“状态”和“状态”。请建议。