I'm running casperjs tests on a windows machine. Everything works well until I click submit button after filling form, phantomjs crashes and no test executes after submit code.
casperjs --version 2.0.0
Form HTML is :
<form id="assessment20config" action="/facilities/105/assessments/" method="post">
<table style="margin-left:5px;" class="row">
<tbody>
<tr class="small-headers"> <!-- All Headers -->
<td class="col-xs-6">
<span>Select Assessment:</span>
</td>
<td class="col-xs-1">
<span style="margin-left:-15px;">Frequency:</span>
</td>
<td class="col-xs-2">
<span>Assessment Name:</span>
</td>
</tr>
<tr>
<td>
<select id="azzezzmentz-list" class="pull-left" style="padding:1px;" name="azzezzmentSelected">
<option value="1" >Lamplight Ft. Wayne Assessment
</option>
<option value="2" >Lamplight Baltimore Assessment
</option>
</select>
</td>
<td>
<input id="frequency-textbox" type="number" name="frequency" required="required" min="0" style="width: 60px;">
</td>
<td>
<input type="text" name="alternateName" required="required" style="width: 150px;">
</td>
</tr>
</tbody>
</table>
<br>
<input id="schedule-azzezzment-for-facility" class="btn btn-primary" type="submit" value="Schedule">
</form>
Testing code is:
var that = this;
this.fillAssessment2ScheduleForm = function(selectAssessment, frequency, assessmentName) {
that.obj["select[name='azzezzmentSelected']"] = selectAssessment;
that.obj["input[name='frequency']"] = frequency;
that.obj["input[name='alternateName']"] = assessmentName;
casper.fillSelectors("form[action*='/assessments/']", that.obj, true);
}
This message shows up
PhantomJS has crashed. Please read the crash reporting guide at and file a bug report at . Please attach the crash dump file: C:\Users\***\AppData\Local\Temp\59fc7a7e-27e9-4116-8aed-d14d7ddae6a7.dmp"
In dmp file there is a sequence of Ascii codes like :
4d44 4d50 93a7 8063 0900 0000 2000 0000 0000 0000 a734 2655 0000 0000 0000 0000 0300 0000 c403 0000 ac04 0000 0400 0000 b014 0000 7c08 0000 0500 0000 9401 0000 d76b 0000 0600 0000 a800 0000 0404 0000 0700 0000 3800 0000 8c00 0000 0f00 0000 4003 0000 c400 0000 0100 6747 0c00 0000 cb6b 0000 0000 0000 0000 0000 0000 0000 ....
Resolved myself. Reasons for phantom crashing can be: - Given wrong selector. - Echoing some string just after casper.fillSelectors with true as last parameter.