如何使用Selenium运行chrome扩展

时间:2016-12-08 14:41:50

标签: java selenium selenium-webdriver selenide

之后如何运行chrome扩展? 我已经添加了但是如何运行?

public class asset_testing {
@Test
    public void user(){
    ChromeOptions options = new ChromeOptions();
    options.addArguments("load-extension=C:\\GUI\\distr\\chrome");
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(ChromeOptions.CAPABILITY, options);
    System.setProperty("webdriver.chrome.driver", "C:/my-app/drivers/chromedriver.exe");
    ChromeDriver driver = new ChromeDriver(capabilities);

0 个答案:

没有答案