CodeceptJS run java script code

Ingo Foerster
Ingo Foerster used Ask the Experts™
Anybody here who can give me a hint to execute custom Javascript inside a CodeceptJS script?
I need to close a layered window and I currently cannot do it with codeceptJS default calls, so I want to close it with jQuery.
I use
	I.executeScript(function() {

Open in new window

Inside my test, but I only get the error message that $ is not defined.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Front-end Developer
Hello Ingo,

Did you import the JQuery scripts in your <head></head>

As per Jquery's website the script should be:

Open in new window

Ingo FoersterProject Leader


Many thanks for the quick help

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial