Esempio n. 1
0
        public WebElementInstance FindElement(SearchContextInstance searchContext)
        {
            if (searchContext == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "A Search Context must be specified.");
            }

            var result = m_by.FindElement(searchContext.SearchContext);

            return(new WebElementInstance(this.Engine.Object.InstancePrototype, result));
        }
Esempio n. 2
0
        public ArrayInstance FindElements(SearchContextInstance searchContext)
        {
            if (searchContext == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "A Search Context must be specified.");
            }

            var result      = m_by.FindElements(searchContext.SearchContext);
            var resultArray = this.Engine.Array.Construct();

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

            return(resultArray);
        }