hello everyone welcome back to another video so in this video I'm going to show you how you can install selenium on your Mac and write your first demo code using Zaba so before that you need to make sure to install Zaba so to check if Java is already installed into your system or not just type command and space to open the spotlight source and just search for terminal and just type Java hyphen version and if it shows something like the operation could not be completed then the Java is not into your system so now to install Java into your system just go to your favorite browser and search for download Java and just type Oracle and just go to this first link from oracle. com so if you just scroll down so you will be able to see the versions of java so it's better to download the lth version so just go with Java 17 or whichever the LTS version you have in when while downloading the Java and just go into this Mac OS and here you just need to download the DMZ installer so you can just go with arm64 DMG installer so if you are using the MacBook M1 or M2 so let me just go with the arm so let me just click and download so this should download the DMG file so once you download the DMG file so just go into this so in finder and if you just double click onto this and double click onto this package so this should start the installer so let me just click on continue just click and install enter the password of your Mac and just click enter so this should now install the Java zdk so you can see the installation is successful let me just close and let me just move the jdk installer into the trash so if I just again go to the terminal and just type Java hyphen version so you can see the Java 17 has been successfully installed into a system so once you install the Java so we just need to install the ID as well so the ID I would be using is intelization so you can use the eclipse or other ID as well so to download the eclipse ID again just go to the browser and let me just search for download Intel IJ and you can see the first link from zbins. com so just click here and you can see on Mac OS and just download the DMG file so I would go with the community version so this is the free one so just download the Community Edition so just click on download so this should again start downloading the DMG file so once this DMZ file is downloaded let me just so in finder and if I just again double click into this DMZ file let me just drag and drop this intelizer into these applications and let me just drop here and let me just drop into this application so you can see the intelizer has been moved into the application so let me just close this one and also this let me just close everything from here and if I just go to the launch pad and source for intelization so you can see the intelizer idea has been already appeared here so let me just open this IntelliJ so here you can see the welcome page of the intelizer idea so let me just click on this new project and let me just give the name of the project demo selenium or you can just give any name and here you can see the jdk detected so here you can see so this is the Java Java 17 open jdk which you have just installed so just click here or this should automatically detect in your case as well so let me just click and create so this should create the demo selenium project and inside here inside this source so if you just go inside here inside this source so you can see inside this main class so the Java class has been created here so to run this class you can just right click and you can just click under this run main dot main so this should run this hello world program so this is the demo Java program so once the Java and intelizer is installed so we just need to download the selenium so for that again let me just go into the Google Chrome and let me just download the selenium so just click just type download selenium so just type download selenium and just go to this pass link from selenium.
dip and here you will be able to see this download so just click on downloads and if you just scroll down here so you will be able to see the Java so you can just use the Java so just go into this table and click here 4. 8. 1 so this should download the zip file for selenium so once the zip file is downloaded let me just so in finder and if I just double click onto this ZIP so this should extract this G from here and if I just go inside here so you will be able to see all the jars so we just need to add all this jar into the Java project and also inside this live folder so you can see all the jars so we will also add all this jar into the Java project so for that let me again go to the initializer here and inside here just go into this file and just go into this project structure and just click onto this modules and inside here just click on this module source and just click on plus sign here and just click on jars and we just need to add the Jas so we have extracted our folder into this downloads and just go into this selenium where we have this extracted and just click here on Zar and the station shift and down arrow to select all the tsars so just keep on pressing down arrow and just click pop enter so this should add all the six inch files so let me again click onto this plus sign and click on jar and again go to the extracted folder inside download selenium and Library so here we just need to again patient shift so just keep on pressing shift and down arrow so this should select all the jars from here as well so let me just click on enter so here so this has added all the jar files and just click on apply and just click on OK so this should add all the jars into this demo selenium project so if I just click onto this external Library so here you can see all the Tsar has been successfully added into our project so once you download all the Tsar so we just need to download the Chrome driver as well so for that let me again go to the Chrome browser and first let me check the version of the Chrome browser so let me just click onto this help and about the Google Chrome so at the time of recording this video so I have the version 110 so I will be downloading the same version for the Chrome driver so for that again go to the this selenium downloads uh link so this is the selenium downwards and if you just scroll down where we have just downloaded the Java from so if you just scroll down from here so you will be able to see this blouse browser so just click here and since we are doing it for Chrome so if you are doing for Safari Opera a so this procedure is similar so let me just go into this chrome and just click on this documentation and so since I have just fixed my version of Chrome is 110 so I would download the 110 so if you have the newer version so just go accordingly so let me just click on stable version so this is the stable version this is just beta version so we would prefer going with this table and also the version of the Chrome is 110 so I will just click here so let me just go for Max so just click onto this Mac am 64 just download this Jeep and if I just go inside this so in finder so you can see this ZIP so let me just double click to extract this ZIP as well and we will be using this path from here so before using this path so we just need to write the code so let me just go into the IntelliJ again and inside this source and inside this main so where this is hello world so we just need to write the test code here so the first thing is let's let's create the object of wave driver so for that let me just clear this one first and so inside here the first thing we need to do is we need to create the object of Webdriver so for that just type wave driver and just click enter so this should automatically import the wave driver from the selenium and just type driver or you can give any name and the second thing is we just need to write a simple test where we will write the simple code to launch the browser and navigate to the certain website so for that let me just write the method so let me call it public avoid and let me call it launch launch browser and inside here so we just need to write the system dot set property and just type web driver so since we are using the chrome.
driver so just type Chrome dot driver so if you are using Firefox or other browser so write it accordingly and let me just give comma and here so we just need to give the path so for that let me again go to the finder here and so since we have extracted this chrome driver here so we just need to click here and right click so just right click here and just press an option so option key on your Mac so just press an option so this switch so the this will show the copy Chrome driver as path name so just click here and so this should copy the path name so if I just press on command and V to paste so here you can see so this has already given the path so here let me just click on enter so that it will make easier for us to read the code and give the semicolon here as well so once you do that so we just need to write the driver equals so just type new Chrome driver so since you are using the Chrome driver and just type driver dot gate so this should navigate us to the certain website so just give the link of the website so in my case just type https slash www dot youtube. com so or you can just go into the any website so I will I would prefer going with the youtube. com slash code with Arizona so this is the link of my Channel or you can just go into any website and inside this main method so we just need to write Main and just create the object so let me just type so this is the name of the class which is main just type object and equals new main so just create the main object and just call the launch browser method so just type launch browser and once you do that so if you just right click here and click onto this run main dot uh main so this should now open the Chrome browser and navigate us to this link so you can see this this is the link of my YouTube channel which I have just uh you know put here into this navigation so similarly let me just write something like youtube.
com only so youtube. com and if I just right click and run the program here again so this should navigate us to the youtube. com here so you can see this is the youtube.