How to automate the Text heading comes after another heading

I want to verify a heading comes after another heading in a page. Can anyone help to know how i can do this in Katalon?
@Russ_Thomas

Depends what you mean by “after” which has no formal definition I am aware of in Web Documents.

  1. Are element A and element B siblings?
  2. Are their parents or ancestors siblings?
  3. Is element B a descendant of A?

Because you used the term “heading” I would hope that the page uses workable/meaningful semantic markup and that the headings fit with #1 and/or #2 – in which case, an assertion based on a CSS nth-child selector might be the way to go.

But all this does is tell you about a notional “order” within the DOM. It’s entirely possible that the B element is defined “earlier” yet appears “after” element A (via CSS/JavaScript) when viewed by the user.