So let say I have an array called list that contains strings per below, when I loop through the array to send_keys each items from the array onto an online text editor element which already has focus:
list = ["First", "Second", "Third"]
for index in 0 ... list.size
line = list[index]
chain.send_keys(line).perform
if index < list.size
page.driver.browser.action.send_keys(:return).perform
end
end
The problem I'm facing is that instead of the output to look like this:
First
Second
Third
it instead looks like this:
First
First Second
First Second Third
Why is this happening ? is it because the previous actions are still in the action queue and have not cleared up ? or some other reason ? I'd appreciate if anyone can help.