How can I pass the userName and password from jenkins

387 views
Skip to first unread message

Sanjay Kumar

unread,
Jul 12, 2019, 12:32:28 PM7/12/19
to Jenkins Users
Hi All,

My current project is based on Cucumber+Java+Selenium+Maven. And I am reading userName and password from the CSV file.

But I want to pass the userName and password from the Jenkins. 

Kindly help me how to do?

Thank you in advance!
Sanjay

Ivan Fernandez Calvo

unread,
Jul 13, 2019, 6:10:23 AM7/13/19
to Jenkins Users
Hi,

Here you have a couple of links that explain you how credentials works

https://jenkins.io/doc/book/using/using-credentials/
https://support.cloudbees.com/hc/en-us/articles/203802500-Injecting-Secrets-into-Jenkins-Build-Jobs

Also, I’d recommend to take a look to the documentation https://jenkins.io/doc/book/ and tutorials https://jenkins.io/doc/tutorials/ probably you find useful information

Sanjay Kumar

unread,
Jul 13, 2019, 11:27:10 AM7/13/19
to jenkins...@googlegroups.com
Hi Ivan,

Thank you for sharing the links, Sure I will look in it.

Scenario: In my application, we have around 100 users with a different role, and currently maintaining in all 100user in a CSV file and reading from csv using java code and passing to selenium to login in application. But now I want to pass user from the jenkis-> maven-> test scripts.

could you please help me how to implement using jenkins->maven-> testscripts?



--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/0d10b865-9edb-49a2-857e-6a770f390ed9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ivan Fernandez Calvo

unread,
Jul 13, 2019, 11:46:28 AM7/13/19
to Jenkins Users
I understand that you want to run the same thing 100 times with different users, or something like that, so you have the easy one that it is to use a credential de type file where you store you current CVS file, in this case it does not change too much you current process, you retrieve the file from credentials and store it on a local file.

Other option is to maintain a set of credentials with some kind if pattern as I'd, in that way you can iterate over the 100 credentials.

Finally, if you have the possibility of use Vault or something like that you can retrieve your user*password from the Vault.

All depends on the level of security you need for those 100 credentials.

Reply all
Reply to author
Forward
0 new messages