Uploading a file with the "type" command started getting an error

I’m using the Chrome Extension “Katalon Recorder 7.1.0” and my test suite recently started getting an error message, where no error had occurred before. I’m not sure exactly when the change began happening, but it started occurring in the last few months.

The test step which is failing is the step where it uploads a file to the web site.

command: type
target: //input[@type=‘file’]
value: ${fileName}

The variable “fileName” is derived from a test data CSV, it is a string of the full path and filename of a file on the hard disk which gets uploaded to the web site.

This step works and the file gets successfully uploaded to the web site! However the test suite halts with this error message in the log:

[error] TypeError: Cannot read properties of undefined (reading ‘match’)

This step used to work without any error. Recently it started halting with the error, even though the upload still worked.

I have a vague hunch as to what’s happening, but I’m not sure. It feels like Katalon Recorder is trying to validate the target element on the page after the upload has completed. The web page changes immediately when the file upload completes, so the target element no longer exists, thus the error message. This didn’t used to be a problem though, so it seems like maybe the Katalon Recorder Chrome extension was recently updated, and maybe there’s a bug in this update which causes the validation to occur a second time after the upload instead of before?

I’ve tried the following things to work around it, none of them have worked:

  • Turning off “Self Healing” - No difference
  • Using various methods for identifying the target element. All of the ways I can identify the element succeed, and successfully upload the file, but I still get the error message after the upload.
  • Trying to use “store | true | !error” in the prior step, to make it skip the error message. Doesn’t prevent the error.
  • Trying to use a “runScript” instead of “type” to use a piece of Javascript to upload the file to the web site. Doesn’t work: Chrome’s security sandboxing blocks javascript from doing this.
  • Ensure that Chrome’s settings for the Katalon Recorder extension are set to allow direct file access. Of course this is turned on, has been for a long time, because otherwise the upload wouldn’t have ever succeeded. And it does succeed.
  • Trying to use the “upload” command instead of the “type” command to send the file to the web site. This fails with an error saying that the input element is not interactible.
  • Trying to use javascript to “unhide” the input element and then using “upload” to send the file. Fails with the same error saying that the input element is not interactible.
  • Using a “click” action on a button to trigger the upload. This produces the expected dialog box where the user manually selects the file to upload. However this test suite must run automated, and I can’t have a user answering the file selection dialog. The test suite must run through a bunch of different files automatically without user interaction.

Any ideas about this? Is this actually a recent bug in Katalon Recorder? Has anyone else seen this, is this a known thing?

Hi there, and thanks for posting in the Katalon community! :hugs:

Working with recording, we encourage you trying Katalon Web Recorder Plus: Katalon Web Recorder Plus | Katalon Docs. Double-checking the steps and configurations might resolve the issue.

If the doc doesn’t help, feel free to provide more details, and a community member will assist you soon. Thanks for being a part of our community!

Best,
Elly Tran

Problem Analysis

Your hypothesis is correct and well-founded. Based on my research, Katalon Recorder 7.1.0 introduced regressions that are causing issues with file uploads and form interactions. The community has reported multiple issues with version 7.1.0, and your specific error pattern—where the file upload succeeds but then fails with a validation error after the page DOM changes—is consistent with known issues in this release.

The error TypeError: Cannot read properties of undefined (reading 'match') indicates that Katalon Recorder is attempting to validate or process the target element after the upload completes and the page has changed, causing the element reference to become invalid.

Key Finding: Multiple users have reported that version 7.1.0 introduced regressions affecting form interactions, including file uploads and input handling, particularly on dynamic pages. Some users have successfully worked around this by reverting to version 6.0.3.


Recommended Solutions

Solution 1: Downgrade to Katalon Recorder 6.0.3 (Most Reliable)

Since you’ve already tried numerous workarounds without success, and multiple community members have confirmed that version 6.0.3 works reliably for file uploads while 7.1.0 has regressions, downgrading is your most practical option:

  1. Uninstall Katalon Recorder 7.1.0 from Chrome
  2. Download version 6.0.3 from crx4chrome.com
  3. Install the older version manually by:
    • Opening chrome://extensions/
    • Enabling “Developer mode”
    • Dragging the downloaded .crx file into the extensions page
  4. Test your file upload script—it should work without the error

Why this works: Version 6.0.3 doesn’t have the post-upload validation bug that was introduced in 7.0+ versions.


Solution 2: Add a Wait/Pause Step (Temporary Workaround)

If you prefer to stay on 7.1.0, try adding a wait step immediately after your file upload to allow the page to fully transition before Recorder attempts validation:

type | //input[@type='file'] | ${fileName}
pause | 2000

Or use element-based waiting:

