I want to automate my testing with Katalon and to find my test objects I use XPath (standard in Katalon).
My Problem is, that for example my close button is used in multiple positions across my website. That means, that I need to detect the object using different Xpaths. Thats were my problem lies. How do I do that?
I have the following paths available for my button:
xpath:attributes (//button[@type='button'])[7] xpath:idRelative //div[@id='app']/div[3]/div/div/div/div/div/div/div/div/div[3]/div/button xpath:neighbor (.//*[normalize-space(text()) and normalize-space(.)='Sag uns deine Meinung']). [1]/following::button[1] xpath:neighbor (.//*[normalize-space(text()) and normalize-space(.)='Hilf uns, besser zu werden!'])[1]/following::button[1] xpath:position //div[3]/div/button xpath:customAttributes //button[@type = 'button' and (text() = 'close' or . = 'close')] xpath:attributes (//button[@type='button'])[6]
And I tried for example:
(//button[@type='button'])[7] | (//button[@type='button'])[6] (//button[@type='button'])[7] or (//button[@type='button'])[6]
But these don’t work, the error is following:
Caused by: com.kms.katalon.core.exception.StepFailedException: Object 'Object Repository/my/Page_App/button_close' is NOT visible