【问题标题】:cut length of string Selenium ide字符串Selenium ide的切割长度
【发布时间】:2013-04-03 13:38:37
【问题描述】:

切割字符串长度所需的代码是什么?
假设我有${var}="abcdefghijklmn"${var2}="cdefghijklmnopqr",但我希望它们在 6 个字母后都停止。所以${var} 将是"abcdefgh"${var2} 将是"cdefghij"

【问题讨论】:

  • 为什么要 IDE 这样做?
  • 我通过 GO-Pipline 运行了几个测试,我需要比较两个字符串,但其中一个总是比另一个长,我需要它们都具有相同的长度为了比较它们
  • 没人知道怎么做吗? @marksweb

标签: string selenium string-length


【解决方案1】:

这是“如何将字符串 1 从 20 中拆分为“1”和“20”的复制和粘贴

|store | 1 out of 20 | Text |

|storeEval | "${Text}".split(" ")[0] | firstsection |

|echo | ${firstsection} | |

[info] echo: 1

|storeEval | "${Text}".split(" ")[3] | lastsection |

|echo | ${lastsection} | |

[info] echo: 20

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-09-10
    • 2013-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多