Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97762

How to run a Chromium Browser with Selenium?

$
0
0

Is it possible to run a Selenium test in Chromium Browser (not Google Chrome Browser)?

My GoogleDrive location: GoogleDrive location

My Chromium location: Chromium location

FYI: I am using Java

My code ( for the moment I am run FirefoxDriver(gecko):

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class MainClass {

public static void main (String[] args){
    System.setProperty("webdriver.gecko.driver", "C:\\Users\\User\\IdeaProjects\\testselenium\\drivers\\geckodriver.exe");
    WebDriver driver = new FirefoxDriver();
    driver.get ("https://www.seleniumhq.org/");
   }
} 

I thought that this code would help but without success. Runs Google Chrome, not Chromium:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class Chromium {

public static void main (String[] args){
    System.setProperty("webdriver.chrome.driver", "C:\\Users\\User\\IdeaProjects\\testselenium\\drivers\\chromedriver.exe");
    System.setProperty("webdriver.chrome.binary", "C:\\Users\\User\\Downloads\\chrome-win\\chrome-win\\chrome.exe");
    WebDriver driver = new ChromeDriver();
    driver.get ("https://www.seleniumhq.org/");
   }
} 

What could be the problem? How can this question be resolved?


Viewing all articles
Browse latest Browse all 97762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>