I’m testing a page where 2 tabs have visually identical warning banners. In the test, I click the first tab, verify that the banner is visible, then I click the second tab and again verify the banner. Then, the second visibility check fails. Upon inspecting the lines, I see that the visibility check happens on the same object, referenced through the first tab. My understanding of the situation is that the recorder notices the similarity and assumes the banners are one and the same, but actually they’re copies on different tabs. Now, how do I make it realize these banners are actually different objects?
Katalon (and, indeed, most UI testing software) use locators (CSS, XPath) to find the elements under test. The Record Web feature should be viewed as a “get me started” tool - it’s certainly not infallible.
Check your locators/selectors. Make sure they differ in accordance with the live elements on the screen.
To advise any further, I’ll need to see your locators and the HTML that generates the tabs.
Read this - there’s some good advice about the kind of thing we expect to see:
As I already mentioned, the selectors aren’t only identical, but in fact both checks are even executed against the same repository object. My question was primarily how to change that, and preferably change it consistently - this sort of thing seems likely to happen more than once, and manually performing complex operations on the object repository every time would most probably not be practicable.
I know what you mentioned.
and I explained why I suspect that is happening.
Maybe, maybe not. I never use the Object Repository.
You have TWO choices:
If you want to learn how to get past the problem, follow my advice above.
If you want to decry the inefficiencies of a particular tool, carry on. I, however, will move on.
Sorry, I misread your question. I thought you were referring to the locators Katalon uses, but over night I realized you meant their XPath positions in the actual document. I’ll try to investigate with the team members who wrote that code and/or worked with it more often.
On a related note, there’s additional text on the banners, and they probably use the same localization keys, which might be what confuses Katalon. Either way, it’s important to me to avoid having to manually edit tests on a regular basis, because that’s one of the main pain points with Selenium because of which I was tasked to evaluate alternatives.