Join the Stack Overflow Community
Stack Overflow is a community of 6.7 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

Html code

<input type="text" class="input-txt" data-bind="value: Email,qtipValMessage:Email" id="txtEmail" maxlength="160" oncopy="return false" onpaste="return false" title="Please enter the Email" data-orig-title="">

my Java code

WebElement email = driver.findElement(By.id("txtEmail"));
new Actions(driver).moveToElement(email).perform();
email.clear();
email.sendKeys("[email protected]");

while executing my code its provide an error message "Element is not currently interactable and may not be manipulated"

because html code mapped with "oncopy" and "onpaste" tag (return false), so that sendKeys() failed during the execution

please help how will we pass the value in this field

share|improve this question

The regular Selenium api has a "set value" method. I don't remember it off the top of my head but if you can't find it, you can always use a JavascriptExecutor as a workaround:

WebDriver driver; // Assigned elsewhere
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("document.getElementByID('elID').setAttribute('value', val )");
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.