GeckoFx getElementByID() click() Method Missing
In an application that i am creating using Gecko FX version 15, I noticed that getElementsByTagName() has an invoke member click() as shown below:
But missing in getElementByID(). After experimenting for a few hours, I came up with the solution below:
The trick was to cast it as GeckoHtmlElement.
Greg
this.Document.GetElementsByTagName(geckoElement.TagName)[indexSearchElement].Click();
((GeckoHtmlElement)this.Document.GetElementById(elemId)).Click();
Greg
tnx.
ReplyDeletesolved my problem
Great it helped you.. :)
DeleteThanx! it helped me too!
ReplyDeleteGlad I could help.. :)
DeleteFor Each curElement As GeckoElement In theElementCollection
ReplyDeleteIf curElement.GetAttribute("name").Equals("signIn") Then
curElement.InvokeMember("click") <= this doesn't not work
End If
Next
help me,,,,,
Hi,
DeleteWhen using GetElementById() make sure that you are referencing the ID itself and not looping through the controlls collection. :)