geckofx 按钮点击

标签 geckofx

我已将 skybound gecckofx 集成到我的应用程序中。我能够填写文本框

GeckoElement username = null; 
username = checkDoc.GetElementById("ctl00_contentPlaceHolder_txtUserName");
username.SetAttribute("value", "myemail@gmail.com");

但是我无法点击按钮

GeckoElement button1 = null;
button1 = checkDoc.GetElementById("ctl00_contentPlaceHolder_lbtnLogin");
button.click() // there is no function by the name on click on the button 

最佳答案

检查您是否拥有 GeckoInputElement 类。如果不是,那么您可能需要 Skybount.Com 库。或者您可以使用最新版本的 gecko fx。将 GeckoFX 21 与 xulrunner 21 结合使用。 你可以从 ftp.mozila.org 得到

在 geckofx 21 中你可以试试这段代码

GeckoButtonElement button = new GeckoButtonElement(_webBrowser.Document.getElementById("your_button_id").DomObject);
button.Click();

就这么简单!

你也可以像这样使用 GeckoInputElement 将你的电子邮件地址输入到 html 元素

GeckoInputElement username = new GeckoInputElement(checkDoc.GetElementById("ctl00_contentPlaceHolder_txtUserName");
.DomObject);
username.Value = "myemail@gmail.com"

Τέλος! (完成)

关于geckofx 按钮点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15005216/

相关文章:

javascript - GeckoFX 的 WebRTC SDP 解析错误

javascript - SendKey 进入浏览器控件 WinForm .Net

c# - 具有 CORS 支持的 GeckoFX

C# Gecko 选择特定的列表框或组合框

geckofx - 如何将 Gecko Javascript 控制台消息重定向到文件?

c# - 向 GeckoFx 的所有请求添加 http header

c# - xulrunner,C# : how to change html?

c# - 为 GeckoFX 网络浏览器设置 cookies?

vb.net - 怎么说 GeckoFX 使用旧的缓存文件而不是重新加载它们?