My recommendation is to get several quotes for the car you want to buy before you head to the dealer. If you can provide insurers with the car’s vehicle identification number [VIN], even better—you’ll get more accurate quotes. Be sure to keep the quote details for your reference.
When you get to the dealership, call the insurer of your choice with your quote details and buy the insurance there and then.