If you have a guitar teacher or friend who plays electric a lot (not just a school kid who can manage 'Stairway to Heaven'), take them with you. Two sets of eyes are better than one.
You're going to need an amp, tuner and a cable as well. You may find a bundle deal that throws everything in for you. Test every guitar through the same amp, and don't have the distortion or reverb switched on all the time - you want to hear the guitar.
When testing the guitar, play every string at every fret (even the dusty ones above 12th fret). You're not playing a tune, you're looking for buzzes. If you get any, look for another guitar, or (if you really like the guitar) get the store tech to fix the problem for free.
Check that the neck is straight. The guitar tech in the store will be able to test that for you, but looking down the fingerboard will reveal any major problems.
Make sure there are no crackles when you use any rotary controls on the guitar.
Look for a low action. Action is generally a preference thing, but a lower action will be easier on fingers. Electrics are usually lower action and lighter strings than acoustics.
Check that there are no missing screws on the scratchplate, bridge, tuners, back of the guitar, etc. A missing screw indicates that someone has messed with the guitar badly (a decent tech won't lose a screw...)
Check that the tuners are smooth and not loose.
Buy a new set of strings (or negotiate them into the deal) with the guitar; you don't know how long the ones on it have been there, and good strings make a decent guitar sing.
Don't go over budget. Consider used guitars (always try for a deep discount), and accept that after a year playing electric, you'll probably feel the need to upgrade.