What is causing the read file path to be too long?!

I just got a new machine, and just got everything set up, including Katalon Studio and my GitHub repository.

I am working on consolidating these test cases, and giving the Test Objects a more human-readable xpath.

I started on one that is located by:

  • Page_Create Member Lead - Zoho CRM
    • Member Lead Information Section
      • Payment Frequency dropdown
        • Payment Frequency dropdown button

I make the changes, and then, when I go to save it, I get that FilePathTooLongException

264 > 255 characters?! :astonished:

That is bizarre, given that, when I check the length of the path string with JavaScript, I only get 169 characters length, even if I include parent folders Zoho Katalon Project and Object Repository

"Zoho Katalon Project/Object Repository/Page_Create Member Lead - Zoho CRM/Member Lead Information section/Payment Frequency dropdown/Payment Frequency dropdown button.rs".length

returns 169

How is the Katalon environment determining path length!?

I found my answer:

when I insert in the parent path parts to make this an absolute path (starting with the drive root path), I get 264 characters.

Katalon environment uses absolute paths to handle the Test Objects (and maybe any other files).

1 Like

Thank you @mwarren04011990 for sharing this with our community!!!

You can try using a tool like LongPathTool. It helps manage and delete files or folders with long path issues easily.

Possiblly @mwarren04011990 located his katalon project in a folder of very long absolute path, such as

C:\Users\mwarrent-4011990\aaaaaaaaaa\bbbbbbbbbb\cccccccccc\dddddddddd\eeeeeeeeee\ffffffffff\gggggggggg\Zoho Katalon Project/Object Repository/Page_Create Member Lead - Zoho CRM/Member Lead Information section/Payment Frequency dropdown/Payment Frequency dropdown button.rs

which has the length of 272 characters

An alternative idea to workaround the FilePathTooLongException could be moving the whole project into a parent folder with shorter absolute path, for example:

C:\Users\mwarrent-4011990\xxxxxxxxxx\yyyyyyyyyy\zzzzzzzzzz\Zoho Katalon Project/Object Repository/Page_Create Member Lead - Zoho CRM/Member Lead Information section/Payment Frequency dropdown/Payment Frequency dropdown button.rs

which is 228 characters. This is short enough to avoid the FilePathTooLongException.


Be careful. If you are going to move your existing katalon project, you need to be aware that .project file under the Katalon project folder may cause a problem. See the following discussion:

Thanks for the remark — it’s a useful heads-up. QSPICE can indeed crash abruptly if the full simulation path or model path gets too long, even if everything else looks correct. Keeping project folders closer to the root directory usually prevents these silent shutdowns. And if you need help managing or shortening those long paths, LongPathTool can be very handy for dealing with files or folders that Windows struggles to handle.

1 Like