假设我有一个文本区:`
<body contenteditable="true" class="html-editor portlet portlet-blogs cke_show_borders" spellcheck="false"><p><br type="_moz"></p></body>`正如您所看到的,没有id,所以我想使用class属性来标识它。
发布于 2014-01-10 15:48:49
尝尝这个
css=tag.class
tag=HTML tage of the element
class=class of the element
type this in target
css=body.html-editor portlet portlet-blogs cke_show_borders发布于 2012-12-11 15:10:23
使用以下命令:
//body[@class='html-editor portlet portlet-blogs cke_show_borders']发布于 2012-12-11 19:00:34
您必须找到文本字段的Xpath,使用Xpath来标识文本字段和selenium,您必须编写以下命令
type|Xpath of text field | your content 您可以在FF浏览器中安装firepath插件,通过firebug获取文本框的xpath,EG://*[@id='search']/div/input
https://stackoverflow.com/questions/13815154
复制相似问题