The problem that I can think of are as follows:-
1. you are not using the correct locator to locate the web-element.
2. your element is not displayed yet and you are trying to work on it.
The second one is more common and can be the reason for you getting the error. Try using wait before working with the element.