Ask a Question

How to concatenate URL and use the variable/parameter for common part of url

jawed
Occasional Contributor

How to concatenate URL and use the variable/parameter for common part of url

Hi,

I have recorded different Keyword tests for different functionality. like for login funcationality i have created login keyword test and recorded script and for logout created logout keyword test and so on. I want to parameterized the URL which had a common part. ex: http://abc.com:8080/login,  http://abc.com:8080/logout. I want to do this because whereever server changes i dont need to change everytime in the script just i will change the value of parameter/variable.

4 REPLIES 4
karam
Occasional Visitor

you read the URL from property file using groovy and than replace the part that is changing on basis of some condition before setting the final URL.

baxatob
Community Hero

Hi,

You can store the base URL in the variable, say -

 

baseURL = "http://abc.com:8080/"

 

Then use it in your test as a Code Expdession parameter like: 

 

Project.Variables.baseURL + "login"

 

 

jawed
Occasional Contributor

 

Keywordtest.pngMappedobject.png

how can i do this in mapped properties?

baxatob
Community Hero

NameMappingPropertyAsVariable.png

cancel
Showing results for 
Search instead for 
Did you mean: