1

This code gets me to the page and fills in the userid and password fields but after it does the submit I get a response from the application that the userid and password are not valid. If I don't execute the submit command but let the program stop at the page then manually click the login button then I successfully login. It appears eventhough the userid and paasword are being filled in correctly on the form, they are not getting passed through to the next page properly.

Any thoughts? I'm a VBsript newbie.

Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
IE.Visible = True
IE.Navigate "https://cpprod.stjohns.edu/cp/home/displaylogin"
Do
    WScript.Sleep 500
loop While IE.ReadyState < 4 And IE.Busy 
IE.Document.getElementByID("user").value = "testacct"
WScript.Echo IE.Document.getElementByID("user").value
IE.Document.getElementByID("pass").value = "testpw"
WScript.Echo IE.Document.getElementByID("pass").value
IE.Document.getElementByID("cplogin").submit
1
  • I am assuming you are aware that the credentials you have their are invalid. Commented Oct 28, 2013 at 18:00

1 Answer 1

1

Give the below a try and let me know your results...

Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True
oIE.navigate WebPath

Do
    WScript.Sleep 250
Loop While oIE.ReadyState < 4 And oIE.Busy

oIE.Document.All.Item("username").Value = sUser
WScript.Sleep 250
oIE.Document.All.Item("password").Value = sPass
WScript.Sleep 250
oIE.Document.All.Item("login").Click
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.