public WebElementInstance FindElement(ByInstance by)
        {
            if (by == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "A predicate to search by must be specified.");
            }

            var result = WebDriver.FindElement(by.By);

            return(new WebElementInstance(this.Engine.Object.InstancePrototype, result));
        }
Exemplo n.º 2
0
        public WebElementInstance FindElement(ByInstance by)
        {
            if (by == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "The first argument cannot be null.");
            }

            var byby   = by.By;
            var result = m_webElement.FindElement(byby);

            return(new WebElementInstance(this.Engine.Object.InstancePrototype, result));
        }
        public ArrayInstance FindElements(ByInstance by)
        {
            if (by == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "A predicate to search by must be specified.");
            }

            var result      = WebDriver.FindElements(by.By);
            var resultArray = this.Engine.Array.Construct();

            foreach (var r in result)
            {
                ArrayInstance.Push(resultArray, new WebElementInstance(this.Engine.Object.InstancePrototype, r));
            }

            return(resultArray);
        }
Exemplo n.º 4
0
        public ArrayInstance FindElements(ByInstance by)
        {
            if (by == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "The first argument cannot be null.");
            }

            var byby   = by.By;
            var result = m_webElement.FindElements(byby);

            var arr = this.Engine.Array.Construct();

            foreach (var r in result)
            {
                ArrayInstance.Push(new WebElementInstance(this.Engine.Object.InstancePrototype, r));
            }
            return(arr);
        }