Wednesday, 27 August 2014

How can we enter a text without using SendKeys in Selenium Webdriver

We can enter a text in text box using SendKeys .but we can do this without using the send keys method also.


public class send{

public static void setattribute(WebElement element,String attributename,String Value){

WrapsDriver wrappedElement=(WrapsDriver)element;
JavascriptExecuter driver =(JavaScriptExecutor)wrappedElement.getWrapedDriver;
driver.executeScript(arguments[0].setAttribute(arguments[1],arguments[2]",element,
                                    attributeName,value);
}


To know FAQ's on Selenium Please ClickHere
To know SQL's Queries Required For Testers Please ClickHere

1 comment:

  1. Could you please explain with example and how to enter text without sendKeys?

    ReplyDelete