Zombie.js can't find button element on page

jarrah001

New Member
I'm trying to submit a form with zombie.js, and pressButton() is failing with "Error: No BUTTON 'xxx'", where xxx is the selector. Here is the app:\[code\]var Browser = require('zombie');b = new Browser();b.visit('https://www.example.com/login/', function() { b. fill('name', 'My Name'). fill('code', 'My Code'). pressButton('submit', function() { console.log(b.html()); });});\[/code\]And here is the form:\[code\]<form method="post" class="login"> <p> <label for="name"> <span id="nameprompt">Your Name:</span> </label> </p> <input name="name" id="name" value="" size="40" maxlength="40" /> <p> <label for="code"> <span id="codeprompt">Bar Code</span> </label> </p> <input name="code" id="code" type="PASSWORD" value="" size="40" maxlength="40" /> <div class="formButtonArea"> <input type="image" src="http://stackoverflow.com/screens/pat_submit.gif" border="0" name="submit" value="http://stackoverflow.com/questions/11169803/submit" /> </div></form>\[/code\]I've tried a bunch of selectors including things like ".formButtonArea input" in addition to the obvious "submit" with no success.What am I doing wrong?
 
Top