小编Dav*_*ngo的帖子

如何在 Cypress 中获取并存储最后一个 URL 字符串

我有一个网址https://www.xxx/xxxx/xxx/1234。我只需要数字 1234 并将它们存储在我的全局变量中。

cy.log(this.href.substring(this.href.lastIndexOf('/') + 1));
Run Code Online (Sandbox Code Playgroud)

testing url automation cypress

3
推荐指数
1
解决办法
610
查看次数

标签 统计

automation ×1

cypress ×1

testing ×1

url ×1