<div class="pill-wrap double">
<a ng-click="modalCancel()" class="button pill">No</a>
<a ng-click="modalSuccess()" class="button pill">Yes</a>
</div>
我想获得带有按钮药丸的按钮,并且innertext的位置是“No&#39;并单击它
答案 0 :(得分:1)
要点击带有innertext的按钮否,您可以使用以下代码行:
driver.FindElement(By.XPath("//div[@class='pill-wrap double']//a[@class='button pill' and @ng-click='modalCancel()']")).Click();