Hi,
> It looks like your getElementById("username") isn't working
Agree.
> when I run the script it says Cannot setAttribute of null.
This message means that object that is expected to have setAttribute() method does not exist.
Considering the provided code sample, this means that
> var ele = engine.getDocument().getElementById("username");
engine.getDocument().getElementById("username") did not find the sought for object and thus ele variable was set to null.
P.S. Assuming that provided id was spelled correctly, it might appear to be a timing issue.
Possible code modification for quick check of this idea:
function test() {
var engine = address.getEngine();
var doc = engine.getDocument();
aqUtils.Delay(5000); // huge delay to let page be rendered
var ele = doc.getElementById("username");
if (!ele)
Log.Warning('"username" element was not found);
else
ele.setAttribute( "value", "abc");
}