By the way, the difference between this and your original solution, is that this will only return two specific expected elements, and contains logic to prefer desktop over mobile. Your original approach would click the first visible element matching a more general locator, meaning it could potentially match more than these two elements, and we wouldn't be certain which one was clicked.