I am facing issue in using "sendKeys in protractor.sendkeys will send intial data(Questions are taken from json file)at faster speed and as data increase in loop(later questions like 563rd,440th questions) the speed decreases increasing suite execution time.
for( var k = 0; k < 1000 ;k++)
{
var questions = data.Questions[k];
expect(converse.inputBox()).toBe(true);
element(by.id('Inputbox')).sendKeys(questions);
expect(converse.enterImageclick());
}
Json file:
{
"Questions":
[
"Can I talk to everyone involved in an email?",
"Reply to all",
"Reply all",
"Can I respond to everyone copied in an email?",
"How do I say something back to everyone?",
"How do I reply to all?",
"Can I respond to everyone in a conversation?",
"Can I change how contacts are stored?",
"How do I sort contacts?",
"Sort contacts",
"Can I see my contacts by first name?",
"Can I pick how contacts are displayed?",
................................continues to 1000+questions
]
}
I tried using npm package "node-key-sender". i added require of this package at the start of spec file var ks = require('node-key-sender');
and altered the loop as follows:
for( var k = 0; k < 1000 ;k++)
{
var questions = data.Questions[k];
expect(converse.inputBox()).toBe(true);
element(by.id('Inputbox').sendText(questions);
expect(converse.enterImageclick());
}
is this the right way of using sendText?? If not how can i use it?? or is there any solution other than using sendkeys.