title: How to use Javascriptexecutor for entering text in an element which does not have Id as a locator?
body: <p>I want to enter text in an Textbox which does not take the input through SendKeys. I proceeded with using Javascriptexecutor to enter the text and succeeded. Now there are a few fields in which there is no Id that can be selected as a locator so I need to locate them with Xpath. I would like to know how can we locate the element by xpath in Javascriptexecutor and pass the values to it.</p>
  
  <pre><code>JavascriptExecutor jse = (JavascriptExecutor)driver
  jse.executeScript("document.getElementById('value').value='1611 
  Dragons';");
  </code></pre>
  
  <p>I need an approach where I can use it something like:</p>
  
  <pre><code>document.getElementByXpath("Xpath Here").value='xyz';");
  </code></pre>
  
  <p>Please feel free to guide me to a Doc/answer if it documented somewhere before.</p>