If you are getting the error on this line:
pwd.value = "abcdef";
Then
pwd
has to be null. So look at where it is set - in teh line above in this case:
HTMLInputElement pwd = (HTMLInputElement)doc.all.item("Passwd-hidden", 0);
pwd.value = "abcdef";
So clearly
doc.all.item
is returning
null
, which almost certainly means it can't find a matching item called "Passwd-hidden".
So check the page data, and find out what it is called!