I try with following xpath
driver.findElement(By.xpath("//div[contains(@class,'ReactTags__selected')]//span[1]/text()"));
but get following error
"org.openqa.selenium.InvalidSelectorException: invalid selector: The result of the xpath expression "//div[contains(@class,'ReactTags__selected')]//span[2]/text()" is: [object Text]. It should be an element."
<div class="ReactTags__selected">
<span class="tag-wrapper ReactTags__tag" style="opacity: 1; cursor: auto;" draggable="true">
"TestName"
<a class="ReactTags__remove">×</a>
</span>
</div>