ERCP is a combination of two tests: an endoscopy and an X-ray. An endoscopy is a procedure in which a thin, flexible tube attached to a tiny camera is threaded down to your gastrointestinal (GI) tract. Your GI tract consists of your esophagus, stomach, and intestines.