cancel
Showing results for 
Search instead for 
Did you mean: 

getting the tfs BuildNumber when running the ReadyAPI command line on Octopus

SOLVED
New Contributor

getting the tfs BuildNumber when running the ReadyAPI command line on Octopus

I am needing to get the tfs BuildNumber to insert into a table within my TestCase setup (using a Groovy step).  I am running the Testcase via the command line in my Octopus build.  From reading the documentation on my build the tfs build number is a predefined variable of $(Build.BuildNumber). How do I get access to this variable from the build into my Groovy teststep in my testcase? 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Moderator

Re: getting the tfs BuildNumber when running the ReadyAPI command line on Octopus

Hi @tsmith0422,

 

If your build agent sets environment variables in the system as Jenkins does, you should be able to access those variables from a Groovy script within ReadyAPI the same way as it's described here: https://smartbear-cc.force.com/portal/KbArticleViewer?name=How-to-get-Jenkins-environment-variables-... 

 

Natalie
Customer Care Team

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓

View solution in original post

4 REPLIES 4
Highlighted
Community Manager

Re: getting the tfs BuildNumber when running the ReadyAPI command line on Octopus

Hi @tsmith0422,

 

This question can be very specific to your test environment. @nmrao@richie@msiadak, is there anything you can suggest here?

 

 

---------
Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Moderator

Re: getting the tfs BuildNumber when running the ReadyAPI command line on Octopus

Hi @tsmith0422,

 

If your build agent sets environment variables in the system as Jenkins does, you should be able to access those variables from a Groovy script within ReadyAPI the same way as it's described here: https://smartbear-cc.force.com/portal/KbArticleViewer?name=How-to-get-Jenkins-environment-variables-... 

 

Natalie
Customer Care Team

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓

View solution in original post

Highlighted
Community Hero

Re: getting the tfs BuildNumber when running the ReadyAPI command line on Octopus

It is also possible without setting environment variable.

Use project level custom property, BUILD_NO and pass that value from commandline option to testrunner utility (hoping that it is same utility used for executing the tests)

Hope you knew how to access project level property in groovy script.


Regards,
Rao.
Highlighted
Community Manager

Re: getting the tfs BuildNumber when running the ReadyAPI command line on Octopus

Thank you everyone!

 

@tsmith0422 did the suggestions help? Please share your progress with us!


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Want a fun and easy way to learn ReadyAPI and show off your skills? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Compare an expected JSON value and actual response in Events

Participate!

Fetch value/data from JSON response using Groovy Script

See replies!

Filtering data retrieved from a DataSource

See replies!

Get data from Petstore and add it to Excel sheets

Participate!
Top Kudoed Authors