Beispiel #1
0
        public PageLogin(SeleniumConfig seleniumConfigurations)
        {
            seleniumConfig = seleniumConfigurations;
            ChromeOptions optionsFF = new ChromeOptions();

            //uncomment this line if you don't want to see Chrome executing the RPA.
            //optionsFF.AddArgument("--headless");
            //Use the Selenium.WebDriver.ChromeDriver nuget  with exact same version you have in your chrome browser. Check the version by typing chrome://version/
            webDriver = new ChromeDriver("./", optionsFF);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile($"appsettings.json");
            var configuration = builder.Build();

            Console.WriteLine("Loading Chrome with RPA...");

            var seleniumConfigurations = new SeleniumConfig();

            new ConfigureFromConfigurationOptions <SeleniumConfig>(configuration.GetSection("SeleniumConfigurations")).Configure(seleniumConfigurations);

            var pageLogin = new PageLogin(seleniumConfigurations);

            pageLogin.LoadPage();
            var ok = pageLogin.DoLogin();
        }