1

I need to find a way to log into a company intranet site multiple times in quick succession on OS X 10.8.2, each time with a new completely random user ID and email address. The website only requires the UID field to be filled out with unique text and to have the email address field populated with anything as long as it ends with .com (i.e. UN: jegfwkgfb email: [email protected] PW: password). NB The password field can be filled out with the same password each time.

It needs to be a little script that I can run manually whenever needed as I need to log in multiple times quickly.

So in summary it needs to:

  • Visit the site
  • Populate UN, PW and email fields (with a different, random UN & email each time)
  • Hit enter to complete the login

I was hoping this could be accomplished in Automator and / or Applescript?

Thanks in advance guys

4
  • Yes, it could. What is your purpose?
    – user44427
    Jun 2, 2013 at 22:55
  • 2
    I don't understand why this question has multiple down votes with no explanation as to why.
    – TJ Luoma
    Jun 3, 2013 at 4:36
  • @Undo LOL, TJ Luoma, it is a valid question, however as the site is community moderated, the down votes would suggest that the community does not approve. Anyway my comment should probably be in meta.
    – Deesbek
    Oct 15, 2013 at 5:21
  • Why would you do this on an intranet ? Jun 5, 2014 at 20:30

1 Answer 1

3

Try running a script like this in AppleScript Editor:

do shell script "jot -r -c 24 a z | rs -g 0 8"
tell result to set {user, mail} to {paragraph 1, paragraph 2 & "@" & paragraph 3 & ".com"}

open location "https://accounts.google.com/ServiceLogin"
delay 1
tell application "Safari" to tell document 1
    do JavaScript "document.getElementById('Email').value = '" & mail & "'
    document.getElementById('Passwd').value = 'password'
    document.querySelectorAll('#gaia_loginform input[type=submit]')[0].click()"
end tell

For Chrome, replace document 1 with active tab of window 1 and do JavaScript with execute javascript.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .