To begin with, the doctor will examine the patient to check for any tenderness in the upper abdomen. Other tests are then carried out to rule out other conditions such as stomach cancer and to confirm the diagnosis of gastric or duodenal ulcer.
An internal view can be obtained either by X-ray or by endoscopy. A barium swallow may be carried out, whereby the patient drinks a watery paste of barium, which coats the lining of the stomach and duodenum. The barium shows up white on X-rays, enabling the doctor to see the outline of these areas and any ulcers or other abnormalities.
The doctor will also usually want to carry out a gastroscopy, where a long, thin, fibre-optic cable (an endoscope) is passed into the stomach and duodenum through the mouth. This enables the doctor to see the lining (and any ulcers) clearly. If any ulcers are found, a biopsy (a sample of the lining) may be taken using an instrument that is passed down through the tube. This sample is then analysed for H. pylori infection and to check whether cancer is present.
H. pylori may also be tested using a breath test, faecal test or blood test. The breath test involves drinking a harmless substance that is broken down by the bacteria to produce a gas that can be detected with a breathalyser. The faecal and blood tests use a small amount of these materials to check if the body is producing antibodies to H. pylori.