Ejemplo n.º 1
0
 private void CheckAccount(Account acc)
 {
     this.driver = ChromeInstance.Driver(true);
     driver.Url  = "https://www.youlikehits.com/login.php";
     driver.FindElementById("username").SendKeys(acc.Login);
     driver.FindElementById("password").SendKeys(acc.Password);
 }
Ejemplo n.º 2
0
        public RemoteWebDriver GetLoginedDriver(Account acc)
        {
            //   RemoteWebDriver phantomJs = new PhantomJSDriver();
            RemoteWebDriver driver = ChromeInstance.Driver();

            driver.Url = "http://youlikehits.com/";
            List <DCookie> dCookie;

            using (var reader = new StreamReader(this._dirPath + "/" + acc.Login + ".xml"))
            {
                XmlSerializer deserializer = new XmlSerializer(typeof(List <DCookie>),
                                                               new XmlRootAttribute("list"));
                dCookie = (List <DCookie>)deserializer.Deserialize(reader);
            }

            foreach (var cookie in dCookie)
            {
                driver.Manage().Cookies.AddCookie(cookie.GetCookie());
            }



            driver.Url = "https://youlikehits.com/";
            OpenQA.Selenium.Screenshot screenshot = ((ITakesScreenshot)driver).GetScreenshot();
            screenshot.SaveAsFile("cookie.jpg", ScreenshotImageFormat.Jpeg);
            return(driver);
        }
Ejemplo n.º 3
0
        private static void MakeTimer(object state)
        {
            driver = ChromeInstance.Driver();
            AccRepo repo = (AccRepo)state;

            Grab(repo);
            Console.ReadLine();
        }