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);
        }
Esempio n. 2
0
        /// <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);
        }
Esempio n. 4
0
 public propertyListItem(string name, propertyType type, Int32 val)
 {
     InitpropertyListItem(name, type, val.ToString());
 }
Esempio n. 5
0
 public propertyListItem(string name, propertyType type, string val)
 {
     InitpropertyListItem(name, type, val);
 }
Esempio n. 6
0
 public propertyListItem(string name, propertyType type)
 {
     InitpropertyListItem(name, type, "");
 }
Esempio n. 7
0
 public propertyListItem(propertyType type)
 {
     InitpropertyListItem("", type, "");
 }
Esempio n. 8
0
        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);
        }
Esempio n. 9
0
 /// <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;
 }
Esempio n. 10
0
 public Tank(propertyType _p)
 {
     type   = troopType.TANK;
     health = Constants.Entity.Troop.Tank.health;
     p_type = _p;
 }
Esempio n. 11
0
 public Plane(propertyType _p)
 {
     type   = troopType.PLANE;
     health = Constants.Entity.Troop.Plane.health;
     p_type = _p;
 }
Esempio n. 12
0
 public Soldier(propertyType _p)
 {
     type   = troopType.SOLDIER;
     health = Constants.Entity.Troop.Soldier.health;
     p_type = _p;
 }
Esempio n. 13
0
 public Car(propertyType _p)
 {
     type   = troopType.CAR;
     health = Constants.Entity.Troop.Car.health;
     p_type = _p;
 }