Thursday, October 25, 2018

Debugging Errors - Trailing Whitespace in Properties file

Problem

Well, I know this seems minor, but when you're using Properties file to maintain a list of usernames/passwords for a Test Script that tests logging in as each user (because a specific user role is associated to these demo users), then this is a good way to maintain testing of the application's login.

So, long story short, one of users would crash the browser by hanging up the login page when attempting to login.

Solution

Long story short, I had one whitespace char trailing the username. So instead of the username being "user1", it was "user1 ". This whitespace char was not caught and handled well in the application which is now fixed, but this took a lot of time to debug. Unnecessarily.

Be sure that your Properties file has the property value as expected. Use a text editor displaying all characters in file, if need be.

Cheerios!

No comments:

Post a Comment