I have set my Safari homepage to a url that has a username and password form. My script should open Safari and set the username to a value. The script opens safari, the homepage is displayed, but no text added to input box.
tell application "Safari"
activate
tell window 1
delay 3
do JavaScript "document.getElementById('username').value = 'hello';"
end tell
end tell
<input type="text" name="username" id="username" size="20" style="width: 150px;">
Can anyone suggest why?