<div id="ctl00_ContentHolder_vs_ValidationSummary" class="errorblock">
<p><strong>The following errors were found:</strong></p>
<ul><input type="hidden" Name="SummaryErrorCmsIds" Value="E024|E012|E014" />
<li>Please select a title.</li>
<li>Please key in your first name.</li>
<li>Please key in your last name.</li>
</ul>
</div>
我想捕获值为 E024 E012 和 E014 的文本并将其写入 Excel 文件。
我尝试了以下但它不起作用。
string val1 = driver.FindElement(By.XPath("//div[contains(@class, 'errorblock'/ value = 'E024|E012|E014'")).Text;
我怎样才能做到这一点?