I am running this script to test my websites' login handling capabilites:
WebBrowser wb = new WebBrowser();
string url = "mywebsites url";
wb.Url = new Uri(url);
wb.Document.GetElementById("username").SetAttribute("value", userName[0]);
Ive done a simmilar thing for the password and the submit. So the problem is that i get a warning saying NullReferenceException was unhandeled on this line:
wb.Document.GetElementById("username").SetAttribute("value", userName[0]);
despite having the url defined with the line above that one. Is there another reason other then the URL that i might have a nullreference error?
And how do i solve this? is there a better way of making a bot to test login capabilities of a web app?