Selenium Webdriver处理富文本框

<div class="iteye-blog-content-contain" style="font-size: 14px">

直接通过js操作,不需要switchTo跳转,代码如下:
        String text = "a new post";
         String js = "document.getElementByIdx_x('content_ifr').contentDocument.write('" + text + "');";
         ((JavascriptExecutor) dr).executeScript(js);

</div>

猜你喜欢

转载自changfengfu.iteye.com/blog/2191591