Ask a Question

Using a variable in a URL

New Contributor

Using a variable in a URL



I am wanting to use a variable that I have created in a key word test and add it to a URL so I can launch it via a python script and was wondering how to do that.


I have used set variable value in the keyword test to get an ID from the screen e.g. 12345. I then want to write a python script to launch a browser with a specified url and that variable value on the end e.g. Browsers.Item["chrome"}.Run(" Then have the variable id added to the end. How can I grab the variable value and add it to the end of the url in the script?



Super Contributor

The script coding will look something like,


Browsers.Item["chrome"].Run("" + MyVariable)






In @rraghvani 's example, be sure you have any extra characters or spaces stripped out of MyVariable before you do this or the URL will be bad.  If MyVariable is already clean, then no worries.





[Community Hero]
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.

Thanks for your help
Showing results for 
Search instead for 
Did you mean: