Could you elaborate on what you want to test? The server or the client? Couldn't you test them seperately?
I would avoid an interactive test like the devil. Fake the server locally. Then you a) know the password already and b) don't test the internet connection as well.
Comment on Re: Interactive prompts inside a test harness