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