3

i have integrated skybound gecckofx into my application . i am able to fill up textbox

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

but i am unable to click the button

GeckoElement button1 = null;
button1 = checkDoc.GetElementById("ctl00_contentPlaceHolder_lbtnLogin");
button.click() // there is no function by the name on click on the button 
Kinnan Nawaz
  • 399
  • 2
  • 7
  • 24

4 Answers4

6

Check if you have the class GeckoInputElement. If no then probably you need Skybount.Com libraries. Or you can use newest versio of gecko fx. Use GeckoFX 21 with xulrunner 21. you can get from ftp.mozila.org

in geckofx 21 you can try this code

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

So simple!

Also you can use GeckoInputElement to input you email address to the html element like this

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

Τέλος! (Finish)

A. Zalonis
  • 1,599
  • 6
  • 26
  • 41
  • Can you help me find a direct link to get these updated versions of GeckoFX and xulrunner? I am having trouble finding it. – Micro Jul 03 '14 at 13:31
  • Here you can found all versions of xulrunner http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/ and GeckFX here https://bitbucket.org/geckofx/geckofx-18.0/overview – A. Zalonis Jul 25 '14 at 08:37
1

I have done with this way

 Gecko.GeckoHtmlElement Btn = (Gecko.GeckoHtmlElement)browse.DomDocument.GetElementById("btnPrint");               
 Btn.Click();

//browse = the name of Gecko browser control

DareDevil
  • 5,249
  • 6
  • 50
  • 88
0

Did you tried something like this?

function performClick(buttonElement)
{
    var evt = document.createEvent("MouseEvents");
    evt.initEvent("click", true, true);
    buttonElement.dispatchEvent(evt);
}
Przemysław Michalski
  • 9,627
  • 7
  • 31
  • 37
0

'geckowebbrowser for any element click function
Dim element = geckoWebBrowser1.Document.GetElementById("someid")
Dim Clickelement As GeckoHtmlElement = CType(element,GeckoHtmlElement)
Clickelement.Click()