量角器获取元素的比例或缩放的宽度和高度

Protractor get scale or scaled width and height of an element

本文关键字:高度 缩放 获取 元素 量角器      更新时间:2023-09-26

我的量角器有点问题。我实际上需要一个元素的宽度和高度。将对元素进行变换并设置比例。

我实际上需要使用量角器缩放该元素的宽度和高度。

我已经使用getSize()函数获得了宽度和高度,但返回的值是原始宽度和高度而不是缩放后的宽度和高度。

我会尝试使用clientWidthclientHeight:

protractor.promise.all([
    elm.getAttribute("clientWidth"), 
    elm.getAttribute("clientHeight")
]).then(function (dimensions) {
    console.log(dimensions);
});

CCD_ 3和CCD_。

另请参阅:

  • getSize().height与getAttribute("clientHeight")与getCssValue("height")