简体   繁体   中英

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. 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.

Is there any way to make Robot Framework to replace the variable t its value and navigate to the correct url?

Thanks in advance

Well, the solution was to use Catenate function and pass the value as the url.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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