示例#1
0
        public void Unfollow()
        {
            DOM.Find(".coreSpriteDesktopNavProfile").Click();
            DOM.Find("a[href*=following]").Click();
            String st     = "._4gt3b";
            String script = String.Format("var objDiv = document.getElementsByClassName(\"_4gt3b\")[0];objDiv.scrollTop = objDiv.scrollHeight;");

            for (int i = 0; i < 50; i++)
            {
                DOM.ExecuteJavascript(script);
                Wait(1000);
            }


            List <DomElement> followButtons = DOM.FindMany("._ah57t._6y2ah._i46jh._rmr7s").ToList();
            Random            rnd           = new Random();
            int counter = 0;

            foreach (var btn in followButtons)
            {
                counter++;
                btn.Click();
                Wait(rnd.Next(10, 15) * 1000);
                Console.WriteLine("Unfollowed " + counter + " accounts.");
            }
        }
        public void FillDetails()
        {
            NewUserDetails u = new NewUserDetails();

            u.FirstName    = "Random";
            u.LastName     = "Person";
            u.UserName     = "******" + DateTime.Now.Millisecond;
            u.CurrentEmail = "*****@*****.**";
            u.Password     = "******";
            u.BirthMonth   = 1;
            u.BirthDate    = "01";
            u.BirthYear    = "1980";
            u.Phone        = "+1-432-132-4552";


            DOM.Find("#FirstName").SendKeys(u.FirstName);
            DOM.Find("#LastName").SendKeys(u.LastName);
            DOM.Find("#GmailAddress").SendKeys(u.UserName);
            DOM.Find("#Passwd").SendKeys(u.Password);
            DOM.Find("#PasswdAgain").SendKeys(u.Password);
            DOM.Find("#BirthMonth").SendKeys(u.BirthMonth.ToString());
            DOM.Find("#BirthDay").SendKeys(u.BirthDate);
            DOM.Find("#BirthYear").SendKeys(u.BirthYear);
            DOM.Find("#RecoveryEmailAddress").SendKeys(u.CurrentEmail);
            DOM.Find("#submitbutton").Click();
        }
示例#3
0
        public override void RunCase()
        {
            /*Step("Hovering over Portfolios");
             * DOM.Find("#tmbTab9").HoverOver();
             * Step("Clicking on create portfolio");
             * DOM.Find("#__tmbFlyout9 a[href*=CreateEditPortfolio]").Click();
             * Step("Waiting for the Create portfolio page to load.");
             * DomElement portfolioInput = DOM.Find("#summarySection_Toggle1_portfolioName");
             * Step("Create portfolio page loaded.");
             *
             * string portfolioname="SeleniumPortfolio_"+Utility.RandomNumber();
             * Step("Entering portfolio name as "+portfolioname);
             * portfolioInput.SendKeys(portfolioname);
             * Step("Now clicking on Save button");
             * DOM.Find("#bbBottom_mySave__saveBtn").Click();
             *
             * Step("Verifying if the portfolio got created.");
             *
             * if(!DOM.Find("#ctl27__textLabel").Text.Contains(portfolioname))
             * Error("Portfolio did not get created!");*/
            String hashTagsToLike            = "#hotwomen";
            String profilesFollowersToFollow = "https://www.instagram.com/thenotoriousmma/";

            GoTo.Url("https://www.instagram.com");

            DOM.Find("._fcn8k").Click();
            DOM.Find("input[name=username]").SendKeys("*****@*****.**");
            DOM.Find("input[name=password]").SendKeys("Coolermaster24");
            DOM.Find("button._ah57t._84y62._i46jh").Click();
            //follow(profilesFollowersToFollow);
            Unfollow();
        }