My naive approach to get ZombieJS to loop over an huge array of items was to add the following code inside my for loop
var Browser = require("zombie");
var assert = require("assert");
// Load the page from localhost
browser = new Browser()
browser.visit("http://localhost:3000/", function () {
// Fill email, password and submit form
browser.
fill("email", "zombie@underworld.dead").
fill("password", "eat-the-living").
pressButton("Sign Me Up!", function() {
// Form submitted, new page loaded.
assert.ok(browser.success);
assert.equal(browser.text("title"), "Welcome To Brains Depot");
})
});
but all sort of errors ensued. Specially memory errors after trying to load the 100th item.
What am I doing wrong? I wish I could run this every iteration of the loop and also cleaning the resource after every successful try.