我正在使用量角器實現角度js自動化。我想用css來從以下要素結構的「發發出頭的」文本identifier-使用css實現量角器自動識別圖像對象
<div class="Itemlistcontainer">
<ul class="itemlist sortlist ui-sortable">
<!-- ngRepeat: Item in Items | orderBy:CustomSort:false --><li ng-repeat=" Item in Items | orderBy:CustomSort:false" ng-show="!searchinput || ([Item.Name]|filter:searchinput).length" ng-class="{ 'itemdisabled' : !CanUseTask(Item) || deactivate }" class="ng-scope ui-draggable">
<div bo-attr="" bo-attr-id="Item.Id" bo-attr-title="Item.Details | html2string" class="label itemlabel" id="3d991564-a1a9-49ab-8659-a26e00fbfae6" title="Blah blah blah.">
<span>
<i ng-class="itemIconClass(Item)" style="margin-right: 5px;" class="fa fa-something"></i>
</span><span bo-text="item.Name | ellipse : 32">Item Name</span>
</div>
<!--ngRepeat: Item in Items....and the list goes on
我需要下的項目是什麼項目要知道,發現這個「發發出頭」。我正在使用element(By.css('ul.itemlist i.itemIconClass(Item)').getAttribute('class').getText()
這是行不通的。
'的getAttribute(「類」)。gettext的()'不會有任何效果,你正在做這裏沒有'class'屬性,'getText()'起作用,因爲'ElementFinder'是可鏈接的。 – 2014-10-07 16:31:21