>>>A script that will :
1) open a https://xyz.com/login page
2) provide user name and password information
3) check whether the authentication was successful or not or the web page is opening up
4) store the results got in step 3) in a log file
'----------------------script starts-----------------------------------------------------
'1)
DIM oIE
Set oIE = CreateObject("InternetExplorer.Application")
oIE.navigate "https://xyz.com/login"
oIE.Visible = True
n = 0
Do while oIE.Busy or n = 101
n = n + 1
WSH.Sleep 50
Loop
if n = 101 then wsh.echo "ERROR" : wsh.quit 1
'2)
Set UID = oIE.document.all.IDToken1
UID.value = "theUserID"
Set PWD = oIE.document.all.IDToken2
PWD.value = "thePassword"
oIE.document.all.btnSubmit.click
'3)
sLocation = "*ERROR*"
n = 0
Do until oIE.document.ReadyState = "complete" or n=100
n=n+1
WSH.Sleep 50
Loop
sLocation = lcase(unescape(oIE.document.location))
set oLogfile = CreateObject("scripting.filesystemobject").opentextfile("d:\someplace\logfile.txt", 8, true)
if not sLocation = "https://xyz.com/the/expected/destination_page.ext" then
oLogfile.writeline "Login failed"
else
'4)
oLogfile.writeline "You made it to " & sLocation
end if
'----------------------script ends-------------------------------------------------------
>>>Save the above script in a txt file and save as "xxxx.vbs" (double click to execute the file).
You need to change the url and designations for the elements IDToken1 (the user ID control), IDToken2 (password control) and the submit button (btnSubmit). I am certain they will be different than those I used in my example. Open the source (right click and click 'View Source') for the target login page and search for the correct controls.
Now you can include this script file to startup menu or scheduler to login to your website as needed.
1) open a https://xyz.com/login page
2) provide user name and password information
3) check whether the authentication was successful or not or the web page is opening up
4) store the results got in step 3) in a log file
'----------------------script starts-----------------------------------------------------
'1)
DIM oIE
Set oIE = CreateObject("InternetExplorer.Application")
oIE.navigate "https://xyz.com/login"
oIE.Visible = True
n = 0
Do while oIE.Busy or n = 101
n = n + 1
WSH.Sleep 50
Loop
if n = 101 then wsh.echo "ERROR" : wsh.quit 1
'2)
Set UID = oIE.document.all.IDToken1
UID.value = "theUserID"
Set PWD = oIE.document.all.IDToken2
PWD.value = "thePassword"
oIE.document.all.btnSubmit.click
'3)
sLocation = "*ERROR*"
n = 0
Do until oIE.document.ReadyState = "complete" or n=100
n=n+1
WSH.Sleep 50
Loop
sLocation = lcase(unescape(oIE.document.location))
set oLogfile = CreateObject("scripting.filesystemobject").opentextfile("d:\someplace\logfile.txt", 8, true)
if not sLocation = "https://xyz.com/the/expected/destination_page.ext" then
oLogfile.writeline "Login failed"
else
'4)
oLogfile.writeline "You made it to " & sLocation
end if
'----------------------script ends-------------------------------------------------------
>>>Save the above script in a txt file and save as "xxxx.vbs" (double click to execute the file).
You need to change the url and designations for the elements IDToken1 (the user ID control), IDToken2 (password control) and the submit button (btnSubmit). I am certain they will be different than those I used in my example. Open the source (right click and click 'View Source') for the target login page and search for the correct controls.
Now you can include this script file to startup menu or scheduler to login to your website as needed.