簡體   English   中英

Watin:獲取下拉列表

[英]Watin : Get DropDown list

我正在嘗試從下拉列表中獲取列表,因為它不是選擇列表,所以我嘗試了類似的方法

   this.ContextBrowser.Link(new Regex("ddlSQuestion1_Arrow")).Click();
   this.ContextBrowser.Div(Find.ByText(new Regex("What is the name of the first school you attended?"))).Click();

代碼實際在做什么是單擊下拉箭頭,設法下拉列表,但我不能單擊列表,也就是li。我如何單擊下拉列表。有什么建議嗎?

嘗試像這樣在下拉列表中獲取元素

var select = this.ContextBrowser.Link(new Regex("ddlSQuestion1_Arrow")).Element[2];
select.click();

希望這個幫助

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM