phantomjs 1.9.8 and casperjs 1.1.0-bate3 login form variable problem

24 views
Skip to first unread message

Wecoh Zhu

unread,
Feb 18, 2016, 10:32:19 PM2/18/16
to phantomjs
I use phantomjs 1.9.8 and casperjs 1.1.0-bate3 to login a web page, OS encodings is zh_CN.utf8, JS file encodings is utf8, Web page "charset=utf-8", I have a problem :

It's OK to work.
        this.thenEvaluate(function() {
            document.getElementById('username').value = 'name';
            document.getElementById('passwd').value = 'pass';
            document.getElementById('langx').value = 'zh-cn';
        });
        this.click('div.button');

It's error.
        var n = 'name';
        var p = 'pass';
        this.thenEvaluate(function() {
            document.getElementById('username').value = n;
            document.getElementById('passwd').value = p;
            document.getElementById('langx').value = 'zh-cn';
        });
        this.click('div.button');



Reply all
Reply to author
Forward
0 new messages