I have written a small application that needs to log in to a website to perform some actions.
The problem is that whenever I try to set the password field on the website it doesn’t accept the password.
I have found a way around this by using the SendKeys function. The problem with that is that it requires focus and the program requires to run in the background.
Is there a way to do this?
Here is an example of how you’d set the Username Field:
WebBrowser.Document.GetElementById("field-username").SetAttribute("value", "UserName")
Any help would be great.
The answer to this question is as follows:
By changing the “maxlength” value it allows you to set the “value” to the desired text and then you can submit the Form and it will accept it.