I am trying to enter the text and ensure it gets saved. In my project, there is no save button, as soon as it entered it gets saved. Only few fields that cracks me when entering the text. 

Note: I'm using the latest version of Chrome and passing the numeric values as text.

I referred to below pages and updated my code accordingly, then also this issue persists:

* [Selenium Webdriver: Entering text into text field](https://stackoverflow.com/questions/19137109/selenium-webdriver-entering-text-into-text-field)
* [Selenium send\_keys doesn't work if input type="number"](https://stackoverflow.com/questions/23412912/selenium-send-keys-doesnt-work-if-input-type-number)

Below is the code that I used,

```
 public void EnterValuesByIndex(String locator, String locatorValue, String text, int indexvalue) throws InterruptedException
      {
        WebElement element = null;

        if (locator.equalsIgnoreCase("cssSelector")) {
          element = (WebElement)driver.findElements(By.cssSelector(locatorValue)).get(indexvalue - 1);

        } else if (locator.equalsIgnoreCase("xpath")) {
          element = (WebElement)driver.findElements(By.xpath(locatorValue)).get(indexvalue - 1);

        } else if (locator.equalsIgnoreCase("id")) {
          element = (WebElement)driver.findElements(By.id(locatorValue)).get(indexvalue - 1);
        }
        //element.clear();
        element.sendKeys(text);
        Thread.sleep(2000);
        element.sendKeys(Keys.ENTER);
        System.out.println("Enter key is pressed");
      }

```

Below code also used to enter character by character, same issue persists,

```
public void EnterTextbyChar(String locator, String locatorValue, String text, int indexvalue) throws InterruptedException
        {
            String value = text;                
            WebElement element = null;

            if (locator.equalsIgnoreCase("cssSelector")) {
            element = (WebElement)driver.findElements(By.cssSelector(locatorValue)).get(indexvalue - 1);
            } else if (locator.equalsIgnoreCase("xpath")) {
                element = (WebElement)driver.findElements(By.xpath(locatorValue)).get(indexvalue - 1);

            } else if (locator.equalsIgnoreCase("id")){
              element = (WebElement)driver.findElements(By.id(locatorValue)).get(indexvalue - 1);               }
            element.clear();
            for (int i = 0; i < value.length(); i++)
            {
              char c = value.charAt(i);
              String s = new StringBuilder().append(c).toString();
              element.sendKeys(s);
              element.sendKeys(Keys.RETURN);
              element.click();
              Thread.sleep(2000);
              System.out.println("Return key is pressed in EnterTextByChar method");
              System.out.println(c);
             }  
         }

```