Gastric ulcers are diagnosed through several methods: - Endoscopy: A flexible tube with a camera is inserted through the mouth to visualize the stomach lining. - Barium swallow: A special liquid is ingested, and X-rays are taken to observe the stomach and small intestines. - Tests for H. pylori: These can include blood, stool, or breath tests to detect the presence of the bacterium.