【问题标题】:How to check whether the element is visible inside the Foreach loop in Galen?如何检查元素是否在 Galen 的 Foreach 循环中可见?
【发布时间】:2017-08-10 06:53:52
【问题描述】:

我正在尝试检查元素是否可见,如果可见则仅检查 UI 属性,但以下命令给出错误“异常是 com.galenframework.parser.SyntaxException:JavaScript 错误内部语句”

@forEach [stats_count-*] as itemName, index as i
   @if ${isVisible("stats_count-"+{index})}
       ${itemName}:
            height 30 to 35 px
            width 35 to 45 px
            css font-size is "16px"
            css font-family contains "NeoRegular"
            css color is "rgba(82, 82, 82, 1)"

我也尝试了下面的代码,虽然它没有给出错误但它也跳过了所有可见元素。

@if ${isVisible("stats_count-*")} 

有什么我遗漏的吗?

【问题讨论】:

  • 我真的不知道 galen 是什么,但是您可以检查元素的可见性 css 值。我很确定 javascript 中没有 isVisible 方法。

标签: javascript galen


【解决方案1】:

得到了答案。如果其他人遇到问题,请在此处发布答案。

@forEach [mobile_text-*] as itemName, index as i
    @if ${isVisible(itemName)}
      ${itemName}:

【讨论】:

    猜你喜欢
    • 2017-01-01
    • 2012-04-21
    • 1970-01-01
    • 2011-04-02
    • 2012-07-08
    • 1970-01-01
    • 2013-11-09
    • 2022-01-07
    • 1970-01-01
    相关资源
    最近更新 更多