youYou can use JavaScriptExecutorJavaScriptExecutor
where you can use methods like getElementByIdgetElementById
and getElementByNamegetElementByName
:
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
JavascriptExecutor myExecutor = ((JavascriptExecutor) driver);
myExecutor.executeScript. ("document.getElementsByName('q')[0].value='Kirtesh'");
driver.quit();