cancel
Showing results for 
Search instead for 
Did you mean: 

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

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
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

Changing options from outside of TestComplete

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!
Top Kudoed Authors