Тёмный

How to pass Parameters at Run time via Maven Command | Pass username & password to Selenium testcase 

AJ AUTOMATION
Подписаться 6 тыс.
Просмотров 11 тыс.
50% 1

In this video , I have explained how we can pass username and password to Login testcase at Run time with Maven Command.
How to pass Parameters at Run time via Maven Command |Pass username & password to Selenium testcase.
1. Create a Maven Project
2. Add some dependencies in pom.xml
3. Add properties in the pom.xml
-Create 2 properties
4. Define testResources and provide directory value where properties file is present
and Set Filtering= true
5. Create a properties file under src/test/resources
6. Read that properties file and fetch data and use in testcases
7. Run the Maven Project and pass values along with mvn cmd
Git Repo: github.com/aja...
==========================
******AJ AUTOMATION*****
==========================
Hi guys, Please share and Like the content whichever you find informative to reach more beginner candidates learning Test Automation. Thanks for your Support !!
==:Useful Playlists for learning Test Automation:==
✅ Let's Learn the Concept in 5 To 10 Mins :=
• Test Automation Interv...
✅ Selenium series videos Playlist :=
• Selenium tutorial for ...
✅ Maven Tool videos playlist :=
• Maven Tool - Learn Bas...
✅ Selenium WebDriver Exceptions Playlist :=
• Selenium WebDriver Exc...
✅ Selenium Grid With Docker:==
• Selenium Grid With Doc...
✅ Upload and Download Files in Selenium :=
• Selenium WebDriver - U...
✅ Excel and CSV files operations :=
• Excel and CSV -- Read ...
✅ Java Language Concepts :=
• Java Language Concepts...
✅TestNG Framework Videos:=
• TestNG Introduction an...
✅ Become Master in Xpath:=
• Xpath Introduction
✅ Protractor series videos playlist :=
• Let's Learn Protractor...
✅ Recent Uploads :=
• Recent Uploaded Videos
✅ GitHub Repo:= github.com/aja...
⚡️ Thanks for your support !! ⚡️
*** Thanks for watching !!***

Опубликовано:

 

