TypeError: undefined is not a function

308 views
Skip to first unread message

Dovie Gelerinter

unread,
May 23, 2013, 3:50:55 PM5/23/13
to zomb...@googlegroups.com
I had this under a different title that nobody even looked at so I figured maybe I didn't give it the proper type of title, since the last couple times people answered pretty quickly.  So here goes again:

I'm trying to run a cucumber.js script, in which I require zombie, on a WinXP machine and I get the following error:

<projfolder>features\support\world.js

    this.browser = new zombie.Browser();
                           ^

TypeError: undefined is not a function
(followed by a stacktrace)

I'm totally lost here. 

I'm running node v0.8.17 and cucumber v0.3.0

I'm not sure what other information you might need, but please ask if you need anything else.  I'm desperate to get this solved as I have to show this to my boss next week and am stuck and she's not going to like that as an answer. :)

Thank you.

Assaf Arkin

unread,
May 23, 2013, 4:03:24 PM5/23/13
to zomb...@googlegroups.com
I don't know what your variable zombie points to, but I'm guessing it doesn't have a property called Browser.

Check the top example on the site:
http://zombie.labnotes.org/
--
You received this message because you are subscribed to the Google Groups "zombie.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zombie-js+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Dovie Gelerinter

unread,
May 23, 2013, 4:25:00 PM5/23/13
to zomb...@googlegroups.com
Hmm, you definitely got me to the next step!  Thanks!

I had:

var zombie = require('zombie');

I changed that (similar to what you have on site) to:

var Browser = require('zombie');

and the line later to:

this.browser = new Browser();

It definitely got me past that but now I'm getting another error but I want to try to debug it myself before posting it here.

Thanks!

Kunal Hari

unread,
Feb 27, 2014, 7:33:36 PM2/27/14
to zomb...@googlegroups.com
Hi,

Where did you make this edit. What is the file path. I am getting the same error with Behat ZombieJS tests?

Thanks.

anshu pitlia

unread,
Apr 2, 2015, 6:00:00 AM4/2/15
to zomb...@googlegroups.com

Hopefully, your zombie is set to this -

var zombie=require("zombie");

Having clarified that, you need to change your step from

this.browser = new zombie.Browser();

to:

this.browser=new zombie();

and that should work fine.

There is a lot more to that, for more help check this API out.

Reply all
Reply to author
Forward
0 new messages