Selenium recording will not capture the behaviour of Bootstrap tag input.
You need to type the word that need to be insert to the Bootstrap tag input. It looks like Image 2 after typing.
Then you have to press Enter/Return key. So then only the word will insert as a Tag(Image 3)
If you use selenium to record the above scenario and then if you playback the recorded script, It will not reach to the status of Image 3. It will reach only to the status of Image 2.
Recorded command will look like this: driver.findElement(By.xpath(XPATH)).sendKeys(TAGNAME);
The reason for this problem is selenium did not capture action of clicking the enter key.
If selenium Enter key action command added after above command, It will create a another problem. Because it will try the submit the form in that current page, also it will not add the tag to the Bootstrap Tage Input.
To over come this problem “\n”(New line) is need to be added next to the world need to be insert.
so correct command is: driver.findElement(By.xpath(XPATH)).sendKeys(TAGNAME+”\n);