简体   繁体   English

如何在机器人框架中将变量用作url的一部分

[英]How to use a variable as part of url in robot framework

I am trying to go to an url using some variables in the path. 我正在尝试使用路径中的一些变量访问URL。 The code sample is as follows: 代码示例如下:

go to    http://localhost:5000/api/v1/${ind_id_r}

When i try to run it, it actually tries to open the url as is , ie " http://localhost:5000/api/v1/ ${ind_id_r}" instead of replacing the variable ${ind_id_r} in the url. 当我尝试运行它时,它实际上尝试按原样打开url,即“ http:// localhost:5000 / api / v1 / $ {ind_id_r}”,而不是替换URL中的变量$ {ind_id_r}。

Is there any way to make Robot Framework to replace the variable t its value and navigate to the correct url? 有什么方法可以使Robot Framework替换变量t的值并导航到正确的url?

Thanks in advance 提前致谢

Well, the solution was to use Catenate function and pass the value as the url. 好的,解决方案是使用Catenate函数并将值作为url传递。

${Req}  Catenate    SEPARATOR=  http://localhost:5000/  ${ind_id_r}
go to   ${Req}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM