public static IWebElement GetValidXpath(IWebDriver driver, string Tvalue, string Target) { JWait.WaitForAjaxComplete(driver, 30); string sXpath = JXpath.Valid(Tvalue, Target); return(element = JFind.XPath(driver, sXpath)); }
public static IWebElement GetDirectionElement(IWebDriver driver, string Tvalue) { JWait.WaitForAjaxComplete(driver, 30); string sXpath = JXpath.DirectionButton(Tvalue); return(element = JFind.XPath(driver, sXpath)); }
public static IWebElement GetDateTimeElement(IWebDriver driver, string Target, string Tvalue, string sType) { JWait.WaitForAjaxComplete(driver, 30); string sXpath = JXpath.DateTimeInput(Target, Tvalue, sType); return(element = JFind.XPath(driver, sXpath)); }
public static IWebElement GetSelectElement(IWebDriver driver, string Tvalue, string Target) { JWait.WaitForAjaxComplete(driver, 30); string sXpath = JXpath.Select(Target, Tvalue); return(element = JFind.XPath(driver, sXpath)); }
public static IWebElement GetFileInputElement(IWebDriver driver, string Tvalue, string Target) { JWait.WaitForAjaxComplete(driver, 30); string sXpath = JXpath.FileInput(Target, Tvalue); return(element = driver.FindElement(By.XPath(sXpath))); }
public static void SwitchToPageNum(IWebDriver driver, string Tvalue) { JWait.WaitForAjaxComplete(driver, 30); elements = driver.FindElements(By.ClassName("page-num")); if (Tvalue.Contains("尾页")) { List <string> pageNumb = new List <string>(); foreach (IWebElement item in elements) { pageNumb.Add(item.Text); } Tvalue = pageNumb.Max(); } IJavaScriptExecutor js = ((IJavaScriptExecutor)driver); js.ExecuteScript(string.Format("javascript:gotoPage({0})", Tvalue)); }