I've bought basses online. Sometimes I will have tried them via friends etc, but I'm not low enough to try one in a shop and buy online. If I've gone as far as trying one in a shop and decide to buy it then I'd buy it from that shop.
Sometimes I don't try them. Whatever happens I'm going to buy certain - to me - iconic basses, Hofner Violin, Epiphone EB3, Steinberger, etc, whether I've played them beforehand or not.
Sometimes I build them from parts sourced online. I built my Jazz that way, and I'm currently building a Precision with gold hardware that way.