Now i am able to select the iframe properly and able to click at the table cell location also, But not able to type anything :( in there, trying different options ( JavaScripts etc)..but not working...
driver.switchTo().frame("wysiwygTextarea_ifr");
WebElement editable = driver.switchTo().activeElement();
WebElement cell1 = editable.findElement(By.xpath("//*[@id='tinymce']/table[1]/tbody/tr[2]/td[2]"));
editable.findElement(By.xpath("//*[@id='tinymce']/table[1]/tbody/tr[2]/td[2]")).click();
global.Sleep(4000); // custom function.
new Actions(driver).moveToElement(cell1).perform();
editable.findElement(By.xpath("//*[@id='tinymce']/table[1]/tbody/tr[2]/td[2]")).sendKeys("123456");
but test is failing saying - "Failed to send keys because cannot focus element"
Some how it is not able to focus. That's the reason i kept Click before at least it click in that location, click is working, but not sendkeys. Tried different javascript functions also, but not working.
Browser :- Chrome. If i run the same test on Firefox browser then script is passing but it is not typing anything in that cell.
Any help will be appreciated.
// JavascriptExecutor js = (JavascriptExecutor) driver;
// String script = "document.getElementByXpath('//*[@id='tinymce']/table[1]/tbody/tr[2]/td[2]').setValue('123456')";
// js.executeScript(script);
//((JavascriptExecutor) driver).executeScript("arguments[0].setAttribute('value', '123456');", cell1);