Must Know JAVA concepts | Selenium Automation | PART - 4 | Config Property File Reading

So far in this channel, we have given all the input values as hardcoded ones. Hardcoding the values is one of the biggest threat to any programming. This will make our code unmaintainable over a period of time. Selenium code is also not an exception from this. There are plenty of input values we may have to give to our test cases, we should not hardcode them. We have to make them configurable. In order to make the input values configurable, Java has a class called Properties. This property class stores the input as KEY VALUE pair. This is one of the most important concepts and this is needed while creating a live selenium project.
What will we learn in this video:
1. Why do we need to read a property file?
2. What is a property file?
3. How to read a property file using Java?
#Java #ConfigPropertyReading #Properties #LearnAutomationOnline
Best way to reach me (replies will be faster): KZread comment section
Also, you can follow me on Facebook and Instagram.
Facebook: bit.ly/2TqPlis
Instagram: bit.ly/2Ez36rH

Пікірлер: 61

  • @rajasekaran1724
    @rajasekaran17243 жыл бұрын

    Fantastic youtube channel for so called automation Testerssss!!!!! Much impressed with all your tutorials 😍😍😍

  • @shivu2012
    @shivu20122 жыл бұрын

    Very good explanation. Please keep uploading such concepts... Because of that i am subscribing...

  • @ramyabaskaran8859
    @ramyabaskaran88593 жыл бұрын

    Thank you sir. Very clear explanation 🙏

  • @stewwweee
    @stewwweee4 жыл бұрын

    very nice video ji also with little sense of humour .....Thank you sir :)

  • @abarnajayachandran1298
    @abarnajayachandran12982 жыл бұрын

    Nice explanation ..!!! Keep rocking

  • @deepaksundarragavan4697
    @deepaksundarragavan46974 жыл бұрын

    Good to learn 👍 sir we mentioned the location in configure file we using double // if the user give single/ it is work properly eg C:/LEARN/ JAVA/ PROPERTIES

  • @benittoraja5957
    @benittoraja59572 жыл бұрын

    Thank you.

  • @karthikeyansugumar20
    @karthikeyansugumar205 жыл бұрын

    @11.33 It's throwin error. So we are changin line 19 to WebDriver driver=null. What is this error?

  • @prabhu_rajarathinam
    @prabhu_rajarathinam3 жыл бұрын

    Hi bro I thank you for sharing you knowledge with us ☺️ Bro I having issue with config.propertis when export into runnable jar how to fixed that. file not found error occurred please help me out bro I tried looking for solving so far nothing work ...

  • @AbdulMajeed-81
    @AbdulMajeed-814 жыл бұрын

    sir i am getting this error:Exception in thread "main" java.lang.NullPointerException at selenium.OpenGoogle.main(OpenGoogle.java:32) i even tried debug point,in id condition null is passed to the driver

  • @mariselvan2873
    @mariselvan28732 жыл бұрын

    Sir.yenakku property file la browser name and driver location configure panni run panna FileNotFoundException adikuthu with D:\project location\log4j.xml (The system cannot find the file specified) nu varuthu...Please Solution sollungalen

  • @vidyaprakash6196
    @vidyaprakash61964 жыл бұрын

    Arul... your way of teaching is awesome..Can we use property file to give input to all the text box fields in application?For POM which is the best practice to give inputs..excel or from property file.

  • @LearnAutomationOnline

    @LearnAutomationOnline

    4 жыл бұрын

    Both can be used. The best way depends on the need of the application. If you don't have the need to use excel at all or data which will make sense in excel, you can simply go with the property file. There are no best options. Best is based on our requirement

  • @meenavinothviyanmivan
    @meenavinothviyanmivan Жыл бұрын

    Exception in thread "main" java.lang.Error: Unresolved compilation problem: The local variable driver may not have been initialized at extentproject.Classfilewriter.main(Classfilewriter.java:42) Am facing this issue brother. Can you help

  • @dineshk5607
    @dineshk56072 жыл бұрын

  • @manikandanvelayutham4768
    @manikandanvelayutham47682 жыл бұрын

    Hi Sir ur playlist and videos are awsome.it also very clear.but i have one small doubt in the video. if you fixed the environment system variable for webBrowser,at the time how to write the driverLocation.

  • @LearnAutomationOnline

    @LearnAutomationOnline

    2 жыл бұрын

    It's not mandatory to set the browser location in environment variables. You have to set it through your code.

  • @manikandanvelayutham4768

    @manikandanvelayutham4768

    2 жыл бұрын

    @@LearnAutomationOnline ok sir

  • @karthiks3241
    @karthiks32414 жыл бұрын

    Hi bro, am getting this error config.properties (The system cannot find the file specified) though i used throws for IOException and FileNotFoundException. What shall we do for this?

  • @LearnAutomationOnline

    @LearnAutomationOnline

    4 жыл бұрын

    Make sure you provide the correct file location. Using throws condition doesn't mean, it will automatically find the file. Make sure your file is present. And provide the correct location of the file.

  • @r.ambikaraja3120
    @r.ambikaraja31203 ай бұрын

    How to read arrays from properties file

  • @KumarS-gf4fl
    @KumarS-gf4fl Жыл бұрын

    How to feed implicit time from property file

  • @venkat4644
    @venkat4644 Жыл бұрын

    Hi bro oru doubt file name config.Properties nu set paniten FILEINPUTSTREAM la kuda same name tha enter pannen but i get filenotfountexception enna panrathu solution plz

  • @LearnAutomationOnline

    @LearnAutomationOnline

    Жыл бұрын

    Make sure the file location is correct. If it’s saying file not found, definitely the file location or file name is incorrect. Only you can see the code, so cross check it multiple times

  • @Anonymous_ShyGirl
    @Anonymous_ShyGirl4 жыл бұрын

    Arul can u explain Cleary what u have said after 13:58. Set Property is to write so getproperty is to read? Ryt

  • @LearnAutomationOnline

    @LearnAutomationOnline

    4 жыл бұрын

    Sorry tongue rolled. Get is to obtain the property from the config file, and toe write a property we can use set

  • @sriramn325
    @sriramn3252 жыл бұрын

    Bro itthula driver loction la chrome exe matumtha kuduthurugigaa aprm epttii Firefox open agum

  • @LearnAutomationOnline

    @LearnAutomationOnline

    2 жыл бұрын

    That was just an example on how to read configuration file. U have to give Firefox or whatever the browser you are going to use. I didn't have Firefox, so gave chrome for Firefox as well.

  • @dharunr4970
    @dharunr49702 жыл бұрын

    If I change the browser and driver location in the config. properties, again the same browser is opening, May I know the reason?

  • @LearnAutomationOnline

    @LearnAutomationOnline

    2 жыл бұрын

    Then look the logic for the browser you are opening you may be instantiating the same browser

  • @muthuselvam8939
    @muthuselvam89394 жыл бұрын

    Hi Arul, Your explanation is clear and i understood. When i practised this i am getting null pointer exception. Can you please help me on this

  • @LearnAutomationOnline

    @LearnAutomationOnline

    4 жыл бұрын

    Please read the exception part. It will indicate where exactly the exception has occurred. I presume it would have happened on where you create the object for properties. Make sure the properties object is not null.

  • @muthuselvam8939

    @muthuselvam8939

    4 жыл бұрын

    @@LearnAutomationOnline Properties object is not null. Actaully the exception was happened on line 24 - if(browser.equals("chrome")

  • @LearnAutomationOnline

    @LearnAutomationOnline

    4 жыл бұрын

    It didn't read the value for browser from the property file. Print the value of browser. It will be null. Make sure there is. Key clled browser in the property file. Thts he issue

  • @muthuselvam8939

    @muthuselvam8939

    4 жыл бұрын

    @@LearnAutomationOnline Thanks arul for the solution. You are right. In config.properies file i have mentioned the numbering, that was the root cause of the issue. I have removed the numbering, now the file was read and it's working fine now. Thanks for the solution

  • @sivanellaiappan5788
    @sivanellaiappan57884 жыл бұрын

    Hi arul I'm getting error "could not find or load main class selenium.file" can you please help me to resolve this

  • @LearnAutomationOnline

    @LearnAutomationOnline

    4 жыл бұрын

    Does your class have main method? Is it saying selenium.file? Pls share the screenshots through email. Along with your code screenshot as well

  • @sivanellaiappan5788

    @sivanellaiappan5788

    4 жыл бұрын

    @@LearnAutomationOnline sorry for the inconveniences can please tell me the email address

  • @LearnAutomationOnline

    @LearnAutomationOnline

    4 жыл бұрын

    Seleniumtrainer36@gmail.com

  • @dineshkumart7696
    @dineshkumart7696 Жыл бұрын

    Maven la use panna epdi bro driver location koodukurathu?????

  • @LearnAutomationOnline

    @LearnAutomationOnline

    Жыл бұрын

    Driver location kum maven kum enna connection iruku. I don't understand. U can give as usual

  • @crazycodez3463
    @crazycodez34634 жыл бұрын

    sir am tried this one.....but throwing java.lang.IllegalStateException

  • @LearnAutomationOnline

    @LearnAutomationOnline

    4 жыл бұрын

    Please be precise. This is just an exception name. In your console you will clearly get the error description on which line it is happening. Without it it's not possible for me to assume what could have gone wrong

  • @karthikeyansugumar20
    @karthikeyansugumar205 жыл бұрын

    For gubir siripu skip to 13.18. I literally laughed :)

  • @naveenr3367
    @naveenr33673 жыл бұрын

    Sir here you have used FileInputStream to read the file here But already you have said that we can use Filewriter to read the file.. earlier..! My question is shall we use Filewriter instead of FileInputStream here.? Will it work?

  • @LearnAutomationOnline

    @LearnAutomationOnline

    3 жыл бұрын

    File writer, is used to write on the files. U sure, I said file writer is used to read files?

  • @naveenr3367

    @naveenr3367

    3 жыл бұрын

    @@LearnAutomationOnline I am really sorry sir my mistake. ! Not Filewriter it's FileReader..! we can use either FileReader or FileInputStream here for .properties ! ri8 sir?

  • @LearnAutomationOnline

    @LearnAutomationOnline

    3 жыл бұрын

    There are multiple ways to read a file. You can use any one of them

  • @mohamedarshad4298
    @mohamedarshad42982 жыл бұрын

    filenotfoundexception is coming its not running for me.

  • @LearnAutomationOnline

    @LearnAutomationOnline

    2 жыл бұрын

    The name itself is explaining the problem. The file location you have given is not correct. Correct that

  • @mohamedarshad4298

    @mohamedarshad4298

    2 жыл бұрын

    @@LearnAutomationOnline But i have given correct location!

  • @LearnAutomationOnline

    @LearnAutomationOnline

    2 жыл бұрын

    If it's the correct location there's no way for this exception

  • @karthigamuthusamy810
    @karthigamuthusamy8105 жыл бұрын

    Ok share me java developer tutorial and interview questions and answers you tube channel.sir

  • @LearnAutomationOnline

    @LearnAutomationOnline

    5 жыл бұрын

    Durgasoft, Telusko, java brains

  • @karthigamuthusamy810

    @karthigamuthusamy810

    5 жыл бұрын

    Thanks u sir

  • @user-oj3dd8ci9d
    @user-oj3dd8ci9d4 жыл бұрын

    Java rompa kastama

  • @LearnAutomationOnline

    @LearnAutomationOnline

    4 жыл бұрын

    No. If u follow my java playlist, it should be easier

Келесі