'Uncaught ReferenceError: current is not defined'

theBeastMaster
Mega Guru

I am getting below error while executing the test cases:

 

This step failed because the client error 'Uncaught ReferenceError: current is not defined' was detected on the page being tested.
See failing Test Logs. To ignore these errors in the next test run, use 'Add all client errors to warning/ignored list' links.

 

I got this error in the test step 'click a UI action' where I am clicking on a button to perform a few tasks.

 

It was working fine earlier. But, not sure why suddenly getting this error. Even in the ATF screenshot, I could see that on click of UI action, it navigated to the next screen. But, still got the error.

 

Please advise.

1 ACCEPTED SOLUTION

theBeastMaster
Mega Guru

It got automatically resolved and I didn't do anything to fix it. Thanks everyone for your response.

View solution in original post

7 REPLIES 7

semonbright
Kilo Contributor

There is a non-existent variable referenced somewhere. This variable needs to be declared, or you need to make sure it is available in your current script or scope otherwise , it will endup throwing this 'x' is not defined error . This usually indicates that your library is not loaded and JavaScript does not recognize the 'x'.

To solve this error:

Load your library at the beginning of all your scripts.

There can be multiple other reasons for this issue:

  • Path to CDN library you included is not correct
  • The library file is corrupted
  • Working offline
  • Conflict with Other Libraries

 

theBeastMaster
Mega Guru

It got automatically resolved and I didn't do anything to fix it. Thanks everyone for your response.

johnmalib
Kilo Contributor

If you are using any script file and getting "Uncaught ReferenceError: current is not defined " which means 'current' is either a variable or a method which you are trying to use before declaring it using var keyword. This means that there is a non-existent variable referenced somewhere. This variable needs to be declared, or you need to make sure it is available in your current script or scope otherwise , it will endup throwing this 'current' is not defined error . This usually indicates that your library is not loaded and JavaScript does not recognize the 'current'.

 

To solve this error: Load your library at the beginning of all your scripts.

 

There can be multiple other reasons for this issue:

 

  • Conflict with Other Libraries
  • Path to your library included is not correct
  • Llibrary file is corrupted
  • Working offline (when you use CDN)