[英]Watin; Get element by id not working
I am trying to place data into text area that is inside hidden input but watin does not find it. 我试图将数据放入隐藏输入内的文本区域,但是watin找不到它。
When I search for inputs my program shows this: 当我搜索输入时,我的程序显示:
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);
Exception 例外
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.