Selection Specifications (first-of-type, nth-child) Not Working

Hi Kenneth,

An easier approach might be to use Get Elements with ${TOAST_BODY} and then for item in the list you got from Get Elements, something like this:

Verify Toastify Message Appears
    [Arguments]     ${text}
    ${alerts}=     Get Elements     ${TOAST_BODY}
    ${found}=     Set Variable     False
    FOR     ${alert}     IN     @{alerts}
        ${toast_text}=     Get Text     ${alert}
        Run Keyword If     ‘${text}’ in ‘${toast_text}’
        … Set Variable ${found}     True
    END
    IF ${found}
        Toastify message with text “${text}” WAS found
    ELSE
        Toastify message with text “${text}” WAS NOT found    
    END

Dave.

3 Likes