type | //input[@type='file'] | ${fileName}
waitForElementNotPresent | //input[@type='file'] |

This may suppress the error by ensuring the validation occurs after the page has stabilized.


Solution 3: Report as a Bug (If You Want to Stay on 7.1.0)

If downgrading isn’t an option, you should report this as a bug to Katalon. The error pattern you’ve described—successful file upload followed by post-upload validation failure—is a clear regression that the development team should address.


Key Considerations

  • Version 7.1.0 Issues: The release notes mention bug fixes for pop-ups and script conflicts, but don’t address the file upload regression that users have discovered post-release.
  • Community Consensus: Multiple users have confirmed that reverting to 6.0.3 resolves similar issues with form interactions and file uploads.
  • File Access Permission: You’ve already confirmed “Allow access to file URLs” is enabled, which is correct—this isn’t the issue.
  • The Error Pattern: The match error suggests Recorder is trying to parse or validate the target element after it no longer exists in the DOM, which is a timing/validation logic issue in 7.1.0.

References

Known issue in Katalon Recorder 7.1.0+ post-Chrome updates: Post-upload validation fails (match on undefined) as element vanishes, despite successful upload.​

Fixes

  1. Recorder Settings > Self-Healing OFF; use upload command (drag-drop sim):
command: upload
target: //input[@type='file']
value: C:\path\file.csv  // Full path, comma for multi

(Chrome-only).​
2. Extension > Manage > Allow access to file URLs ON.​
3. Alternative: Export to Studio → WebUI.uploadFile(element, filePath) (stable).​

Update Recorder/ChromeDriver if persists

@tfabris
This is actually very simple → This is not a script bug, but the timing plus validation bug in the extension.

Solution:

  1. Add Wait before upload either Via waitforelementpresent or other.
    This will reduce the chances of post validation mismatch

  2. make the locator more stable

Just do the 1st one it will work

Thanks so much for your suggestions.

Among your suggestions are several things I already tried. Some were mentioned in my original post, others I missed posting because I had tried so many things and couldn’t remember all of them when I made my post:

Suggestions which I have not yet tried:

  • Using Katalon Studio or Katalon Web Recorder Plus: I am trying to avoid an additional software installation, or additional cost, in this case.
  • Downgrading to an earlier version of the Katalon chrome extension: I plan to try this soon. I am concerned because this thing worked successfully only a month or two ago and now has stopped working. was the Katalon chrome extension updated in that time period?
  • Reporting a bug: How exactly do I do that? I had hoped that posting here in this forum would attract developer attention.

Suggestions which I already tried and did not work:

  • Adding pause commands both before and after the troublesome “type” command: Same error.
  • Adding WaitForElement commands both before and after the troublesome “type” command: Same error.
  • Turn off “self healing”: Same error.
  • Use “upload” command instead of “type” command: Different error: “input element is not interactible”.

I like the idea of rolling back to an older Katalon Recorder extension.

However, I’m currently unable to install an older version of the Katalon Recorder chrome extension: When I install the older version of the CRX file, it works for a moment, but then it auto-updates itself back to 7.1.0.

Googling for this problem, it says that I should unpack the extension and edit its manifest.json to prevent updates. Then install the unpacked/edited version of the extension. This is a great idea, except that I can’t unpack these CRX files that I’m getting from crx4chrome.com. The old trick of renaming them to “.zip” and using an unzip tool is failing me, it alwaus says the file is corrupted or not a zip file.

Any ideas here?

Actually, never mind about rolling back to an older version of the chrome extension. In the brief window before it self-updated, I was able to try my script on an older version of the extension, and it got the same error. I could only try version 7.0.0 of the extension, since Chrome refuses to run the next version down (6.0.3) because it has an older manifest version.

Since this started happening only in the last month or so, I have got to assume it’s a recent Chrome update which caused the issue, some new little API or timing thing between Chrome and Katalon.

I’ll investigate if using Katalon Studio will help.

OK, I solved my problem by installing Katalon Studio and fully rewriting the test suite to run in that application instead.

It’s insane how different the two products are: Katalon Studio and Katalon Recorder chrome extension. It’s like they were two completely different software packages made by two different companies or something.

It’s funny because Katalon Studio STILL had a bug with the UploadFile command in that same spot. It was a different error message, but it was still an error. Same kind of deal: The upload succeeded at the web site but the runtime testcase threw an error message which failed the test case.

BUT, since Katalon Studio is much more powerful, I was able to wrap the recalcitrant command in a try/catch and just eat the catch.

So both products still have some kind of a bug with uploading files, and the Katalon folks should, maybe have a look at that. In the meantime I’ve worked around my problem successfully.