To type in a text field/text box we use sendKeys command. But some times sendKeys will not work some of the text fields. In those situations one of the alternative is using JavaScript. We can use Java script to type in text field.
In below example I used JavaScript to type in text field.
Below is syntax:
((JavascriptExecutor) driver).executeScript(" arguments[0].value = 'some text';",driver.findElement(By. XPath('your xpath')))
In below example I used JavaScript to type in text field.
Below is syntax:
((JavascriptExecutor) driver).executeScript("
Javascript Training in Chennai JavaScript Online Training
ReplyDelete