当我在 night.js 中包含 vanilla JS 时,遇到了错误。我想确保数组中的每封电子邮件都输入到系统中。for 循环是理想的选择,但我不断遇到错误,例如:
Search failed: Nothing responds to "goto"
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
var jquery = require('jquery');
var Nightmare = require('nightmare');
var nightmare = Nightmare({
show: true,
dock: true
});
var siteName = "*********";
var username = "*********";
var password = "*********";
var outboundEmailArray = [
{
"from_name": "TestOutbound",
"email_username": "array1",
"email_domain": "salesforce.com",
"email_domain": "salesforce.com",
"reply_to": "testOutbound@salesforce.com"
},
{
"from_name": "Tester",
"email_username": "array2.0",
"email_domain": "salesforce.com",
"email_domain": "salesforce.com",
"reply_to": "testOutbound@salesforce.com"
}
];
//
// var outboundEmailSetup = function(outboundEmail){
// nightmare …Run Code Online (Sandbox Code Playgroud)