Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在java的selenium web驱动程序中,在div中获得html/body中编写的文本_Selenium_Testing_Selenium Webdriver_Automation_Qa - Fatal编程技术网

如何在java的selenium web驱动程序中,在div中获得html/body中编写的文本

如何在java的selenium web驱动程序中,在div中获得html/body中编写的文本,selenium,testing,selenium-webdriver,automation,qa,Selenium,Testing,Selenium Webdriver,Automation,Qa,在这段代码中,我想输入id cke_1_内容的文本,输入字段是html/body。我尝试使用xpath和id,但不起作用 如何在文本区域内写入文本 [<div id="cke_1_contents" class="cke_contents cke_reset" role="presentation" style="height: 200px;"><span id="cke_86"

在这段代码中,我想输入id cke_1_内容的文本,输入字段是html/body。我尝试使用xpath和id,但不起作用

如何在文本区域内写入文本

[<div id="cke_1_contents" class="cke_contents cke_reset" role="presentation" style="height: 200px;"><span id="cke_86" class="cke_voice_label">Press ALT 0 for help</span>
<iframe src="" frameborder="0" class="cke_wysiwyg_frame cke_reset" style="width: 1010px; height: 100%;" title="Rich Text Editor, mailContent" aria-describedby="cke_86" tabindex="0" allowtransparency="true">
<html dir="ltr" lang="en">
    <head>
    <title data-cke-title="Rich Text Editor, mailContent">Rich Text Editor, mailContent</title>
    <style data-cke-temp="1">html{cursor:text;*cursor:auto}img,input,textarea{cursor:default}</style>
    </head>
    <body contenteditable="true" class="cke_editable cke_editable_themed cke_contents_ltr cke_show_borders" spellcheck="false">
    <p>Hi, this is test mail</p>
    </body>
</html>
</iframe>
</div>
[按ALT 0以获取帮助
富文本编辑器,邮件内容
html{cursor:text;*cursor:auto}img,输入,textarea{cursor:default}
嗨,这里是测试邮件


要使用iFrame,您首先需要驱动程序.switch to().frame

您所说的“不工作”是什么意思?找不到元素吗?您正在尝试自动化哪个网站?您可以提供其链接吗?还可以提供