cancel
Showing results for 
Search instead for 
Did you mean: 

Service name property from project property

SOLVED
Highlighted
Occasional Contributor

Service name property from project property

Hi I'm trying to set the service name from the project properties but ${#Project#ENV} doesn't seem to be substituting. 

In the project custom properties I have ENV with value.

 

Is such a thing possible?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Leader

Re: Service name property from project property

@fardude 

 

I don't think that this is possible by property expansion, if you want to do this than you can do this with groovy script as below

 

interface1 =  testRunner.testCase.testSuite.project.getInterfaceAt(0)
interface1.setName("New__Name")

 

You can apply logic on interface if there are multiple interface in your Project.

Hope this will help you 🙂


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

11 REPLIES 11
Highlighted
Community Leader

Re: Service name property from project property

@fardude :

 

Didn't get you properly could you please elaborate more what you are trying to do and where exactly you are getting stuck also if possible please attach any screenshot for more clearity.

 


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
Highlighted
Community Hero

Re: Service name property from project property

Hey @fardude,

If i understand correctly then its completely possible.

Can i ask that you describe in a bit more detail exactly how youve got your custom project properties setup and how youre sourcing them?
Youre using ${#Project#ENV}, so im guessing you have a custom project property entitled 'ENV', but theres obviously a problem if this property isnt being expanded when youre using it, so the more info people have the better.

Oh one thing. Where youre using '${#Project#ENV}', can you confirm you are using the word 'Project' rather than the project's name? If you were to use the project name youd need to remove the first # character so instead of '${#Project#ENV}' it would be '${Projectname#ENV}'.

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Occasional Contributor

Re: Service name property from project property

Thanks @richie , I tried all of them and it's still not expanding.

 

I'm trying to get the service name to show as the property value of ENV in the custom project properties.

I have tried ${#Project#ENV} and ${ProjectName#ENV}

 

The expansion works fine when I used it for endpoints.

Highlighted
Community Leader

Re: Service name property from project property

@fardude :

 

Could you please provide any screenshot, where you want to fetch the properties value.

 


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
Highlighted
Occasional Contributor

Re: Service name property from project property

fardude_0-1592746139226.png

 

Highlighted
Community Hero

Re: Service name property from project property

Hey @fardude,

Oh! I get what youve done now!

Those arent custom project parameters. Those are the project's static (cant think of a better word than 'static' parameters).

 

a service/API doesn't actually have any customisable properties.

Just to be clear, you want to pick up the service name for use somewhere. Is that correct?  Can you just give us a bit more understanding on what youre trying to do/want to do?  The reasons for doing it?   Im not picking holes in what you've done fella - I just need to make sure I understand what you want to do and why - cos we've wasted a bit of back and forth messaging cos I misunderstood what you had setup.

Nice one,

Rich

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Community Leader

Re: Service name property from project property

@fardude :

 

Didn't get you, why you want to change the service name at run time.

 

Could you please elaborate your use case, as i don't think Service Name will affect on result of your test cases.

 


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
Highlighted
Occasional Contributor

Re: Service name property from project property

I just wanted the service name to reflect the value in the project custom properties, it doesn't effect any test cases. I can do without it.

Highlighted
Occasional Contributor

Re: Service name property from project property

I just wanted the service name to reflect the value in the project custom properties, it doesn't effect any test cases. I can do without it. I just wanted to see it on the screen.

So in this case, the expansion won't work right because service/API don't have customizable properties?

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors