【发布时间】:2015-11-06 12:46:39
【问题描述】:
我有以下代码,
<body>
<table>
<tr>
<td style= "width:30%;">
<img class = "new" src="images/new-icon.png">
<td>
<h1>Hello there!</h1>
<p>Thanks for logging in
<span class = "blue">image edit application</span>.
Get started by reading our
<a href = "https:abc">documentation</a>
or use the xxxxxxxxxxxx.
</table>
</body>
在上面的代码中,我想在“Hello there!”之后添加额外的文本。在标题中
使用 selenium webdriver 和 java 脚本。请帮忙。我尝试通过使用 xpath 定位并尝试使用 sendKeys 添加文本来单击 Hello there。我没有看到添加任何文本,代码也没有抛出任何错误。 我正在尝试使用 selenium 在在线编辑器上编辑 html 文件
【问题讨论】:
-
请分享您为使用 selenium 发送文本而编写的代码。您也可以仅在文本框、富文本框中插入文本。你想插入h1标签吗?似乎不可能。
-
你确定那里的文字是可编辑的吗?它看起来不像来自您提供的 HTML。
标签: javascript selenium selenium-webdriver