Object Size issue "cannot save entity file path length limit exceeded"

I want to getText of TextView. When i spy mobile objects and add to object repository it gives error “cannot save entity file path length limit exceeded” so how can i getText."

error.jpg

1 Like

The object’s name is super long than allowed file’s name of Windows. You should change its name from Object’s Name field on the left panel

I am having the same issue using Katalon Suite. If I change the object name on the left panel, it will not pick up the objects on the web during the play back. How do I resolve this?

@lalima.sahni,

Could you share what the Test Object looks like as well as your test where you’re accessing that object? It could be that the naming is out of sync between the actual object and the test which references it.

– Chris

Hi, I Have the same pb but i cant’t find the object concerned by th limit exceeded ?

Hi @momo,

When you look at the Test Objects in the Object Repository in the left-hand pane of Katalon Studio, do you see any that look like they have exceptionally long names? Could you share a screenshot?

Thanks,

Chris

Hi Chris,
Seem to have the same problem.
I can’t save it to the object repository (have to unselect the long ones)
It seems to go wrong on selectOptionByValue below is a e.g.

selectOptionByValue(findTestObject(“Object Repository/Page_XXYY - Edit/select_Please selectAboriginal but not Torres Strait IslanderTorres Strait Islander but not AboriginalAboriginal and Torres Strait IslanderNeither Aboriginal nor Torres Strait IslanderNot StatedDeclined to Answer”), “3”, true)

All was recorded with the webrecorder via chrome.

Kind regards,
Marco

Yeeeessss ! Thanks a lot Chris !
:pray:

1 Like

Hi @marco.vdheide,

Yes, the auto-naming can sometimes be very long for complicated element hierarchies.

While you’re recording your test, you should be able to rename the Captured Objects:

  1. Start recording your test case
  2. Interact with the element that gives you the very long name
  3. Click “Show Captured Objects” near the top of the Web Recorder window
  4. This should reveal a panel where you can view the details about each Object
  5. Select the very long named object from your test steps
  6. In the right-hand Object Properties section, type in a new, shorter name for the object
  7. You should notice that your test steps are updated to reflect the new name!
  8. Continue recording and save your test as normal

Hope this helps,

Chris

3 Likes

Thanks Chris works like a charm

1 Like

Dear Chris,
I was experiencing the same issue here and could update and save it. Unfortunately, after repository is saved those test case is not running again, as it is showing error message as below:

    Test Cases/Register FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to set text 'Abah' of object 'Object Repository/MercuryTravelRegister/Page_Register Mercury Tours/input_FirstName_firstName'
	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.SetTextKeyword.setText(SetTextKeyword.groovy:65)
	at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.execute(SetTextKeyword.groovy:37)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.setText(WebUiBuiltInKeywords.groovy:950)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$setText$2.call(Unknown Source)
	at Register.run(Register:28)
	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:331)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:322)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:301)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:293)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:227)
	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 TempTestCase1553657739311.run(TempTestCase1553657739311.groovy:21)
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: 'Object Repository/MercuryTravelRegister/Page_Register Mercury Tours/input_FirstName_firstName' located by 'By.xpath: //input[@name='firstName']' not found
	at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElement(WebUiCommonHelper.java:1053)
	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.SetTextKeyword$_setText_closure1.doCall(SetTextKeyword.groovy:51)
	at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword$_setText_closure1.call(SetTextKeyword.groovy)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
	at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.setText(SetTextKeyword.groovy:65)
	at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.execute(SetTextKeyword.groovy:37)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.setText(WebUiBuiltInKeywords.groovy:950)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$setText$2.call(Unknown Source)
	at Script1553657145589.run(Script1553657145589.groovy:28)
	... 11 more

Any idea how to fix it? Many thanks.

Hi @Yudistira_Nugraha,

(I reformatted your original question to hopefully make it a little easier to see some of the error messages)

One thing that is standing out is that it says that it can’t find a test object at

Object Repository/MercuryTravelRegister/Page_Register Mercury Tours/input_FirstName_firstName with an xpath of //input[@name='firstName']'

Can you confirm that you have a test object in your Object Repository at that location? Can you also confirm that you have an input element showing on the screen with the name firstName?

Usually Katalon/Appium are pretty good about detecting what’s on a screen, so maybe the name of the input element changed recently?

– Chris

Hi Chris,
Thank you very much for your time. Sorry i didn’t make the description clear. Below is the detail case:

  1. I recorded from website with the result as below:

  2. I tried to save it and got this warning message:

  3. As i googled i got this posting and tried to rename it and succeed. I renamed select_-JanuaryFebruary… into select_-January:

  4. But when i tried to run it, it’s showing error message regarding objects. I believe it’s happening because of those renaming process:

_03-28-2019 04:37:00 AM Test Cases/Register_

_Elapsed time: 1m - 38.829s_

