1

I am using Robot Framework with Playwright library. I am having some issue when clicking on Save/Spara button inside a tbody. Other button is getting clicked just fine but having issue only with this one.

When i use css and text selectors i am getting a console error message after timeout “TimeoutError: locator.click: Timeout 10000ms exceeded.” And when i use absolute xpath i get console error message “Unexpected token “/” while parsing selector”. I also realised that the focus from a previous element was not moving onto this button so i specifically introduced Tab key in my script and now the focus is on Button but its still not getting clicked.

I have tried following locator:

Click xpath=//button[@class="btn btn-success"]

Click button[data-bind=“click: $root.SparaAllaVaccinationer, visible: $root.SparaVaccinationEnabled($data)”] i[class=‘fa fa-2x fa-save’]

Click button[title=“Spara”]

Click //button[contains(@title,‘Spara’)]

Press Keys xpath=//button[@class="btn btn-success"] Enter
When i used Press Keys, before this i had already moved the focus onto this button. But i got same console error.

Here is the element i am trying to click:

<button title="Spara" class="btn btn-success" data-bind="click: $root.SparaAllaVaccinationer, visible: $root.SparaVaccinationEnabled($data)" style="">
                            <i class="fa fa-2x fa-save"></i><br><span class="small">Spara</span>
                        </button>

Has anyone faced similar issue ?

1

1 Answer 1

1

I got it resolved by using:

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.