cancel
Showing results for 
Search instead for 
Did you mean: 

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

Highlighted
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
Highlighted
Occasional Visitor

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

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.

Highlighted
Community Hero

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

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"

 

 

Highlighted
Occasional Contributor

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

 

Keywordtest.pngMappedobject.png

how can i do this in mapped properties?

Highlighted
Community Hero

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

NameMappingPropertyAsVariable.png

New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
A new challenge is here!

Create a function to drag one element to another for the TechCorner tag!

Will you dare to take the challenge?


Scripts created in July:
- Passing custom command-line arguments as a test parameter
Top Kudoed Authors