我对量角器有点问题。我实际上需要一个元素的宽度和高度。在元素上,将进行转换,并设置刻度。
实际上,我需要使用量角器的元素的缩放宽度和高度。
我已经使用getSize()函数获得了宽度和高度,但返回的值是原始宽度和高度,而不是缩放的宽度和高度。
发布于 2016-03-23 13:28:56
我会尝试使用clientWidth和clientHeight
protractor.promise.all([
elm.getAttribute("clientWidth"),
elm.getAttribute("clientHeight")
]).then(function (dimensions) {
console.log(dimensions);
});elm.getCssValue("width")和elm.getCssValue("height")是另一种选择。
另请参阅:
https://stackoverflow.com/questions/36179156
复制相似问题