[英]Watin; Get element by id not working
我試圖將數據放入隱藏輸入內的文本區域,但是watin找不到它。
當我搜索輸入時,我的程序顯示:
var ie = new WatiN.Core.IE("http://facebook.com", true);
ie.ClearCookies(); ie.TextField(WatiN.Core.Find.ById("email")).TypeText(textBoxUsername.Text); ie.TextField(WatiN.Core.Find.ById("pass")).TypeText(textBoxPassword.Text);
ie.Button(WatiN.Core.Find.ByValue("Login")).Click();
ie.Link(WatiN.Core.Find.ByText("Status")).Click();
ie.TextField(WatiN.Core.Find.ById("u362110_11")).TypeText(textBoxPassword.Text);
例外
Could not find INPUT (hidden) or INPUT (password) or INPUT (text) or INPUT (textarea) or TEXTAREA element tag matching criteria: Attribute 'id' equals 'u493403_13' at http://www.facebook.com/home.php
通過按名稱搜索來替換id,因為id是動態的並且一直在變化
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.