Depends on the age of the patient. You gotta use these 3 rules
1. For example if you have a 55 year old presenting with new onset peptic ulcer disease you have to start with an endoscopy.. Why? because the odds of gastric cancer are just to high to play with them.
2. Look for "warning symptoms" these are¨: New onset dysphagia, Anemia, Guiac positive, Weight loss, Night sweats. If the patient has this then you start with endoscopy regardless of age.
3. If the patient is young, less than 45 years old and overall seems fine then you go directly with H.pylori testing.
It also depends on what the question is asking and the options provided, most of the time you just dont go and treat H.pylori because the most common cause of PUD-like symptoms is NON ulcer dyspepsia, you cant assume the patient has an ulcer or an active H.pylori infection without endoscopy and h.pylori tests.
You dont treat every patient with a serology positive for H.pylori because 1/3rd of the worlds population is colonized by H.pylori and you dont want to increase resistance or risk it for that matter.