During an endoscopy, your doctor might also:
Do a test called a biopsy—During a biopsy, a doctor takes a small piece of tissue from the lining of the digestive tract. (You will not feel this.) Then he or she looks at the tissue under a microscope.
Treat problems that he or she sees—For example, a doctor can stop bleeding or sometimes remove a growth. He or she can also widen any narrow areas of the esophagus. Narrow areas of the esophagus can cause trouble swallowing.