通过WatiN.Core.Broswer.Frame()方法来获取iframe对象,之后的容器就是frame,然后进行操作。

下面的例子是登录QQ空间的:

Frame frame = browser.Frame(Find.ById("login_frame"));
Link otherLink = frame.Link(Find.ById("switcher_plogin"));
TextField txtName = frame.TextField(Find.ById("u"));
TextField txtPsw = frame.TextField(Find.ById("p")); 
WatiN.Core.Button btnLogin = frame.Button(Find.ById("login_button")); if (otherLink.Exists) otherLink.Click(); txtName.Value = strLine[0].Trim(); txtPsw.Value = strLine[1].Trim(); btnLogin.Click();

 

相关文章:

  • 2021-11-13
  • 2021-10-17
  • 2022-12-23
  • 2021-11-27
  • 2022-01-14
  • 2021-05-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-19
  • 2022-12-23
  • 2021-11-02
相关资源
相似解决方案