private void PrepareCurrentPOMElementsData() { //get original elements ObservableList <ElementInfo> AllCurrentOriginalPOMs = POM.GetUnifiedElementsList(); //copy original so won't be effected foreach (ElementInfo originalElement in AllCurrentOriginalPOMs) { ElementInfo copiedElement = (ElementInfo)originalElement.CreateCopy(false); copiedElement.ElementGroup = originalElement.ElementGroup; POMElementsCopy.Add(copiedElement); } //try to locate them and pull real IWebElement for them for later comparison mIWindowExplorerDriver.CollectOriginalElementsDataForDeltaCheck(POMElementsCopy); }
public void FocusSpyItemOnElementsGrid() { if (mSpyElement == null) { return; } ElementInfo matchingOriginalElement = (ElementInfo)mWinExplorer.GetMatchingElement(mSpyElement, mPOM.GetUnifiedElementsList()); if (matchingOriginalElement == null) { mWinExplorer.LearnElementInfoDetails(mSpyElement); matchingOriginalElement = (ElementInfo)mWinExplorer.GetMatchingElement(mSpyElement, mPOM.GetUnifiedElementsList()); } if (mPOM.MappedUIElements.Contains(matchingOriginalElement)) { xMappedElementsTab.Focus(); mPOM.MappedUIElements.CurrentItem = matchingOriginalElement; mappedUIElementsPage.MainElementsGrid.ScrollToViewCurrentItem(); return; } if (mPOM.UnMappedUIElements.Contains(matchingOriginalElement)) { xUnmappedElementsTab.Focus(); mPOM.UnMappedUIElements.CurrentItem = matchingOriginalElement; unmappedUIElementsPage.MainElementsGrid.ScrollToViewCurrentItem(); return; } xStatusLable.Content = "Found element is not included in below elements list, click here to add it "; xCreateNewElement.Visibility = Visibility.Visible; }