How the Test is PerformedA sample is taken during a procedure called an esophagogastroduodenoscopy (EGD).How to Prepare for the TestDo not eat or drink anything for 12 hours before the test.How the Test will FeelYou may feel like you have to gag as the tube is passed, but the procedure is usually not painful.