• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Programming Languages
    • Java Tutorials
    • Python Tutorials
    • JavaScript Tutorials
  • Automation Tools and Different Tools
    • Web Automation
      • Selenium with Java
        • Selenium Basic
        • Selenium Advance
        • Selenium Realtime
        • Framework
        • Selenium Interview
        • Selenium Videos
        • Selenium with Docker
      • Selenium with Python
      • WebdriverIO
        • Selenium Webdriver C# Tutorial
      • Cypress
      • Playwright
    • TestNG
    • Cucumber
    • Mobile Automation
      • Appium
    • API Testing
      • Postman
      • Rest Assured
      • SOAPUI
    • testRigor
    • Katalon
    • TestProject
    • Serenity BDD
    • Gradle- Build Tool
    • RPA-UiPath
    • Protractor
    • Windows Automation
  • Automation For Manual Testers
  • Services
  • Online Training
  • Contact us
  • About me
  • Follow us
    • Linkedin
    • Facebook Group
    • Facebook Page
    • Instagram

Automation

Selenium WebDriver tutorial Step by Step

You are here: Home / Basic Selenium / Execute Selenium test on chrome browser on MAC using Selenium

Execute Selenium test on chrome browser on MAC using Selenium

September 3, 2016 by Mukesh Otwani 14 Comments

Page Object Model using Selenium Webdriver.

To start any third party browser (Chrome, Opera etc.) Chrome browser on MAC using Selenium we have to use some drivers which will interact with the browsers.

In windows, we have already seen working with IE, Chrome, Firefox and mobile browsers as well.

In windows, it’s quite easy to download and specify the path in the program but in MAC we have to keep all the driver in a specific folder and then Selenium will start the execution directly.

 

First step- Download the drivers for MAC

Download link  http://chromedriver.storage.googleapis.com/index.html?path=2.23/

Chrome Browser ON MAC using Selenium

Second step- In MAC we have one directory called /usr/local/

Chrome Browser ON MAC using Selenium

 

 

Chrome Browser ON MAC using Selenium

In above location, you can create bin folder (if not created).

Now you have to copy the driver in /usr/local/bin and that all

 

Good thing which I like here is we don’t have to remember the path variable like webdriver.chrome.driver

Chrome Browser ON MAC using Selenium

Program for Chrome browser on MAC using Selenium

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;



public class HandleDropDown3 {



   public static void main(String[] args) throws InterruptedException {





       WebDriver driver=new ChromeDriver();



       driver.manage().window().maximize();



       driver.manage().timeouts().pageLoadTimeout(1, TimeUnit.SECONDS);



       driver.get("https://learn-automation.com/");





   }



}

 

Hope you have liked the above article, I have used in a straight way but if you know any other way to handle drivers in Selenium then feel free to share your thoughts in comment section.

 

 

Filed Under: Basic Selenium Tagged With: Chrome browser on MAC using Selenium

Reader Interactions

Comments

  1. storm of games says

    April 20, 2022 at 6:01 PM

    what a great post sir I am regular visitor of this blog and I love your blog

    Reply
    • Mukesh Otwani says

      April 21, 2022 at 10:35 AM

      Thanks 🙂
      You’re always welcome

      Reply
  2. Jahnavi says

    September 6, 2019 at 2:37 AM

    HI Mukesh,
    Thanks for the article, your blog and videos have helped me learn a lot in my automation journey. I am wondering if you have come across a scenarios where you had the program to look at a specific file to load configurations. When I used windows to develop the scripts:
    string configFilePath = Path.Combine(libraryFilePath, “Config\\config.json”);

    We have been moving over to MAC, and it does not seem to like the folder structure, what is the best possible way to resolve this other than getting the OS and including an if condition

    Reply
    • Mukesh Otwani says

      September 13, 2019 at 3:08 PM

      Hi Jahnavi,

      Instead absolute or full file path, use relative path with respect to your project root folder like ./Config/config.properties. This will work on all OS.

      Reply
  3. Akash says

    August 2, 2019 at 4:53 PM

    I have always used windows for automation purpose. In an interview they gave me Mac to write the script. i wrote it correctly but the browser was not launching. and i got rejected. now i know what mistake i did.

    Reply
    • Mukesh Otwani says

      August 2, 2019 at 5:18 PM

      Hi Akash,

      Would you please let me know, which mistake you found?

      Reply
  4. Riley says

    July 24, 2019 at 5:06 AM

    Oh my god I’ve searched for an entire day and this article is the ONLY thing that has finally worked! Thank you so much for this! Was getting so frustrated at the complexity of Selenium and the minimal documentation for Mac and this is what finally did the trick for me!

    Reply
    • Mukesh Otwani says

      July 24, 2019 at 9:59 AM

      Hi Riley,

      Glad that my blog post helped you. You’re always welcome…:)

      Reply
  5. Yashasri says

    February 1, 2017 at 6:31 PM

    Awesome content Mukesh!
    I’m feeling lucky that I found this site.

    God bless you Bro!

    Reply
    • Mukesh Otwani says

      February 2, 2017 at 2:50 PM

      Thanks Yashasri 🙂 Keep in touch.

      Reply
  6. Mrinal kumar says

    October 23, 2016 at 10:04 AM

    And pls share the procedure to launch safari also

    Reply
    • Mukesh Otwani says

      October 25, 2016 at 2:00 PM

      Hi Mrinal,

      For Safari you can install just small plugin in browser and rest Selenium will handle.

      To launch call SafariDriver()

      Reply
  7. Raja says

    October 19, 2016 at 12:36 PM

    Really cool!, Thanks buddy.

    Reply
    • Mukesh Otwani says

      October 20, 2016 at 2:12 PM

      Thanks Raja

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Free Selenium Videos

https://www.youtube.com/watch?v=w_iPCT1ETO4

Search topic

Top Posts & Pages

  • Selenium Webdriver tutorial for beginners
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Selenium Webdriver C# Tutorial
  • WHAT ARE YOUR EXPECTATIONS FROM US?

Stay connected via Facebook

Stay connected via Facebook

Archives

Footer

Categories

Recent Post

  • Syllabus For Playwright Online Training Program
  • API Testing Using Postman And RestAssured
  • Disable Personalise Your Web Experience Microsoft Edge Prompt In Selenium
  • How To Fix Error: No tests found In Playwright
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse

Top Posts & Pages

  • Selenium Webdriver tutorial for beginners
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Selenium Webdriver C# Tutorial
  • WHAT ARE YOUR EXPECTATIONS FROM US?