Using Selenium on Mac Chrome

前端 未结 5 865
说谎
说谎 2020-12-13 03:15

Recently got a mac and was able to run Mozilla without any issues but having trouble installing chrome extensions and running it for selenium. Can someone guide me through t

5条回答
  •  一个人的身影
    2020-12-13 03:45

    1. One way is if you have homebrew on your mac, then on terminal, use this command brew install chromedriver
    2. Then you need to download chromedriver on your machine, do it from http://chromedriver.storage.googleapis.com/index.html Download latest version It will look like, "chromedriver_mac32.zip" (doesn't matter if its 32 bit, it will work for 64 bit MAC as well)
    3. Use this code for open Chrome if your chromedriver that you downloaded is inside your project folder and looks like this ..Project folder/Chrome/chromedriver

       System.setProperty("webdriver.chrome.driver", 
       System.getProperty("user.dir")+"/Chrome/chromedriver");
       driver=new ChromeDriver();
      

提交回复
热议问题