Search code examples
seleniumxpathautomationtextboxsendkeys

Unable to type in Text box field using sendKeys method. The xpath is working fine, since when i tried to click on textbox it works


driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
        WebElement External = driver.findElement(By.xpath("//input [@id ='External_Reviewer']"));
        External.click();
        External.sendKeys("kevin");

The textbox is an autosuggestion with a people picker field. Is there any other way than using only "sendKeys" method. Thanks in Advance.


Solution

  • You can use a JavaScript executor

    External =driver.findElement(By.xpath("//input [@id ='External_Reviewer']"));
    driver.executeScript("arguments[0].setAttribute('value', '"yourvalue"')", External);