[英]How to click this button using Selenium C#?
<div class="mdl-align"> == $0
: :before
<button class="fp-upload-btn btn-primary btn">Upload this file</button> == $0
: :after
</div>
以上代碼來自網站,但我嘗試多次嘗試后無法點擊此按鈕。 我使用硒與C#進行自動化測試。 這個按鈕的作用是簡單地提交表格。
嘗試使用xpath
定位器單擊“上Upload this file button
。
driver.FindElement(By.XPath("//button[contains(text(), 'Upload this file')]")).Click();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.