function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
var text = ['Text 1', 'Text 2', 'Text 3'];
var elemText = document.querySelector(".js-chat_input.chat_text_input.form__input.ember-text-area.ember-view");
var elemClick = document.querySelector(".button.float-right.chat-interface__submit.qa-chat-buttons__submit.js-chat-buttons__submit.ember-view");
setTimeout(function fn() {
elemText.value = text[getRandomInt(0, text.length - 1)];
elemClick.click();
setTimeout(fn, 2000);
}, 2000);
|