I want to enter the text "ABCD" as shown in the below image of https://translate.google.com/
Tried the following ways but failed.
sendKeys()--failed.
driver.findElement(By.xpath("//textarea[@id='sourceis']")).sendKeys("ABCD"); driver.findElement(By.xpath("//textarea[@id='source-is']")).sendKeys(Keys.TAB"ABCD");
set the value property using JavaScriptExecutor--failed
JavascriptExecutor js = (JavascriptExecutor)driver; js.executeScript("document.getElementById('source-is').setAttribute('value', 'ABCD')");
first clear() field and then sendKeys()--failed.
driver.findElement(By.xpath("//textarea[@id='source-is']")).clear(); driver.findElement(By.xpath("//textarea[@id='source-is']")).sendKeys(Keys.TAB,"ABCD");
Please provide the solution to get it done.