Group b strep

When do you get tested for gbs? During labor at the hospital or before? & do all babies get tested for gbs?