Presented here is the protocol for an in situ chemotaxis assay, a recently developed microfluidic device that enables studies of microbial behavior directly in the environment.