Esempio n. 1
0
        public static void GetTestUserFromUserList()
        {
            try
            {
                if (PortalChromeDriver.GetElementByXpath(HIPortalPageUIElement.LoadingMore).GetAttribute("style") == "")
                {
                    HIPage.ClickLoadingMore();
                }

                var userNames = PortalChromeDriver.GetElementsByClassName("userName");
                foreach (var userName in userNames)
                {
                    if (userName.Text == "chrysanthemum")
                    {
                        userName.Click();
                        Thread.Sleep(2 * 1000);
                        SendMessage("Hi,chrysanthemum");
                    }
                }
                //for (int i = 1; i < 12; i++)
                //{
                //    var user = PortalChromeDriver.GetElementByXpath("//*[@id='msgListDiv']/div[" + i + "]/div[2]/div[1]/div[1]");
                //    if (user.Text == "chrysanthemum")
                //    {
                //        user.Click();
                //    }
                //}
            }
            catch (Exception e)
            {
            }
        }
Esempio n. 2
0
 public static void GetOtherUserFromUserList()
 {
     try
     {
         if (Utility.IsAt(HIPortalPageUIElement.LoadingMore))
         {
             HIPage.ClickLoadingMore();
         }
         var userNames = PortalChromeDriver.GetElementsByClassName("userName");
         foreach (var userName in userNames)
         {
             if (userName.Text == "xun")
             {
                 userName.Click();
                 Thread.Sleep(5 * 1000);
                 SendMessage("Hi,xun");
             }
         }
     }
     catch (Exception e)
     {
     }
 }