If the x element is not visible, the y button should be clicked. If the x element is visible, the y button should not be clicked and it should be in the loop. And if the text creating appears, it should exit the loop. How can I do this? I couldn't do it for 2 hours.