C#通过WatiN操作页面中内嵌的Iframe
2014-01-10 13:36
141 查看
通过WatiN.Core.Broswer.Frame()方法来获取iframe对象,之后的容器就是frame,然后进行操作。
下面的例子是登录QQ空间的:
下面的例子是登录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();
相关文章推荐
- layui中弹出一个弹框,通过内嵌页面里的操作关掉整个弹出层窗口
- c#操作webbrowser中网页的iframe页面的javascript函数和触发控件事件或者直接运行js函数
- 【C#】通过遍历IFrame访问页面元素
- C#通过WMI操作本地共享文件夹
- 获取iframe中的内容、查找获取指定元素(关于用c++调用WEBBROWSER控件,使用相关接口操作web页面元素的一些方法)
- C#操作Xml:通过XmlDocument读写Xml文档
- js中iframe的子父页面互相操作的方法
- c#通过GET/POST获取页面的代码
- jquery操作iframe的方法:父页面和子页面相互操作的方法
- C# 通过 oledb 操作Excel实例代码
- .Net那点事儿系列:C#操作Xml:通过XmlDocument读写Xml文档
- C#通过引用Office Excel (2007) 组件实现对Excel文件的操作
- C#通过XML节点属性/属性值读取写入XML操作代码实例
- C# 谈谈Interface和通过Interface传递web页面数据
- 超简洁的jquery操作页面中iframe内的dom元素(未测试)
- 从父页面读取和操作iframe中内容方法
- JQuery操作iframe父页面与子页面的元素与方法
- C#通过SqlConnection连接查询更新等操作Sqlserver数据库
- iframe动态改变内嵌页面高度
- C# Winform 通过FlowLayoutPanel及自定义的编辑控件,实现快速构建C/S版的编辑表单页面