End If statement on AssertAttribute


I’m trying to use the If…EndIf statement on AssertAttribute “class” of an element.
When the class contains the sentence “ux-card__expand-trigger”, a click on a button should be done.

I stored the attribute class in a variable classValue:

Executing: | storeAttribute | //bifi-home/bifi-modal/ux-modal/div[2]/div/div/div[2]/uxmodalbody/bifi-form/form/ux-card[2]/div/div[2]@class | classValue|

I’m trying the If statement:

Executing: | if | ${classValue}==‘ux-card__expand-trigger ng-star-inserted’ | |
Expand variable ‘${classValue}==‘ux-card__expand-trigger ng-star-inserted’’ into ‘ux-card__expand-trigger ng-star-inserted==‘ux-card__expand-trigger ng-star-inserted’’

But I obtained an error:
[error] SyntaxError: unexpected token: identifier

Could you please help me to do that ? I would prefer to check if the class contains the sentence “'ux-card__expand-trigger” in order to click on the link.

Thanks in advance for your help.

String quotes are missing quotes

‘${classValue}’==‘ux-card__expand-trigger ng-star-inserted’

I prefer to use storeelementpresent to judge whether an element exists. It returns true if it exists, and returns false if it does not exist. You should also put quotation marks in this place, except for numeric characters.