getting error with C# selenium – loading of unpacked extensions is disabled by the administrator

Hi,

 

I am executing simple code in visualstudio (selenium with C#) to initialize chrome browser and load www.google.com but getting error as pop-up with message “loading of unpacked extensions is disabled by the administrator” and  ok button on it.   If I click on Ok, it initialize the chrome browser but unable to browse the give URL.

 

I am using below code. Can someone please help me to resolve this issue?

 

using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PracticeProject
{
class Program
{
static void Main(string[] args)
{
ChromeOptions options = new ChromeOptions();

options.AddAdditionalCapability(“useAutomationExtension”, false);

IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl(“www.google.com”);
}
}
}

Add Comment
  • 1 Answer(s)

    using OpenQA.Selenium;
    using OpenQA.Selenium.Chrome;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace PracticeProject
    {
    class Program
    {
    static void Main(string[] args)
    {

    IWebDriver driver = new ChromeDriver(options());
    driver.Navigate().GoToUrl(“www.google.com”);
    }
    }

    private static ChromeOptions options()

    {

    ChromeOptions options = new ChromeOptions();

    options.AddAdditionalCapability(“useAutomationExtension”, false);

    return options;

    }
    }

    Train Answered on July 27, 2018.

    Is this working?

    on August 7, 2018.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.