Cannot InvokeMember on HTML Page
I have a VB Net application that I have been running for over a year to login to a specific website
Heritage Coins & Currency
The page I'm now unable to loging is --> https://coins.ha.com/c/login.zx
I am setting the text boxes as follows:
WB1.Document.All("emailAddress").SetAttribute("Value", "sge")
WB1.Document.All("password").SetAttribute("Value", "7476")
Even though these values do actually display on the screen when I do GetAttribute I see that I have set the values.
?WB1.Document.All("emailAddress").getAttribute("Value")
"sge"
?WB1.Document.All("password").getAttribute("Value")
"7476"
When i do InvokeMember as follows NOTHING HAPPENS and I receive no msgs
WB1.Document.GetElementById("loginButton").InvokeMember("click")
The HTML code smippet is:
<input id="loginButton" name="loginButton" value="Sign-In" type="submit" tabindex="3">
<input name="source" type="hidden" value="" />
<input name="forceLogin" type="hidden" value="" />
<input name="loginAction" value="log-in" type="hidden">
I am an inexperienced Net programmer and I do not have a clue how to resolve
thanks
sandy
Re: Cannot InvokeMember on HTML Page
Quote:
WB1.Document.GetElementById("loginButton").InvokeMember("click")
Works perfectly for me. Are you sure that the page is fully loaded when you run the invoke?
Re: Cannot InvokeMember on HTML Page
Yes the page is fully loaded.
Are you going to the next page where just below the picture at the top to the right of center
it should say "Welcome Sandy (Sign-Out)" This is what I am expecting.
I get Welcome xxxx (Sign-In) which indicates the Login did not work
Re: Cannot InvokeMember on HTML Page
Seems like it takes a hammer to crack this nut. This is the only reliable method I could find ....
vb.net Code:
Private Sub Whatever()
'whatever you do to make sure the page is fully loaded
Go()
Timer1.Start() 'tick 2000 possibly adjustable
End Sub
Private Sub Go()
SendKeys.Send("sge") ' seems brute force and ignorance is needed!
SendKeys.Send(Chr(9))
SendKeys.Send("7476")
SendKeys.Send(Chr(9))
WB1.Document.GetElementById("loginButton").InvokeMember("click") 'first time confirms
End Sub
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
Timer1.Stop()
Go() 'second time's the charm
End Sub