如何替换 canoo webtest 中的 URL
我有一个 canoo webtest,我想用新的 URL 替换当前文档 URL,然后继续访问该 URL。具体来说,我想用“view-old.html”替换当前文档 URL 中的字符串“view.html”,并导航到新 URL。
该脚本如下所示:
<clickButton htmlId="newDocForm_add"/>
<!-- get the url of the newly loaded page and replace "view" with "view-old" -->
< ??? >
<invoke description="go to modified URL" url="...newUrl..."/>
I have a canoo webtest where I would like to replace the current document URL by a new one, and proceed to that URL. Specifically, I'd like to replace a string "view.html" in the current document URL by "view-old.html" and navigate to the new URL.
The script would look like:
<clickButton htmlId="newDocForm_add"/>
<!-- get the url of the newly loaded page and replace "view" with "view-old" -->
< ??? >
<invoke description="go to modified URL" url="...newUrl..."/>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看一下常规步骤 - 它们将帮助您归档所需的所有内容...
http ://webtest.canoo.com/webtest/manual/groovy.html
Take a look at the groovy steps - they will help you to archive everything you need...
http://webtest.canoo.com/webtest/manual/groovy.html
我最终以不同的方式完成了它,通过从原始 URL 中可以找到的 ID 字段生成修改后的 URL,如下所示:
I fianlly ended up doing it differently, by generating the modified URL from an ID field that can be found in the original URL, something like: