When I enter text into the text field it gets removed.
Here is the code:
String barcode=\"0000000047166\";
WebElement element_enter = _driver.findEl
It might be the JavaScript check for some valid condition.
Two things you can perform a/c to your requirements:
String barcode="0000000047166";
WebElement strLocator = driver.findElement(By.xpath("//*[@id='div-barcode']"));
strLocator.sendKeys(barcode);