Hi to all!
I’m using a web application for work. I must delete an address from a list simply clicking on a trash bin icon but Katalon Studio doesn’t recognize it.
How can I solve this problem?
I’m using 7.2.1 version
Thanks.
I look forward to a reply
PS:
This is the error:
Unable to click on object ‘Object Repository/Page_Grabb - Anagrafica - Modifica/Page_Grabb - Anagrafica - Modifica/em_Indirizzo ALTRO_fa fa-trash delete_address pull-right’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to click on object ‘Object Repository/Page_Grabb - Anagrafica - Modifica/Page_Grabb - Anagrafica - Modifica/em_Indirizzo ALTRO_fa fa-trash delete_address pull-right’
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.click(ClickKeyword.groovy:102)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:43)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:72)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:604)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$5.call(Unknown Source)
at Eliminazione di un indirizzo.run(Eliminazione di un indirizzo:43)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1582119883377.run(TempTestCase1582119883377.groovy:23)
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Page_Grabb - Anagrafica - Modifica/Page_Grabb - Anagrafica - Modifica/em_Indirizzo ALTRO_fa fa-trash delete_address pull-right’ located by ‘By.xpath: id(“headingOne_edit_15091346”)/h4[@class=“panel-title”]/em[@class=“fa fa-trash delete_address pull-right”][count(. | //em[@class = ‘fa fa-trash delete_address pull-right’ and @data-id-indirizzo = ‘15091346’]) = count(//em[@class = ‘fa fa-trash delete_address pull-right’ and @data-id-indirizzo = ‘15091346’])]’ not found
at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElement(WebUiCommonHelper.java:1154)
at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:27)
at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:67)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.call(ClickKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.click(ClickKeyword.groovy:102)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:43)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:72)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:604)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$5.call(Unknown Source)
at Script1582022010611.run(Script1582022010611.groovy:43)
… 11 more
)
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.
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.
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.
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.
Now I can use this object which is the “Password” section on the facebook page.
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.
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.
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.
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!
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.