Unable to click on object trash bin icon

That’s your problem - Katalon can’t find that object.

  1. Your xpath looks overly complicated.
  2. Check it works using the browser tools.

eee
or this
eee1

What do you mean? May i use ispector?

Those are the objects. I mean the properties.
But from seeing Russ his post, it looks like you use Xpaths?

I’m not that strong with xpaths but in my experience it is easier to define things with attributes.
You inspect the web element and define the Object by the element… Here is an example from 1 of mine.

Bottom line is. Katalon can’t click on the object because it can’t find it. So it’s not defined correctly.

Mmm, i’ll try this way

Kind of. There’s a post here somewhere by @Brandon_Hein that explains using DevTools to verify XPaths but I can’t find it. I thought is was a Tips&Tricks article, but apparently not.

How can I define my object using the attributes?

All I have to do is to save the new object ?

Well, what you should do is inspect the trash icon with the inspector.
There you have the elements… From there you pick the unique one(s) and put it in the attribute (as shown in your screenshot) and turn it on with the checkbox on the right.

you have the “data-id-indirizzo”, do you know if that is an unique number to only the trash bin?
If yes, then only that one will be enough to define your Object.

eee3
No. It seems to be not the only number to define the Object …
I think that the trash bin icon is not unique because when you remove the address, the form which contains the address and the bin icon disappears, and reappers when you insert a new address.

Oke, try to do it like this.
I got the example from facebook.com

Inspect the trashbin (in this example I inspected the password).
image
This is the html code. I see that it uses an ID = “pass”
So I will use this ID in my object.


Nothing more, nothing less is needed.

Now I can use this object which is the “Password” section on the facebook page.
image

I think it should still work. As long as the button is present on the page and correctly defined in the Object you are using. Katalon should be able to click on it.

em class=“fa fa-trash delete_address pull-right” data-id-indirizzo=“15091349”></em

No, the ID number changes every time i delete an address and after that re-add another one or the same.
For example the previously ID was 15091348, and then it becomes 15091349.
The only thing that is unique is the class as you can see from the example code above.

We need to see more of the HTML surrounding the problem element. Show more HTML from before the element.

eee4

the attachment shows the code of a single card which is shown in the updated image
they could be a lot in a single page

I’m a bit confused here… what exactly is your intention? If you’ve identified the fact that the id is unknown during testing, it’s hard to figure out how you want to proceed.

For example, you could target the first card – or the tenth card.

Let me know.

the problem is that the cards do not respect a precise number order . For example every time i delete and then re-add an address , the first card could became the second or the third etc… So the target doesn’t work in this way because I can’t target a card rather than another one.
I can’t see on the html code anything that show me exactly the position/order of every single card.
All i want is to identify uniquely the trash bin icon for every card, without every time change the object id. There is a way to do it?

Yes, certainly. But you’re still not telling me what you want to do.

I believe this CSS selector/locator will target the first card’s delete element (the <em> element). It’s hard to say for sure, I can’t see the entire document.

I’m working blind and you are not expressing your need clearly.

div[id^=accordion_edit_]:nth-child(1) h4 em.fa-trash.delete_address

I think partly your unstated problem is this: there’s no point storing the identities in the Test Objects, because they will always be different when you run the test.

The solution to that is to use makeTo(). <<< Read this!

You can verify xpaths in the browser console with the following syntax:

$x(“myxpath”)

The test I have to do with this web application is:
-Open the url (it works)
-Login (it works)
-Search a “user” and then modify it adding a new address in the form(it works)
The last thing I have to test is going again in the same user’s modify panel and delete the address i just added clicking on the trash bin icon( as soon as the icon is clicked, an alert appears to confirm or not the operation).
But it don’t work…
I hope this will help you to understand my problem
Today I will try to use the method maketo() you suggested yesterday.

I apologize for not explaining myself better before but english is not my native language.

Hi Maria,

Got the Scenario …Lets try to resolve Step by Step so tht our friends can understand .

Step 1 Modify the Pannel or widget (is it working???)

Step 2 Click on Trash Bin icon (is it working???)

Step 3 Alert Popup (is it working…???)

Conform on the above 3 Steps .hope the above stated are your issues …???

Thanq
Mikky…!

Ok. :thinking:
Step 1: it works. I can add a new address and modify it
Step 2: Click on trash bin icon for delete the address i just insered-> don’t work.
Katalon don’t recognize the trash bin object
Step 3: The test don’t arrive at that step because it stops at step 2