You can certainly test a lot of bikes, which is fun and will give you a good idea of what fits....
But you'll still need an LBS's help in getting the right frame size.
Most bike stores sell their bikes with the longest stem possible and the maximum amount of headset spacers. This can give you the impression that a frame that is in reality too small, is the right size for you.... or maybe a frame that's the right size will feel too large, but once you get rid of the spacers and shorten the stem, it'll be ok.
I've heard of guys 6' riding medium frames comfortably, and 5'10 guys on large frames. It depends on your actual arm/leg length, not just strictly your height.