I think a different strategy might be useful rather than trying to
block out sensitive data. When I read this the first thing that came
to mind is why you would require that a users plain text password be
used? There are many security issues to consider there.
When testing with a production account we usually have a staging or
test server set up using a dump of the production database. This
environment is only available to users internal to our network. You
could update the password of the account to something meaningless like
"password" or "plaintext". That way no one will see the actual live
account password in the tests or the test results. If you do that
though, you have to be certain that people logging into the account
won't be a problem. This is only an option if you are set up on a
test / staging server.
It's not often I have to do this though. Usually we stick to test
accounts with fake data that isn't a security concern to anyone.
Setting up a test account or just changing the password to a testing
password seems like the best thing to do here.
-Tom