Sign in to follow this  
Followers 0
jpadilla128

Auto Login to A Web Page

4 posts in this topic

Hello all,

I'm new to the tool so be easy on me. Can anyone help me out with my script where a scheduled job(running as System) will launch my AutoIt script (compiled as an .exe) to automatically login to a web page so that I can pre cache the web content for the user I am running it as? I am using the RunAs function to open a browser and then using keystrokes to log me in. Am I using the correct approach here?

When looking at task manager, I can see that the "elearning" user is successfully launching IE but I am not seeing the browser cache getting populated in ..\local settings\temporary internet files\etc. etc.

Here is the script:

; Launch the browser in context of the user

Local $sUserName = "user"

Local $sPassword = "password"

Local $sDomain = "domain"

RunAs($sUserName, $sDomain, $sPassword, 1, "C:\Program Files\Internet Explorer\iexplore.exe http://www.webpage.com")

; Wait for the browser to become active

WinWaitActive("SumTotal - Log On")

Sleep(10000)

; Enter login credentials

Sleep(500)

Send("username{TAB}")

Send("password{ENTER}")

Sleep(10000)

; Close the browser

Send("!f")

Send("x")

Share this post


Link to post
Share on other sites



You didn't see that cache because it is downloaded to the temporary folder of the user $sUserName (since you logon under that name, that's what RunAs is for)

\Documents & Settings\[username of the user who use internet]\temporary internet files...

But it's not a good way to interact with IE with Send and Sleep.

The best way is to create an IE object within a GUI to fully control all the elements on that website.

Share this post


Link to post
Share on other sites

Yes I understand that. When I logoff my acccount and login as the account being called by the RunAs function, I don't see the cached content.

Just to be clear, what I am attempting to do is create a scheduled job that will run in the background that will login at X intervals as a different user to login to a web page.

Share this post


Link to post
Share on other sites

Cache has to be written somewhere. It doesn't just simply vanish.

With FireFox, try to enter a page, on the address bar, enter about:cache, it will show you where your cache is located

Sometime cache is stored in file *.cache, *.tmp and you didn't notice it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0