public static void ExplicitWait(IWebDriver driver, string element, propertyType type) { var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(30)) { Timeout = TimeSpan.FromSeconds(30), PollingInterval = TimeSpan.FromMilliseconds(250) }; Func <IWebDriver, bool> waitForElement = new Func <IWebDriver, bool>((IWebDriver driver) => { if (type == propertyType.Id) { driver.FindElement(By.Id(element)); } if (type == propertyType.Name) { driver.FindElement(By.Name(element)); } if (type == propertyType.XPath) { driver.FindElement(By.XPath(element)); } return(true); }); wait.Until(waitForElement); }
/// <summary> /// /// </summary> /// <param name="co"></param> /// <returns></returns> private static digitalObject CreateDigitalObject(ContentObject co) { var dObj = new digitalObject(); dObj.PID = co.PID; dObj.objectProperties = new objectPropertiesType(); dObj.objectProperties.property = new propertyType[1]; var label = new propertyType(); label.NAME = propertyTypeNAME.infofedorafedorasystemdefmodellabel; label.VALUE = co.Title; dObj.objectProperties.property[0] = label; return(dObj); }
public static DefaultWait <IWebDriver> DefaultWait( IWebDriver driver, string element, propertyType type) { var wait = new DefaultWait <IWebDriver>(driver) { Timeout = TimeSpan.FromSeconds(20), PollingInterval = TimeSpan.FromMilliseconds(250), }; wait.IgnoreExceptionTypes(typeof(NoSuchElementException)); wait.IgnoreExceptionTypes(typeof(InvalidOperationException)); wait.Until(_ => { if (type == propertyType.Id) { _.FindElement(By.Id(element)); } switch (type) { case propertyType.Id: _.FindElement(By.Id(element)); break; case propertyType.Name: _.FindElement(By.Name(element)); break; case propertyType.XPath: _.FindElement(By.XPath(element)); break; case propertyType.Css: _.FindElement(By.CssSelector(element)); break; default: break; } return(true); }); return(wait); }
public propertyListItem(string name, propertyType type, Int32 val) { InitpropertyListItem(name, type, val.ToString()); }
public propertyListItem(string name, propertyType type, string val) { InitpropertyListItem(name, type, val); }
public propertyListItem(string name, propertyType type) { InitpropertyListItem(name, type, ""); }
public propertyListItem(propertyType type) { InitpropertyListItem("", type, ""); }
protected virtual void InitpropertyListItem(string name, propertyType type , string val) { if(name != "") this.name = name; if(type != propertyType.NONE) this.type = type; Setup(); if(val != "") this.SetValue(val); }
/// <summary> /// /// </summary> /// <param name="co"></param> /// <returns></returns> private static digitalObject CreateDigitalObject(ContentObject co) { var dObj = new digitalObject(); dObj.PID = co.PID; dObj.objectProperties = new objectPropertiesType(); dObj.objectProperties.property = new propertyType[1]; var label = new propertyType(); label.NAME = propertyTypeNAME.infofedorafedorasystemdefmodellabel; label.VALUE = co.Title; dObj.objectProperties.property[0] = label; return dObj; }
public Tank(propertyType _p) { type = troopType.TANK; health = Constants.Entity.Troop.Tank.health; p_type = _p; }
public Plane(propertyType _p) { type = troopType.PLANE; health = Constants.Entity.Troop.Plane.health; p_type = _p; }
public Soldier(propertyType _p) { type = troopType.SOLDIER; health = Constants.Entity.Troop.Soldier.health; p_type = _p; }
public Car(propertyType _p) { type = troopType.CAR; health = Constants.Entity.Troop.Car.health; p_type = _p; }