I am trying enter characters into text field, however its not working. Below I mentioned 2 pieces of code. JS is not working at all. Where as in the first piece of code click is working but not other steps. Xpath is correct as click is working on that.
util.driver.findElement(By.xpath("//input[@id='input-1']")).click();
util.driver.findElement(By.xpath("//input[@id='input-1']")).clear();
util.driver.findElement(By.xpath("//input[@id='input-1']")).sendKeys("hjgfjg");
JavascriptExecutor js = (JavascriptExecutor) util.driver;
js.executeScript("document.getElementByXpath('//input[@id='input-1']').value = 'TEST')");