Hello,
While making generic Keywords, I like to use a variable in the locator string.
ANY_TAB_NAME: ul[role=“menu”] >> a[aria-label=“${tab_name}”]
Then , in the keyword, I use an argument to fill-in the variable value in the locator.
But by default that does not work: the locator string will be used as is and not with the actual argument value .
My workaround is to use the kw “Replace Variables” that replaces the variable in the Locator by their actual value from the argument (matching the variable name).
Is that the best way of using a variable in the locator ?