Make sure that the input element is visible on the screen.
You should not click on the browse button, as it will trigger the OS dialogue box and effectively stop the test execution.
You can use the below code:
UploadFile is the Id of the element (i.e. button) and in sendKeys specify the path of the file that is to be uploaded.