You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Jotohanes so, the problem is that .mscom-link.c-call-to-action.c-glyph element is link itself with necessary text. When we add context in click, then the flow is:
Recieve all elements context and get first of them.
Get first inner element with text, using these locators:
let narrowLocator = xpathLocator.combine([
`.//a[normalize-space(.)=${literal}]`,
`.//button[normalize-space(.)=${literal}]`,
`.//a/img[normalize-space(@alt)=${literal}]/ancestor::a`,
`.//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][normalize-space(@value)=${literal}]`
]);
or
let wideLocator = xpathLocator.combine([
`.//a[./@href][((contains(normalize-space(string(.)), ${literal})) or .//img[contains(./@alt, ${literal})])]`,
`.//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][contains(./@value, ${literal})]`,
`.//input[./@type = 'image'][contains(./@alt, ${literal})]`,
`.//button[contains(normalize-space(string(.)), ${literal})]`,
`.//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][./@name = ${literal}]`,
`.//button[./@name = ${literal}]`
]);
So, when you set .mscom-link.c-call-to-action.c-glyph element, there is no inner elements. because of this we can't find elements with necessary text
I fixed this issue, but we need @DavertMik review to merge it
What are you trying to achieve?
I would like to click certain text in particular locator.
What do you get instead?
Clickable element JETZT KAUFEN inside .mscom-link.c-call-to-action.c-glyph was not found by text|CSS|XPath
I am pretty sure it was not the case on previous version of codeceptjs since I got this error recently after I update my codeceptjs.
Details
The text was updated successfully, but these errors were encountered: