<table class="gridtable" cellspacing="0" __gwtcellbasedwidgetimpldispatchingfocus="true" gwtcellbasedwidgetimpldispatchingblur="true" style="width: 100%;">
<thead>
<colgroup>
<tbody style="">
<tr class="GORM0XEDKD GORM0XEDME" onclick="">
<td class="GORM0XEDJD GORM0XEDLD GORM0XEDMD GORM0XEDNE">
<td class="GORM0XEDJD GORM0XEDLD GORM0XEDNE GORM0XEDGE">
<div style="outline:none;" tabindex="0"></div>
</td>
</tr>
</tbody>
<tbody style="display: none;">
<tfoot style="display: none;">
</table>
Xpath for the text field -
EmailTemplateEditorTemplateName= By.xpath("//*[contains(@class,'GORM0XEDJD GORM0XEDLD GORM0XEDNE GORM0XEDGE')]/div[1]");
Run Code Online (Sandbox Code Playgroud)
尝试了以下选项。但所有这些都无法将文本发送到 EmailTemplateEditorTemplateName 文本字段
1. driver.findElement(DesignerLocators.EmailTemplateEditorTemplateName).sendKeys("yahooo");
2. this.WaitForElement(DesignerLocators.EmailTemplateEditorTemplateName);
WebElement tempname = driver.findElement(DesignerLocators.EmailTemplateEditorTemplateName);
JavascriptExecutor rightexecutor = (JavascriptExecutor)driver;
rightexecutor.executeScript("arguments[0].setAttribute('value','yahoo')", tempname);
3. WebElement Element=driver.findElement(DesignerLocators.EmailTemplateEditorTemplateName);
Actions builder = new Actions(driver); …Run Code Online (Sandbox Code Playgroud)