Exemplo n.º 1
0
 public static bool IsAt(string xpath)
 {
     try
     {
         var element = PortalChromeDriver.GetElementByXpath(xpath);
         return(true);
     }
     catch (Exception e) { return(false); }
 }
Exemplo n.º 2
0
 public static void DisTurnOnDialogByClickOK()
 {
     try
     {
         var turnOnDialog = PortalChromeDriver.GetElementByXpath(CommonElement.Confirm);
         turnOnDialog.Click();
     }
     catch (Exception e) { }
 }
Exemplo n.º 3
0
 public static void ClearPerXpath(string xpath)
 {
     try
     {
         PortalChromeDriver.GetElementByXpath(xpath).Clear();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Exemplo n.º 4
0
 public static void SendKeysPerXpath(string xpath, string content)
 {
     try
     {
         PortalChromeDriver.GetElementByXpath(xpath).SendKeys(content);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Exemplo n.º 5
0
 public static void BackToAllSkill()
 {
     try
     {
         PortalChromeDriver.GetElementByXpath(CommonElement.AllSkills).Click();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Exemplo 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);
     }
 }
Exemplo 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);
            }
        }
Exemplo 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); }
 }