コード例 #1
0
        private IEnumerable <TElement> GetAndWaitWebDriverElements()
        {
            var elementWaiter = new ElementWaitService <TDriver, TDriverElement>();

            elementWaiter.WaitInternal(_by, new WaitToExistStrategy <TDriver, TDriverElement>());

            var nativeElements = _mobileElement == null
                ? _by.FindAllElements(WrappedDriver)
                : _by.FindAllElements(_mobileElement);

            foreach (var nativeElement in nativeElements)
            {
                var            elementRepository = new ElementRepository();
                var            wrappedDriver     = ServicesCollection.Current.Resolve <TDriver>();
                TDriverElement currentNativeElement;
                if (wrappedDriver is AndroidDriver <AndroidElement> )
                {
                    currentNativeElement = (TDriverElement)Activator.CreateInstance(typeof(AndroidElement), wrappedDriver, nativeElement.Id);
                }
                else
                {
                    currentNativeElement = (TDriverElement)Activator.CreateInstance(typeof(IOSElement), wrappedDriver, nativeElement.Id);
                }

                yield return(elementRepository.CreateElementThatIsFound <TElement, TBy, TDriver, TDriverElement>(_by, currentNativeElement));
            }
        }
コード例 #2
0
ファイル: Element.cs プロジェクト: tamirg7/BELLATRIX
 public Element()
 {
     _elementWaiter       = new ElementWaitService();
     WrappedDriver        = ServicesCollection.Current.Resolve <IWebDriver>();
     _untils              = new List <WaitStrategy>();
     JavaScriptService    = ServicesCollection.Current.Resolve <JavaScriptService>();
     BrowserService       = ServicesCollection.Current.Resolve <BrowserService>();
     ElementCreateService = ServicesCollection.Current.Resolve <ElementCreateService>();
 }
コード例 #3
0
        private IEnumerable <IWebElement> WaitWebDriverElements()
        {
            var elementFinder = _parentElement == null
                ? new NativeElementFinderService(WrappedDriver)
                : new NativeElementFinderService(_parentElement);
            var elementWaiter = new ElementWaitService();

            if (_parentElement == null)
            {
                return(ConditionalWait(elementFinder));
            }
            else
            {
                var elementRepository = new ElementRepository();
                var parentElement     = elementRepository.CreateElementThatIsFound <Element>(_by, _parentElement, true);

                return(ConditionalWait(elementFinder));
            }
        }
コード例 #4
0
ファイル: Element.cs プロジェクト: tamirg7/BELLATRIX
 public Element()
 {
     _elementWait  = new ElementWaitService <TDriver, TDriverElement>();
     WrappedDriver = ServicesCollection.Current.Resolve <TDriver>();
     _untils       = new List <WaitStrategy <TDriver, TDriverElement> >();
 }
コード例 #5
0
ファイル: Element.cs プロジェクト: aravindanath/BELLATRIX
 public Element()
 {
     _elementWait = new ElementWaitService();
     WrappedDriver = ServicesCollection.Current.Resolve<WindowsDriver<WindowsElement>>();
     _untils = new List<WaitStrategy>();
 }