18 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 40   
@chinezucu-playu2117
@chinezucu-playu2117 Год назад
The simplest solution i found after spending several hours on this problem. Thank you very much!
@AJAUTOMATION
@AJAUTOMATION Год назад
Great 👍... Happy to see that video helped you... Thanks for watching 🙂👍
@crhoads1024
@crhoads1024 2 года назад
This was the most straight forward, easy to follow and thorough explanation I have ever seen. Thank you SO MUCH! This has helped out a great deal!
@AJAUTOMATION
@AJAUTOMATION 2 года назад
Thanks @chris for ur giving ur time to writing the feedback. It certainly gives motivation to create more such videos. I am glad that video helped you. Thanks for watching...
@vanidevim4773
@vanidevim4773 Год назад
I Agree
@rakshithmkumar9280
@rakshithmkumar9280 3 года назад
Thanks for the simple yet detailed explanation. Helped in brushing up the concept.
@vanidevim4773
@vanidevim4773 Год назад
Your video is very good and easy to understand, keep it up. Post more videos.
@AJAUTOMATION
@AJAUTOMATION Год назад
Thanks for watching and your valuable feedback 🙂
@hiteshsharma1343
@hiteshsharma1343 3 года назад
really nice AJ. keep it up. Nicely explained..
@prabhuprasad59
@prabhuprasad59 Год назад
Hello sir, Thank you for the video. I am using Maven cucumber BDD project. I have config.properties file. How to encrypt and decrypt the username and password in that project. Kindly make video. I see lot more video for only in one java class. But I did not see the best practice for using the encryption and decryption. thank you.
@kiransingh8239
@kiransingh8239 2 года назад
too good explanation ,thanks a lot
@AJAUTOMATION
@AJAUTOMATION 2 года назад
Thanks for watching @kiran
@letsmakefun60
@letsmakefun60 2 года назад
Thank you so much
@pearlshikha
@pearlshikha 3 года назад
Hi, thanks for detailed explanation but I am facing a difficulty. It is printing the value with $ which I have given in property file as a variable. Any obvious mistake I am making?
@AJAUTOMATION
@AJAUTOMATION 3 года назад
You must be missing providing curly { } brackets in the .properties file for username and password like uName=$username Pwd=$password. So make sure to use - uName=${username} Pwd=${password}
@pearlshikha
@pearlshikha 3 года назад
@AJ AUTOMATION Thanks for replying.I am using curly braces correctly but facing this issue. I have downloaded your project from github and its working fine there so definitely I am doing something wrong somewhere :(
@kislayapant6119
@kislayapant6119 2 года назад
Awesome video sir. One question sir, if I want to hide my password when I am entering its value in console. How can I acheive it can you please tell ?
@AJAUTOMATION
@AJAUTOMATION 2 года назад
Hi @kislaya, Unfortunately in java or selenium there is no mechanism available to hide user data. There is Base64 class in java to encrypt and decrypt the data but still anyone who can access the project can easily see the original pwd value. I don't think it is required to hide pwd in automation in real time projects as only team members with VPN connection on are allowed to access it and usually id / pwd keeps on changing time to time for multiple servers we working on..so it is better to keep these values visible instead of hiding which also helps in debugging login issues. Thanks for watching ! Plz like and share the content whichever you find informative to reach more candidates learning automation.
@tomaszcichon8374
@tomaszcichon8374 3 года назад
Thanks for the video :)
@AJAUTOMATION
@AJAUTOMATION 3 года назад
Welcome! & Thanks for watching.👍 Please share the content if you like it 🤗
@nagalakshmimulay3743
@nagalakshmimulay3743 3 года назад
@@AJAUTOMATION hi, how can end user is identify whether open browser is chrome or safari ? without user defined logs
@AJAUTOMATION
@AJAUTOMATION 3 года назад
@@nagalakshmimulay3743 for this u can print driver capabilities where u will see browser name, version, platform, driver version etc. Plz watch this for the same: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-kPa6LXHpMS8.html
@jony-zt3in
@jony-zt3in 2 года назад
Thanks!!, its works fine for me!. Its possible with gradle?
@AJAUTOMATION
@AJAUTOMATION 2 года назад
Thanks Jon for asking but I haven't tried yet for gradle.. So Not sure about it... Thanks for watching 👍
@jony-zt3in
@jony-zt3in 2 года назад
@@AJAUTOMATION it is possible to send a default value in case of not sending the command by maven? example : "mvn clean install" and that he take the user and pass from the other side in case it is not sent
@AJAUTOMATION
@AJAUTOMATION 2 года назад
@@jony-zt3in set default values in pom.xml defaultUsername defaultPassword These values would be used with mvn clean install if user do not provide values while running maven command...
@jony-zt3in
@jony-zt3in 2 года назад
@@AJAUTOMATION Thanks you are the best!!
@ajayabal3569
@ajayabal3569 2 года назад
Hi, I am used the same code but getting error when run the code "There was an error in the forked process Cannot find class in classpath: setupTest.WebSetupTest" like this can you help me
@AJAUTOMATION
@AJAUTOMATION 2 года назад
have u used the same code shown as example in video or u have defined ur own java classes and methods.
@ajayabal3569
@ajayabal3569 2 года назад
@@AJAUTOMATION methods and class are different but i just executed this part only . It shows this error
@archanamuthukrishnan6465
@archanamuthukrishnan6465 2 года назад
Hello Sir, Thanks for video.Apart from Base64 java class is there any other way to send password in encrypted way ?
@archanamuthukrishnan6465
@archanamuthukrishnan6465 2 года назад
I am automating my project web app using my password .what if I need to share my code in GIT .should I need to share my properties file , or class which encodes my password in GIT ?
@archanamuthukrishnan6465
@archanamuthukrishnan6465 2 года назад
And when we integrate with jenkins shall I provide my password in encrypted format ?is there a way?
@AJAUTOMATION
@AJAUTOMATION 2 года назад
I don't think if it is absolutely required to encrypt pwd used in the automation as those would be visible for your team memeber only having access to that project and with VPN connection only. So in the project we usually keep username , pwd visible doesn't matter if you are using properties file or reading it from excel or csv or from db itself.
@1901rajan
@1901rajan 2 года назад
Followed the steps but still getting below error: I tried the below solution :- in global.properties file defined values like: baseUrl=${Urlvalue} in pom.xml added UTF-8 1.7 1.7 ${Urlvalue} And running test like mvn clean test -DbaseUrl=x its giving the below error:- [INFO] [ERROR] Errors: [ERROR] parameterValue cannot be null [ERROR] Illegal character in path at index 1: ${Urlvalue} [INFO] [ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0 [INFO] [ERROR] There are test failures.
@AJAUTOMATION
@AJAUTOMATION 2 года назад
it should be like -- UTF-8 1.7 1.7 defaultURLValue ${Urlvalue} is not required.. And in in global.properties file change baseUrl=${baseUrl}
@1901rajan
@1901rajan 2 года назад
@@AJAUTOMATION Thanks for the response ....but I tried the solution u provided but still getting the same error
@akshaygadhave3049
@akshaygadhave3049 4 месяца назад
Please share your LinkedIn profile AJ😊
@AJAUTOMATION
@AJAUTOMATION 4 месяца назад
I am unable to access LinkedIn profile some issue, so Wil create a new one and share with all of you...
Далее
연준 (YEONJUN) ‘GGUM’ Official MV
02:44
Просмотров 3,2 млн
КОСПЛЕЙ НА СЭНДИ ИЗ СПАНЧБОБА
00:57
Jenkins parameterisation to run selenium tests
31:27