Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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: kfgwkgb@wkefhwk.com 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

share|improve this question
    
Yes, it could. What is your purpose? –  Undo Jun 2 '13 at 22:55
1  
I don't understand why this question has multiple down votes with no explanation as to why. –  TJ Luoma Jun 3 '13 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 '13 at 5:21
    
Why would you do this on an intranet ? –  Nicolas Barbulesco Jun 5 at 20:30

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.