Before hitting that Ask the Community button, make sure to:
### Operating System
Windows 10
ISSUE
Test is FAILING - Unable to find element with Xpath and dedicated unique identifier… It was working for days then one day no locator is working. I tried a different browser to see if it was a browser issues, that’s fine!
Something I noticed as well When I capture the object on Object SPY it says unable to find the object but WHY? If its there… It was all passing before and all a sudden nothing works.
Run edit checks to validate that your HMDA data is ready for transmission.
Run edit checks on your HMDA data, and correct data anomalies so your transmittal file complies with CFPB file and edit specifications.
' or . = '
HMDA Transmittal
Run edit checks to validate that your HMDA data is ready for transmission.
Run edit checks on your HMDA data, and correct data anomalies so your transmittal file complies with CFPB file and edit specifications.
')]
IF WE select the ATTRIBUTE: using unique DATA tag for this object
Any test script can not click an element if the element is NOT yet there in the page, OK?
I found that your script is NOT explicitly waiting for the target element to appear in the page before clicking it. Therefore your code is unstable. Your script may accidentally work but is more likely to fail.
You should use WebUI.waitForElementPresent(Testobject, timeout) and other keywords just before you call WebUI.click(TestObject) in order to make sure the target element has been loaded and is really there in the page before you click it.
Rule of thumb: You should explicitly wait for the element before clicking it. Always!
The Recorder and Spy tools of Katalon Studio does NOT generate any code to wait for the targeted elements before clicking them. It’s a shame. You should not rely on these tools much. You have to insert the code of WebUI.waitForElementXXXX manually.
Great now it works but its still not clicking on the element hence the next step is not passing. One of my team mates also having same issue! Object is there buts not clicking on the object. Weird behavior
Possibly the locator expression is wrong: it is not pointing the HTML element you want.
You wrote “Weired behavior” — possibly you used the Record tool of Katalon Studio to generate the Test Object, but you have never checked its validity against the HTML source. The tool is just a tool. The auto-generated Test Objects are just the suggestions for you to get started with; not the definitive solutions. The tools generate fragile codes quite sometimes. Or, the target HTML might have changed after you generated them. So, you need to review and edit the auto-generated codes manually. That’s the mission of IT staff, you know. — Are you disappointed to hear this?
What to do next? — I don’t see, as you haven’t disclosed any detail information. Please provide more information:
HTML source code , while pointing which element is of your interest
Definition of the Test Object, we need to see the locator expression (XPath or CSS Selector)
Test Case script source code, while pointing which statement you have a problem about
Preferabkt you should create a new discussion thread with an appropriate title, so that you can close this thread.
One of the parameters of the waitForXXX is a “timeOut”. DO NOT PUT the “timeOut” at 0 (zero). Put it at 5 or 10. Give your pages time to form. You may be in a hurry, but your pages will form when they are ready
check the newly added screen shots for HTML, Groovy code and HTML source code… NEW title is
“test run passes without errors but the click action does not appear to work on the object in the UI”
Please Select Attributes of Selection Methos under Object Repository and also select only text value under object properties.
You can also check whether your object repository value is correct or not by below ways,
copy xpath from your repository
open your page in browser and click right mouse on the object and click inspect
click ctrl +F and type your copied xpath here
See your element is being highlighted or Not.
If you element is highlighted then your xpath is correct other wise you need to create another xpath.
FYI @naomy.arnold
So I figured out the issue, There was a change to PROD, and with this changed added TWO extra steps. they had no idea it would affect automation. Once I used the web recorder after the change I then noticed there were two extra steps hence why my objects was not clickable because it was NOW on a different page! Thank you all so much for your input! I learned a lot.
Thank you Dinesh I figured out the issue. I appreciate your help.
There was a change to PROD, and with this changed added TWO extra steps. they had no idea it would affect automation. Once I used the web recorder after the change I then noticed there were two extra steps hence why my objects was not clickable because it was NOW on a different page! Thank you all so much for your input! I learned a lot.