Can click button at one point, but not at the other

I am currently trying to integrate Katalon Web Tests in our Angular based application.
We would like to make use of the Katalon Recorder to increase time of building those tests.

Though we are experiencing some problems, many of which have been resolved by the recent update to Katalon 7.0.

But something still makes this hard:

In one test case an item is created in an popup by giving it a name and clicking ‘save’. Afterwards the item is edited and in a popup of the same structure renamed. Now when it should click ‘save’ again it fails to find that element (it times out, even though it is loaded and visible). Though by inspecting it, it is literally the same button as before. I even tried changing the selection etc. It even highlights it when I click in the ‘Captured Objects’ area on the ‘Verify and Highlight’ button. But I believe Selenium is being Selenium…

I even changed the selection from XPath to just span or button with text ‘save’. Still only clicked the first time, when added, not the second time, when editing.

Testing in Chrome btw.

Here’s the error:

ERROR c.k.k.core.keyword.internal.KeywordMain - :x: Unable to click on object ‘Object Repository/Page_Censored - Settings Customer/span_Save’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to click on object ‘Object Repository/Page_Censored - Settings Customer/span_Save’

Caused by: org.openqa.selenium.TimeoutException: Expected condition failed: waiting for element to be clickable: [[ExistingRemoteWebDriver: on ANY (ebf1b63192d134fd477d5b749e07a295)] → xpath: //span[(text() = ‘save’ or . = ‘save’)]] (tried for 30 second(s) with 500 milliseconds interval)

Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to click on object ‘Object Repository/Page_Censored - Settings Customer/span_Save’

Caused by: org.openqa.selenium.TimeoutException: Expected condition failed: waiting for element to be clickable: [[ExistingRemoteWebDriver: on ANY (ebf1b63192d134fd477d5b749e07a295)] → xpath: //span[(text() = ‘save’ or . = ‘save’)]] (tried for 30 second(s) with 500 milliseconds interval)

I think we’re going to need to see the HTML and a couple of screenshots of the popup/page.

Please read about the DevTools Inspector to help you post a screenshot of the popup HTML.

And follow this advice when posting awkward errors like this.

1 Like

Hi @mikis-woehrmann

If you can, then please post the html during the first and the second click also. Visibility doesn’t always mean that it’s clickable, which is a very important distinction in cases like this.

I think you are using a desktop version of Katalon is old and needs to be updated. It can happen at times when you trying to build a project with the application as well. We have developed essay writing help and at that time, the same error showed up. I updated the application and it started execution without any core errors.

Could you elaborate that? Because I am currently using the latest version of Katalon Studio (7.0.4 and it says I am up to date).

EDIT:
I have found the problem, thanks for the HTML hints!

The problem is as follows (due to limited rights, I can not post original html source):

I’ve got two similiar modals for creating and editing next to each other, just like this:

<app-modal>
    <title>Create</title>
    <buttons>
        <abort-button>abort</abort-button>
        <save-button>save</save-button>
    </buttons>
</app-modal>
<app-modal>
   <title>Edit</title>
    <buttons>
        <abort-button>abort</abort-button>
        <save-button>save</save-button>
    </buttons>
</app-modal>

When recording, the first save button is added to the object model that Katalon manages. The problem is that, when I am clicking on the save button in the edit modal, it does not add a new item to the object model. The recorder seems to believe it is the same item. When I am manually setting the full XPath to both save buttons, it is able to execute the test and click both buttons. So the reason for not finding the second save button in the first place is that it is actually looking for the save button in the create modal that is currently not visible.

My follow up question: Is there a way to force the recorder to try to look broader into the tree to identify the objects? We have this kind of stuff a lot in our application and doing all this manually would be a pain in the a**. Also full hard XPaths are not very robust…

Any advice is very welcome!

EDIT 2:

I have been using the Katalon Recorder from within Katalon Studio so far. Now I have used the Chrome Addon and there executing the test after recording worked instantly. But this way I don’t have the object model repositories and I don’t really get how to import those recording to back to Katalon Studio. Though I am investigating further…