1
我需要使用一個變量,其值是基於CSS樣式像素確定的。 測試找到左側像素的值,然後選擇特定的單元格。但是當我運行這個測試時,這個值總是爲0而不是實際應該是的。在實習生功能測試中使用變量
'Test' : function() {
var left = 0;
var remote = this.remote;
return remote
.setFindTimeout(5000)
.findByXpath("//div[@class = 'grid']//div[@class = 'gridCell' and position() = 1]/div[3]")
.getAttribute("style")
.then(function(width) {
left = parseInt(width.substring(width.indexOf("left")+6,width.indexOf("width")-4));
}).end()
.f_selectCell("", 0, left)
},