Skip to main content
added 16 characters in body
Source Link
alecxe
  • 11.4k
  • 11
  • 51
  • 107

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();

you can use JavaScriptExecutor where you can use methods like getElementById and getElementByName

WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
JavascriptExecutor myExecutor =   ((JavascriptExecutor) driver);
  myExecutor.executeScript.   ("document.getElementsByName('q')[0].value='Kirtesh'");
 driver.quit();

You can use JavaScriptExecutor where you can use methods like getElementById and getElementByName:

WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com"); 

JavascriptExecutor myExecutor =   ((JavascriptExecutor) driver);
myExecutor.executeScript.   ("document.getElementsByName('q')[0].value='Kirtesh'");
 
driver.quit();
Source Link

you can use JavaScriptExecutor where you can use methods like getElementById and getElementByName

WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
JavascriptExecutor myExecutor =   ((JavascriptExecutor) driver);
  myExecutor.executeScript.   ("document.getElementsByName('q')[0].value='Kirtesh'");
 driver.quit();