_Test Cases/Register FAILED._
_Reason:_
_com.kms.katalon.core.exception.StepFailedException: Unable to click on object 'Object Repository/PracticeTest/Page_Login - My Store/span_Create an account (1)'_
_	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:86)_
_	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:67)_
_	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)_
_	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:616)_
_	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$2.call(Unknown Source)_
_	at Register.run(Register:25)_
_	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:331)_
_	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:322)_
_	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:301)_
_	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:293)_
_	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:227)_
_	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 TempTestCase1553722616660.run(TempTestCase1553722616660.groovy:21)_
_Caused by: org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document_
_  (Session info: chrome=73.0.3683.86)_
_  (Driver info: chromedriver=2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)_
_Command duration or timeout: 0 milliseconds_
_For documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html_
_Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:07:36.161Z'_
_System info: host: 'S752-R00000', ip: '192.192.192.192', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_181'_
_Driver info: com.kms.katalon.selenium.driver.CChromeDriver_
_Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.43.600210 (68dcf5eebde371..., userDataDir: C:\Users\YUDIST~1\AppData\L...}, cssSelectorsEnabled: true, databaseEnabled: false, goog:chromeOptions: {debuggerAddress: localhost:63449}, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 73.0.3683.86, webStorageEnabled: true}_
_Session ID: 8cdb7283ec9e0544a12581b1bfde395c_
_	at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)_
_	at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)_
_	at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)_
_	at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80)_
_	at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44)_
_	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)_
_	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)_
_	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:600)_
_	at com.kms.katalon.selenium.driver.CChromeDriver.execute(CChromeDriver.java:20)_
_	at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:279)_
_	at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:83)_
_	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:79)_
_	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:86)_
_	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:67)_
_	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)_
_	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:616)_
_	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$2.call(Unknown Source)_
_	at Script1553657145589.run(Script1553657145589.groovy:25)_
_	... 11 more_

Please advise. Thank you.

Hi @Yudistira_Nugraha,

Thanks for the screenshots and the log - they’re very helpful when troubleshooting!

From the looks of the screenshots, the renaming to select-January successfully renamed the captured object and its reference in the test, so that seems good.

In the error log output, I see that Object Repository/PracticeTest/Page_Login - My Store/span_Create an account (1) is saying that it can’t be clicked. I’m not sure if that means that the object doesn’t exist in the repository, or if it just can’t be found on the page.

My guess is that there is something out of sync with the naming of that object, the reference to it in your test, or the xpath of the object.

To start, can you confirm that you have a item in the Object Repository that is named exactly as Object Repository/PracticeTest/Page_Login - My Store/span_Create an account (1)? Secondly, can you verify what the properties of that object are, namely what is the xpath that’s showing? Finally, using that xpath and something like Google Chrome Inspector, can you confirm that the xpath exists on the screen that you’re testing for the specific object you want to click?

– Chris

Thank you so much I’m also having the same problem and it helps. Thank you :slight_smile:

1 Like

Hi @Chris_Trevarthen,
Thanks for the feedback. I always got those error message whenever i did steps as below:

  1. Record test case
  2. Run it
  3. Shortened several object names
  4. Save it
  5. Run in again.

My workaround was:

  1. Record test case
  2. Shortened several object names
  3. Save
  4. Run in again.

And it works successfully.

Thank you.

2 Likes

Hi guys, i had this problem today.
I was not saving because I used the recorder, and clicked stop recording.

When I saved without stopping the recording, it saved without the error.

Hello @jjjuniorjr2
To resolve this error, first of all:

1-After the error message, the object name field exceeding the length is detected on the Web Recorder page.

2-Select the relevant object name and click the Show Captured Objects button and update the variable name of the relevant object so that it does not fit into the 255 limit.

3-Then the saving process is confirmed again. At this stage, the “Can not save Entity: file patch length limit exceeded The error message will no longer appear

Nope, this does not work. The problem is not the object name length but the path name length. Giving all your objects names that are extremely short might duck under the path name length, but at the end of the day it’s due to a failure at Katalon in understanding how to code an application for Windows.

The default recommended location for Katalon is C:\Users<username>\Katalon Studio. (Hopefully you don’t have a long username, and that’s only around 30 characters).

Additionally, Katalon has determined that the objects should be put into a folder that starts with “Page_Application Form <Insert the title of the extremely long website page title and use it instead of as a folder name because that will be a better way for your users to store their information about their tests than letting them choose the folder name for themselves so just use what the title of the website is because you don’t really know what you want to do to make this length not too long that your users see these bug reports from 2018 and are still hitting the same bug>”. This does not appear to be an option in Web Recorder, so if the page title is over 70 characters, this is going to be a problem for your object names. As a result, an object for many websites will have a path longer than 255 bytes.

@tanderson

Hi, But the solution you’re talking about serves the same thing as I’m telling you.
If you want to shorten the file path, if you want to shorten the path to the object and if you want to increase the 255 settings in the windows limit.
I would go to this error both in shortening my Katalon project path and in the solution I explained above.