|
-
Sep 9th, 2012, 12:21 PM
#1
Thread Starter
New Member
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
-
Sep 9th, 2012, 05:09 PM
#2
Re: Cannot InvokeMember on HTML Page
WB1.Document.GetElementById("loginButton").InvokeMember("click")
Works perfectly for me. Are you sure that the page is fully loaded when you run the invoke?
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Sep 10th, 2012, 09:04 AM
#3
Thread Starter
New Member
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
-
Sep 10th, 2012, 11:52 AM
#4
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
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|