Created
November 12, 2019 10:29
-
-
Save RohanImmanuel/460110f0a49b50b9a466bc379b0772e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openqa.selenium.Cookie; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.chrome.ChromeDriver; | |
import org.openqa.selenium.chrome.ChromeOptions; | |
import org.openqa.selenium.remote.DesiredCapabilities; | |
import org.openqa.selenium.remote.RemoteWebDriver; | |
import java.io.File; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import java.util.Calendar; | |
import java.util.Date; | |
public class ChromeExtensionTest { | |
public static void main(String[] args) { | |
ChromeOptions options = new ChromeOptions(); | |
options.addExtensions(new File("/path/to/crx/file")); | |
WebDriver driver = new ChromeDriver(options); | |
driver.get("https://google.co.in"); | |
try { | |
Thread.sleep(10000); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
driver.quit(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment