MxfrdA
MxfrdA

Reputation: 171

Jenkins pass browser URL as parameter of a Maven Selenium Java test

I'm looking for a solution to pass a variable ( an URL in my case ) in parameter in Jenkins when the jobs is built

I want to do this, because i have to execute the same test in various website. Pass the URL as parameter will be a good way to don't have to copy/paste 10 times the same maven project just to specifiy an URL.

For my test I use selenium and everything is developped in Java.

Do you have some ideas ? I see some post with solutions, but nothing works for me.

Thanks for help !

Upvotes: 0

Views: 1385

Answers (1)

Bruno Lavit
Bruno Lavit

Reputation: 10382

Here is a solution using the Matrix Project plugin.

Create a multi-configuration job and add an user defined axis like below:

enter image description here

Next, use this axis in your build step:

enter image description here

Jenkins will launch 3 jobs to test the 3 different values:

enter image description here enter image description here

Output for the 3 jobs:

enter image description here enter image description here enter image description here

Does it help? :)

Upvotes: 2

Related Questions