2012-12-11 56 views
0

硒IDE識別文本字段說我有一個文本區域:`如何使用類屬性

<body contenteditable="true" class="html-editor portlet portlet-blogs cke_show_borders" spellcheck="false"><p><br type="_moz"></p></body>` 

正如你看到沒有ID,所以我想用class屬性idenify它。

回答

0

使用此:

//body[@class='html-editor portlet portlet-blogs cke_show_borders'] 
0

你必須找到文本字段的XPath中,使用XPath來識別文本字段和硒IDE你必須寫下面的命令

type|Xpath of text field | your content 

可以安裝firefox插件在FF瀏覽器中,並通過螢火蟲文本框的xpath, EG://*[@id='search']/div/input

+0

@Kameron請檢查我的回答是否有幫助。 –

1

試試這個

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 
+0

http://stackoverflow.com/questions/11521602/selenium-get-element-class-and-text?rq=1 –

+0

http://stackoverflow.com/questions/13175246/how-to-add-selenium-test -coverage-for-jquery-autocompleter-text-field?rq = 1 –

+0

http://stackoverflow.com/questions/19989512/selenium-how-to-click-on-the-calendar-date-by-text-inside -dv-attribute?rq = 1 http://stackoverflow.com/questions/21102937/typing-characters-in-rich-text-editor-using-selenium-ide?rq=1 http:// stackoverflow的.com /問題/ 6509719 /硒 - 是 - 未填充功能於密碼屬性上形?RQ = 1 –