TestProject Forum
Powered by leading experts in the test automation community

Passing in parameters (applicationUrl) via Jenkins plugin

I have a jenkins job that will create a test website based on a branch name. This generated site will have an unique URL that I want to be able to call a job and pass in this URL. The URL is not known ahead of time, so I can’t use a CSV.

Any ideas?

In a nutshell, I want to pass, via Jenkins: (note the applicationUrl below) and have the job pass in this applicationUrl as a parameter I can use on my test.

ex:
runtpjob jobId: ‘654’, projectId: ‘123’, waitJobFinishSeconds: 1800, applicationUrl: ‘int-123.example.com

Hi @bstiles,

Thanks for reaching out!
At the moment, we do not support passing parameters through an API call. Passing parameters to a test/job are possible using a data source.
In your case, since you can’t tell in advance what would be the URL, this option will not work.

We already have this feature in our road map and we will add the option to pass parameters in an API call. I will keep you updated of course :slight_smile:

Let me know there’s anything else I can help you with,
Amit

1 Like

Hi @bstiles,

I just wanted to let you know that we’ve added a new section in our API to work with project parameters.
Project parameters are global parameters that can be used among all the tests in your project.

So, you can create project parameters and use them in your tests. Then, through the API, you can update their value, add new parameters, edit them, etc.

Here’s the API documentation: https://api.testproject.io/docs/v2/

Let me know if it helped you :slight_smile:
Amit

That might work. Thanks for following up. I will have to do a bit of research, but seems promising.

Updated my test (simple test) to use a project parameter.

Used the API to update the value of the parameter
run the test, via the API
Update the value to a different value, via the API
run the test again, via the API

Confirm it works. Not super ideal, as it would be nice to pass in the parameters in the job execution api call, but this will work.

Thank you!

Hi @bstiles,

I’m really glad to hear that it’s working fine for you :slight_smile:
We are planning to fully support passing parameters in the job execution API call in the future.

Kind regards,
Amit