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)); } }
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>(); }
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)); } }
public Element() { _elementWait = new ElementWaitService <TDriver, TDriverElement>(); WrappedDriver = ServicesCollection.Current.Resolve <TDriver>(); _untils = new List <WaitStrategy <TDriver, TDriverElement> >(); }
public Element() { _elementWait = new ElementWaitService(); WrappedDriver = ServicesCollection.Current.Resolve<WindowsDriver<WindowsElement>>(); _untils = new List<WaitStrategy>(); }