public static void SendKeysPerXpath(string xpath, string content) { try { PortalChromeDriver.GetElementByXpath(xpath).SendKeys(content); } catch (Exception e) { throw new Exception(e.Message); } }
public static void ClearPerXpath(string xpath) { try { PortalChromeDriver.GetElementByXpath(xpath).Clear(); } catch (Exception e) { throw new Exception(e.Message); } }
public static void BackToAllSkill() { try { PortalChromeDriver.GetElementByXpath(CommonElement.AllSkills).Click(); } catch (Exception e) { throw new Exception(e.Message); } }
public static void PreviousPage() { try { PortalChromeDriver.ClickElementPerXpath(CommonElement.Previous_Page); Thread.Sleep(2 * 1000); } catch (Exception e) { } }
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); } }
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); } }
public static void TurnOn() { try { var turnOn = PortalChromeDriver.GetElementByXpath(CommonElement.TurnOnAndOFF); if (turnOn.Text == "开启") { turnOn.Click(); } } catch (Exception e) { throw new Exception(e.Message); } }
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); } }
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); }