Sometimes, sendKeys method does not work on text boxes. In such scenarios, you can use JavascriptExecutor to set the value in edit box. Below method takes 2 arguments. It sets the value passed in second argument in text box identified as first parameter.
What do you think on above selenium topic. Please provide your inputs and comments. You can write to me at reply2sagar@gmail.com
protected void setValueByJavaScript(WebElement element,String value) { ((JavascriptExecutor) driver).executeScript("arguments[0].value ='"+
value+"';", element);
}
What do you think on above selenium topic. Please provide your inputs and comments. You can write to me at reply2sagar@gmail.com
No comments:
Post a Comment