You could make your XPath like this:
//div/h[@innertext='Header 1']/following-sibling:ul/li[@innertext='This is incorrect.']
//div/h[@innertext='Header 2']/following-sibling:ul/li[@innertext='This is incorrect.']
Thank you for the suggestion, krstcs.
This was the solution I was looking for. After recording, I did not take into account that the XPath expression can be made explicit even further. In other words, I modified the paths and made the differentiation on a div group.
Modified original example:
/dom[@domain='my.domain.com']//
div[1]/ul[#'id-4676']/li[@innertext='This is incorrect.']
/dom[@domain='my.domain.com']//
div[2]/ul[#'id-9852']/li[@innertext='This is incorrect.']
Based on both our examples, we can differentiate the elements by property or by element index.
Again, thanks for your help. Your solution works for me
