Upper endoscopy helps your doctor evaluate symptoms of persistent upper abdominal pain, nausea, vomiting or difficulty swallowing. It's the best test for isolating the cause of bleeding from the upper gastrointestinal tract. It's also more accurate than X-ray films for detecting inflammation, ulcers and tumors of the esophagus, stomach and duodenum.