windows 提交表单后 phantomJS 崩溃

phantomJS crashes after form submit on windows

我 运行 在 windows 机器上进行 casperjs 测试。一切正常,直到我在填写表单后单击提交按钮,phantomjs 崩溃并且在提交代码后没有测试执行。

 casperjs --version
2.0.0

表格 HTML 是:

<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>

测试代码为:

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);
}

显示此消息

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\Tempfc7a7e-27e9-4116-8aed-d14d7ddae6a7.dmp"

在 dmp 文件中有一系列 Ascii 代码,如:

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
....

自己解决了。 幻影崩溃的原因可能是: - 给出了错误的选择器。 - 在 casper.fillSelectors 之后用 true 作为最后一个参数回显一些字符串。