Ejemplo n.º 1
0
 public static void SendKeysPerXpath(string xpath, string content)
 {
     try
     {
         PortalChromeDriver.GetElementByXpath(xpath).SendKeys(content);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Ejemplo n.º 2
0
 public static void ClearPerXpath(string xpath)
 {
     try
     {
         PortalChromeDriver.GetElementByXpath(xpath).Clear();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Ejemplo n.º 3
0
 public static void BackToAllSkill()
 {
     try
     {
         PortalChromeDriver.GetElementByXpath(CommonElement.AllSkills).Click();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Ejemplo n.º 4
0
 public static void PreviousPage()
 {
     try
     {
         PortalChromeDriver.ClickElementPerXpath(CommonElement.Previous_Page);
         Thread.Sleep(2 * 1000);
     }
     catch (Exception e)
     {
     }
 }
Ejemplo n.º 5
0
 public static bool IsAtPerClass(string className, string expected = "")
 {
     try
     {
         var element = PortalChromeDriver.GetElementByClassName(className);
         if (element.Text.Contains(expected))
         {
             return(true);
         }
         return(false);
     }
     catch (Exception e) { return(false); }
 }
Ejemplo n.º 6
0
 public static bool IsTurnOn()
 {
     try
     {
         var setting = PortalChromeDriver.GetElementByXpath(CommonElement.TurnOnAndOFF);
         if (setting.Text.ToString().Equals("停用"))
         {
             return(true);
         }
         return(false);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Ejemplo n.º 7
0
        public static void TurnOn()
        {
            try
            {
                var turnOn = PortalChromeDriver.GetElementByXpath(CommonElement.TurnOnAndOFF);

                if (turnOn.Text == "开启")
                {
                    turnOn.Click();
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
Ejemplo n.º 8
0
 public static bool IsAt(string xpath, string expected)
 {
     try
     {
         var element = PortalChromeDriver.GetElementByXpath(xpath);
         if (element.Text.Contains(expected))
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception e) { return(false); }
 }
Ejemplo n.º 9
0
 public static void NextPageInput(string page_input)
 {
     PortalChromeDriver.SendKeysPerXpath(CommonElement.Next_Page_Input, page_input);
     PortalChromeDriver.ClickElementPerXpath(CommonElement.Next_Page_Input_Go);
     Thread.Sleep(2 * 1000);
 }