Its possible, but requires very good communication between developers and QA, and often a technical understanding of how the solution is to be implemented.
For example, if you are working on a login page, and underlying authentication HTTP endpoint, you can start writing test automation for the endpoint before any work is done.
This service would likely have tests to check that a valid request is granted a session token, and that invalid requests get a HTTP 401 response, etc. the service doesn't need to exist to start writing the tests, you just need to know the outline of the functionality and a decent enough idea of how it will do this.
You could also start writing the page object model for the login page if you have a decent idea of what functionality it should provide.. e.g it may likely have the following methods (this functionality would be decided upon and formalised during sprint planning):
- Login(string username, string password)
- ForgotPassword(string username, string email)
The login page would likely have the following private fields:
- private WebElement LoginTextbox
- private WebElement PasswordTextbox
- private WebElement ForgottenPasswordButton
You do need to stay wary of how likely various parts of this are to change, and dont waste time developing against something which will end up being completely different to what you have written tests against.