Is it possible to make locators dynamic in XCUITest? generally when defining a locator we tend to write as: let optionAbutton = app.buttons["option-a"]
And use it in func as optionAbutton.tap();
Now, if there are more buttons on the page like: option-b, option-c should we have separate locators for each like: let optionBbutton = app.buttons["option-b"] let optionCbutton = app.buttons["option-c"]
Or is it possible to keep the locator generic like app.buttons["PLACEHOLDER"] and replace it with option-a, option-b or option-c inside the func?