How can I launch Chrome with an unpacked extension?

前端 未结 7 1003
孤街浪徒
孤街浪徒 2020-12-20 12:28

I\'m using Selenium WebDriver to test a Google Chrome extension I\'m developing. I noticed that ChromeDriver can be customised to add extensions to the instance

7条回答
  •  轮回少年
    2020-12-20 12:51

    I was able to achieve this by using the AddArgument method to directly pass the information to Chrome. Here's what it looks like in C#:

    options = new ChromeOptions();
    options.AddArgument("--load-extension=" + unpackedExtensionPath);
    

提交回复
热议问题