Gastroscopy to detect H. pylori can be affected by medications, such as taking antibiotics, bismuth, and other drugs. Gastroscopy can detect the presence of H. pylori infection by performing a rapid urease test on a biopsy site. However, it is an invasive test compared to the breath test and may be taken at an uninfected site, resulting in a false-negative result and reduced accuracy. In addition, if antibiotics, acid suppressants, bismuth, and other medications have been taken recently, they may affect the activity of H. pylori, causing bias in the results, which in turn reduces the accuracy rate. If patients want to undergo H. pylori testing, it is recommended that they go to a regular hospital and under the guidance of a professional doctor, so as not to affect the test results.