I am using Robot Framework with Playwright library and using Python language. There is an issue when trying to click on a button. All other buttons are getting clicked just fine except one. Its always getting timeout when i use the css or text selectors with console message “TimeoutError: locator.click: Timeout 10000ms exceeded.”
And when i use xpath i am i getting console message “Unexpected token “/” while parsing selector”. I have also tried introducing sleep statements but it didn’t work.
Focus moved onto button which script needs to click.
Focus //button[contains(@title,‘Spara’)]
Sleep 15s
Press Keys //button[contains(@title,‘Spara’)] Enter
I can see clearly that focus is on the button but its not getting clicked.
But still no success. Same Error message in console : TimeoutError: locator.press: Timeout 10000ms exceeded.
=========================== logs ===========================
waiting for selector “//button[contains(@title,‘Spara’)]”
Press Keys xpath=//button[@class=“btn btn-success” and contains(text(),‘Spara’)] Enter
But i would really appreciate if someone can explain why it was not working with simple Click action with class in xpath
Click xpath=//button[@class=“btn btn-success”]
OR
Press Keys xpath=//button[@class=“btn btn-success”] Enter
I would suggest execute your script with headless=false and add sleep time of approx 15 seconds before the click of button. Now when the script waits have a look on UI what happens. There could be few things you can try: