During the upper GI endoscopy, the doctor may. 1  take small samples of tissue, cells, or fluid in your upper GI tract for testing. 2  stop any bleeding. 3  perform other procedures, such as opening up strictures.