我需要使用一个变量,其值是根据 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)
},