-1

I want to hide the black console window of Selenium that appear before opening chrome and surfing the website Any Idea ?

this is my code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using OpenQA.Selenium.Chrome;
using System.Runtime.InteropServices;

namespace DODemo1.UserControls
{
    public partial class DashboardUC : UserControl
    {
        public DashboardUC()
        {
            InitializeComponent();
        }

        private void button_Click(object sender, EventArgs e)
        {

            var options = new ChromeOptions();
            var chromeDriver = new ChromeDriver(options);
            chromeDriver.Navigate().GoToUrl("http://website.com");

        }

    }
}

Any idea ?

user298438
  • 11
  • 5
Dr.Mezo
  • 807
  • 3
  • 10
  • 25

1 Answers1

-1

Add

this.driverServiceProcess.StartInfo.CreateNoWindow = true;

to your code.

user298438
  • 11
  • 5