Exemple #1
0
        public void UseTextControlSource()
        {
            Log.Comment("Selecting ParallaxView tests");

            using (var setup = new TestSetupHelper("ParallaxView Tests"))
            {
                Log.Comment("Navigating to TextPage");
                UIObject navigateToTextUIObject = FindElement.ByName("navigateToText");
                Verify.IsNotNull(navigateToTextUIObject, "Verifying that navigateToText Button was found");

                Button navigateToTextButton = new Button(navigateToTextUIObject);
                navigateToTextButton.Invoke();
                Wait.ForIdle();

                Log.Comment("Retrieving TextBox");
                UIObject textBoxUIObject = FindElement.ByName("textBox");
                Verify.IsNotNull(textBoxUIObject, "Verifying that textBox was found");

                Log.Comment("Retrieving RichEditBox");
                UIObject richEditBoxUIObject = FindElement.ByName("richEditBox");
                Verify.IsNotNull(richEditBoxUIObject, "Verifying that RichEditBox was found");

                Log.Comment("Tapping RichEditBox");
                InputHelper.Tap(richEditBoxUIObject);

                Log.Comment("Panning TextBox");
                InputHelper.Pan(textBoxUIObject, 50, Direction.North);
                Wait.ForIdle();

                Log.Comment("Returning to the main ParallaxView test page");
                TestSetupHelper.GoBack();
            }
        }
Exemple #2
0
        public void TargetListViewItem()
        {
            Log.Comment("Selecting ParallaxView tests");

            using (var setup = new TestSetupHelper("ParallaxView Tests"))
            {
                Log.Comment("Navigating to ListViewItemPage");
                UIObject navigateToListViewItemUIObject = FindElement.ByName("navigateToListViewItem");
                Verify.IsNotNull(navigateToListViewItemUIObject, "Verifying that navigateToListViewItem Button was found");

                Button navigateToListViewItemButton = new Button(navigateToListViewItemUIObject);
                navigateToListViewItemButton.Invoke();
                Wait.ForIdle();

                Log.Comment("Retrieving ListView");
                UIObject ingredientListUIObject = FindElement.ByName("IngredientList");
                Verify.IsNotNull(ingredientListUIObject, "Verifying that ingredientList ListView was found");

                Log.Comment("Panning ListView");
                InputHelper.Pan(ingredientListUIObject, 50, Direction.North);
                Wait.ForIdle();

                Log.Comment("Returning to the main ParallaxView test page");
                TestSetupHelper.GoBack();
            }
        }
Exemple #3
0
        private void ChangeSourceAndTargetProperties(SourceType sourceType)
        {
            Log.Comment("Selecting ParallaxView tests");

            using (var setup = new TestSetupHelper("ParallaxView Tests"))
            {
                Log.Comment("Navigating to DynamicPage");
                UIObject navigateToDynamicUIObject = FindElement.ByName("navigateToDynamic");
                Verify.IsNotNull(navigateToDynamicUIObject, "Verifying that navigateToDynamic Button was found");

                Button navigateToDynamicButton = new Button(navigateToDynamicUIObject);
                navigateToDynamicButton.Invoke();
                Wait.ForIdle();

                string sourceName = sourceType == SourceType.ScrollViewer ? "scrollViewer" : "scroller";

                SelectSource(sourceName);
                Wait.ForIdle();

                SelectTarget("img");
                Wait.ForIdle();

                WriteInTextBox("txtVerticalShift", "100.0");

                Log.Comment("Retrieving SetVerticalShift Button");
                Button setVerticalShiftButton = new Button(FindElement.ByName("btnSetVerticalShift"));

                Log.Comment("Invoke SetVerticalShift Button");
                setVerticalShiftButton.Invoke();

                Log.Comment("Retrieving " + sourceName);
                UIObject sourceUIObject = FindElement.ByName(sourceName);
                Verify.IsNotNull(sourceUIObject, "Verifying that " + sourceName + " was found");

                Log.Comment("Tapping " + sourceName);
                InputHelper.Tap(sourceUIObject);

                Log.Comment("Panning " + sourceName);
                InputHelper.Pan(sourceUIObject, 50, Direction.North);
                Wait.ForIdle();

                Log.Comment("Returning to the main ParallaxView test page");
                TestSetupHelper.GoBack();
            }
        }
        public void ScrollHorizontally()
        {
            Log.Comment("Selecting Scroller tests");

            using (var setup = new TestSetupHelper("Scroller Tests"))
            {
                Log.Comment("Navigating to ScrollersWithSimpleContentsPage");
                UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents");
                Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found");

                Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject);
                navigateToSimpleContentsButton.Invoke();
                Wait.ForIdle();

                Log.Comment("Retrieving Scroller");
                Scroller scroller31UIObject = new Scroller(FindElement.ByName("Scroller31"));
                Verify.IsNotNull(scroller31UIObject, "Verifying that Scroller was found");

                Verify.IsTrue(scroller31UIObject.HorizontallyScrollable, "Verifying HorizontallyScrollable is true");
                Verify.IsTrue(scroller31UIObject.HorizontalViewSize > 0.0, "Verifying HorizontalViewSize is positive");
                Verify.AreEqual(scroller31UIObject.HorizontalScrollPercent, 0.0, "Verifying HorizontalScrollPercent is zero");

                Log.Comment("Scrolling Scroller horizontally");
                scroller31UIObject.ScrollHorizontal(ScrollAmount.LargeIncrement);

                Log.Comment("Waiting for HorizontalScrollPercent={0} to change", scroller31UIObject.HorizontalScrollPercent);
                Wait.ForScrollChanged(scroller31UIObject, ScrollProperty.HorizontalScrollPercent);

                Log.Comment("Final HorizontalScrollPercent={0}", scroller31UIObject.HorizontalScrollPercent);

                Verify.IsTrue(scroller31UIObject.HorizontallyScrollable, "Verifying HorizontallyScrollable is true");
                Verify.IsTrue(scroller31UIObject.HorizontalViewSize > 0.0, "Verifying HorizontalViewSize is positive");
                Verify.IsTrue(scroller31UIObject.HorizontalScrollPercent > 0.0, "Verifying HorizontalScrollPercent is positive");

                Log.Comment("Returning to the main Scroller test page");
                TestSetupHelper.GoBack();
            }
        }
        public void ScrollWhileUsingExpressionAnimationSources()
        {
            Log.Comment("Selecting Scroller tests");

            using (var setup = new TestSetupHelper("Scroller Tests"))
            {
                SetOutputDebugStringLevel("Verbose");

                Log.Comment("Navigating to ScrollerExpressionAnimationSourcesPage");
                UIObject navigateToExpressionAnimationSourcesUIObject = FindElement.ByName("navigateToExpressionAnimationSources");
                Verify.IsNotNull(navigateToExpressionAnimationSourcesUIObject, "Verifying that navigateToExpressionAnimationSources Button was found");

                Button navigateToExpressionAnimationSourcesButton = new Button(navigateToExpressionAnimationSourcesUIObject);
                navigateToExpressionAnimationSourcesButton.Invoke();
                Wait.ForIdle();

                SetLoggingLevel(isPrivateLoggingEnabled: true);

                Log.Comment("Retrieving Scroller");
                Scroller scrollerUIObject = new Scroller(FindElement.ByName("scroller"));
                Verify.IsNotNull(scrollerUIObject, "Verifying that Scroller was found");

                Verify.IsTrue(scrollerUIObject.HorizontallyScrollable, "Verifying HorizontallyScrollable is true");
                Verify.IsTrue(scrollerUIObject.HorizontalViewSize > 0.0, "Verifying HorizontalViewSize is positive");
                Verify.AreEqual(scrollerUIObject.HorizontalScrollPercent, 0.0, "Verifying HorizontalScrollPercent is zero");

                Log.Comment("Waiting for final layout");
                WaitForEditValue(editName: "txtLayoutCompleted", editValue: "Yes");

                Edit textBox = new Edit(FindElement.ById("txtViewport"));
                Log.Comment("Viewport: " + textBox.Value);
                textBox = new Edit(FindElement.ById("txtExtent"));
                Log.Comment("Extent: " + textBox.Value);
                textBox = new Edit(FindElement.ById("txtBarVisualWidth"));

                Log.Comment("Scrolling Scroller horizontally and vertically");
                scrollerUIObject.SetScrollPercent(10.0, 20.0);

                Log.Comment("Waiting for HorizontalScrollPercent={0} to change", scrollerUIObject.HorizontalScrollPercent);
                Wait.ForScrollChanged(scrollerUIObject, ScrollProperty.HorizontalScrollPercent);

                Log.Comment("Final HorizontalScrollPercent={0}", scrollerUIObject.HorizontalScrollPercent);
                Log.Comment("Final VerticalScrollPercent={0}", scrollerUIObject.VerticalScrollPercent);

                if (Math.Abs(scrollerUIObject.HorizontalScrollPercent - 10.0) >= 0.0001 ||
                    Math.Abs(scrollerUIObject.VerticalScrollPercent - 20.0) >= 0.0001)
                {
                    LogAndClearTraces();
                }

                SetLoggingLevel(isPrivateLoggingEnabled: false);

                Verify.IsTrue(scrollerUIObject.HorizontallyScrollable, "Verifying HorizontallyScrollable is true");
                Verify.IsTrue(scrollerUIObject.HorizontalViewSize > 0.0, "Verifying HorizontalViewSize is positive");
                Verify.IsLessThan(Math.Abs(scrollerUIObject.HorizontalScrollPercent - 10.0), 0.0001, "Verifying HorizontalScrollPercent is close to 10.0");

                Verify.IsTrue(scrollerUIObject.VerticallyScrollable, "Verifying VerticallyScrollable is true");
                Verify.IsTrue(scrollerUIObject.VerticalViewSize > 0.0, "Verifying VerticalViewSize is positive");
                Verify.IsLessThan(Math.Abs(scrollerUIObject.VerticalScrollPercent - 20.0), 0.0001, "Verifying VerticalScrollPercent is close to 20.0");

                Log.Comment("Returning to the main Scroller test page");
                TestSetupHelper.GoBack();
                // Output-debug-string-level "None" is automatically restored when landing back on the Scroller test page.
            }
        }
        public void BasicInteractionTest()
        {
            if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5))
            {
                Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled.");
                return;
            }

            using (var setup = new TestSetupHelper("PTR Tests")) // This literally clicks the button corresponding to the test page.
            {
                Wait.ForIdle();
                Log.Comment("Retrieve the refresh container page button as generic UIElement");
                UIObject refreshContainerButtonUIObject = FindElement.ByName("RefreshContainerPageButton");
                Verify.IsNotNull(refreshContainerButtonUIObject, "Verifying that we found a UIElement called RefreshContainerPageButton");
                Wait.ForIdle();

                //Navigate to the right page
                InputHelper.Tap(refreshContainerButtonUIObject);
                Wait.ForIdle();

                Log.Comment("Retrieve adapted list view as generic UIElement");
                UIObject lvUIObject = FindElement.ByName("listView");
                Verify.IsNotNull(lvUIObject, "Verifying that we found a UIElement called listView");

                Wait.ForIdle();

                Log.Comment("Retrieve list view item one as generic UIElement");
                UIObject listViewItem1 = FindElement.ByName("listViewItem1");
                Verify.IsNotNull(listViewItem1, "Verifying that we found a UIElement called listViewItem1");

                Wait.ForIdle();

                Log.Comment("Retrieve list view item two as generic UIElement");
                UIObject listViewItem2 = FindElement.ByName("listViewItem2");
                Verify.IsNotNull(listViewItem1, "Verifying that we found a UIElement called listViewItem2");

                Wait.ForIdle();

                Log.Comment("Retrieve list view item ten as generic UIElement");
                UIObject listViewItem10 = FindElement.ByName("listViewItem10");
                Verify.IsNotNull(listViewItem1, "Verifying that we found a UIElement called listViewItem10");

                Wait.ForIdle();

                Log.Comment("Retrieve list view item nine as generic UIElement");
                UIObject listViewItem9 = FindElement.ByName("listViewItem9");
                Verify.IsNotNull(listViewItem1, "Verifying that we found a UIElement called listViewItem9");

                Wait.ForIdle();

                Log.Comment("Retrieve refresh on container button as generic UIElement");
                UIObject refreshOnContainerButtonUIObject = FindElement.ByName("RefreshOnContainerButton");
                Verify.IsNotNull(refreshOnContainerButtonUIObject, "Verifying that we found a UIElement called RefreshOnContainerButton");

                Wait.ForIdle();

                Log.Comment("Retrieve refresh on visualizer button as generic UIElement");
                UIObject refreshOnVisualizerButtonUIObject = FindElement.ByName("RefreshOnVisualizerButton");
                Verify.IsNotNull(refreshOnVisualizerButtonUIObject, "Verifying that we found a UIElement called RefreshOnVisualizerButton");

                Wait.ForIdle();

                Log.Comment("Retrieve rotate refresh visualizer button as generic UIElement");
                UIObject rotateButtonUIObject = FindElement.ByName("RotateButton");
                Verify.IsNotNull(rotateButtonUIObject, "Verifying that we found a UIElement called RotateButton");

                Wait.ForIdle();

                Log.Comment("Retrieve the change alignment button as generic UIElement");
                UIObject changeAlignmentUIObject = FindElement.ByName("ChangeAlignment");
                Verify.IsNotNull(changeAlignmentUIObject, "Verifying that we found a UIElement called ChangeAlignment");

                Wait.ForIdle();

                Log.Comment("Retrieve refresh count text block as generic UIElement");
                UIObject textboxUIObject = FindElement.ByName("RefreshCount");
                Verify.IsNotNull(textboxUIObject, "Verifying that we found a UIElement called RefreshCount");
                Edit textBox = new Edit(textboxUIObject);

                Wait.ForIdle();

                Log.Comment("Retrieve AddOrRemoveRefreshDelay button as generic UIElement");
                UIObject AddOrRemoveRefreshDelayButtonUIObject = FindElement.ByName("AddOrRemoveRefreshDelay");
                Verify.IsNotNull(AddOrRemoveRefreshDelayButtonUIObject, "Verifying that we found a UIElement called AddOrRemoveRefreshDelay");

                Wait.ForIdle();

                InputHelper.Tap(AddOrRemoveRefreshDelayButtonUIObject);
                InputHelper.Tap(refreshOnContainerButtonUIObject);
                WaitForEditValue("RefreshCount", "1");

                InputHelper.Tap(refreshOnVisualizerButtonUIObject);
                WaitForEditValue("RefreshCount", "2");

                InputHelper.Tap(changeAlignmentUIObject);
                Wait.ForIdle();
                InputHelper.DragDistance(listViewItem1, 450, Direction.South, 800);
                WaitForEditValue("RefreshCount", "3");

                InputHelper.Tap(rotateButtonUIObject);
                InputHelper.Tap(changeAlignmentUIObject);
                Wait.ForIdle();
                InputHelper.DragDistance(listViewItem2, 450, Direction.East, 800);
                WaitForEditValue("RefreshCount", "4");

                //The SV won't be at the bottom of its content to start so we will enter the peeking
                //state and not perform a refresh
                InputHelper.Tap(rotateButtonUIObject);
                InputHelper.Tap(changeAlignmentUIObject);
                Wait.ForIdle();
                InputHelper.DragDistance(lvUIObject, 750, Direction.North);
                Wait.ForIdle();
                LogRefreshVisualizerStates();
                Verify.AreEqual("4", textBox.Value);

                InputHelper.DragDistance(listViewItem10, 450, Direction.North, 800);
                WaitForEditValue("RefreshCount", "5");

                InputHelper.Tap(rotateButtonUIObject);
                InputHelper.Tap(changeAlignmentUIObject);
                Wait.ForIdle();
                InputHelper.DragDistance(listViewItem9, 450, Direction.West, 800);
                WaitForEditValue("RefreshCount", "6");

                Log.Comment("Returning to the main PTR test page");
                TestSetupHelper.GoBack();
            }
        }
        public void InteractionOnImageTestPrivate(bool withInfoProvider)
        {
            if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5))
            {
                Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled.");
                return;
            }

            using (var setup = new TestSetupHelper("PTR Tests")) // This literally clicks the button corresponding to the test page.
            {
                if (PlatformConfiguration.IsDevice(DeviceType.Phone))
                {
                    Log.Warning("MSFT: 12949886 - Test is disabled on phone due to reliability issues");
                    return;
                }

                Wait.ForIdle();

                Log.Comment("Retrieve the refresh container on image page button as generic UIElement");
                UIObject refreshContainerOnImageButtonUIObject = FindElement.ByName("RefreshContainerOnImagePageButton");
                Verify.IsNotNull(refreshContainerOnImageButtonUIObject, "Verifying that we found a UIElement called RefreshContainerOnImagePageButton");
                Wait.ForIdle();

                //Navigate to the right page
                InputHelper.Tap(refreshContainerOnImageButtonUIObject);
                Wait.ForIdle();

                UIObject adaptButtonUIObject = null;

                if (withInfoProvider)
                {
                    Log.Comment("Retrieve the adapt button as generic UIElement");
                    adaptButtonUIObject = FindElement.ByName("AdaptButton");
                    Verify.IsNotNull(adaptButtonUIObject, "Verifying that we found a UIElement called AdaptButton");
                    Wait.ForIdle();
                }

                Log.Comment("Retrieve adapted image as generic UIElement");
                UIObject imageUIObject = FindElement.ByName("Image");
                Verify.IsNotNull(imageUIObject, "Verifying that we found a UIElement called Image");

                Wait.ForIdle();

                Log.Comment("Retrieve refresh on container button as generic UIElement");
                UIObject refreshOnContainerButtonUIObject = FindElement.ByName("RefreshOnContainerButton");
                Verify.IsNotNull(refreshOnContainerButtonUIObject, "Verifying that we found a UIElement called RefreshOnContainerButton");

                Wait.ForIdle();

                Log.Comment("Retrieve refresh on visualizer button as generic UIElement");
                UIObject refreshOnVisualizerButtonUIObject = FindElement.ByName("RefreshOnVisualizerButton");
                Verify.IsNotNull(refreshOnVisualizerButtonUIObject, "Verifying that we found a UIElement called RefreshOnVisualizerButton");

                Wait.ForIdle();

                Log.Comment("Retrieve rotate refresh visualizer button as generic UIElement");
                UIObject rotateButtonUIObject = FindElement.ByName("RotateButton");
                Verify.IsNotNull(rotateButtonUIObject, "Verifying that we found a UIElement called RotateButton");

                Wait.ForIdle();

                Log.Comment("Retrieve the change alignment button as generic UIElement");
                UIObject changeAlignmentUIObject = FindElement.ByName("ChangeAlignment");
                Verify.IsNotNull(changeAlignmentUIObject, "Verifying that we found a UIElement called ChangeAlignment");

                Wait.ForIdle();

                Log.Comment("Retrieve AddOrRemoveRefreshDelay button as generic UIElement");
                UIObject AddOrRemoveRefreshDelayButtonUIObject = FindElement.ByName("AddOrRemoveRefreshDelay");
                Verify.IsNotNull(AddOrRemoveRefreshDelayButtonUIObject, "Verifying that we found a UIElement called AddOrRemoveRefreshDelay");

                Wait.ForIdle();

                Log.Comment("Retrieve ChangeRefreshRequested button as generic UIElement");
                UIObject ChangeRefreshRequestedUIObject = FindElement.ByName("ChangeRefreshRequested");
                Verify.IsNotNull(ChangeRefreshRequestedUIObject, "Verifying that we found a UIElement called ChangeRefreshRequested");

                Wait.ForIdle();

                if (withInfoProvider)
                {
                    InputHelper.Tap(adaptButtonUIObject);
                    Wait.ForIdle();
                }

                InputHelper.Tap(AddOrRemoveRefreshDelayButtonUIObject);
                InputHelper.Tap(refreshOnContainerButtonUIObject);
                WaitForEditValue("RefreshCount", "1", logInteractionRatios: withInfoProvider);

                InputHelper.Tap(ChangeRefreshRequestedUIObject);
                InputHelper.Tap(refreshOnVisualizerButtonUIObject);
                WaitForEditValue("RefreshCount", "2", logInteractionRatios: withInfoProvider);
                InputHelper.Tap(ChangeRefreshRequestedUIObject);

                InputHelper.Tap(changeAlignmentUIObject);
                Wait.ForIdle();
                InputHelper.DragDistance(imageUIObject, 450, Direction.South, 600);
                WaitForEditValue("RefreshCount", "3", logInteractionRatios: withInfoProvider);

                InputHelper.Tap(rotateButtonUIObject);
                InputHelper.Tap(changeAlignmentUIObject);
                Wait.ForIdle();
                if (withInfoProvider)
                {
                    InputHelper.Tap(adaptButtonUIObject);
                    Wait.ForIdle();
                }
                InputHelper.DragDistance(imageUIObject, 450, Direction.East, 600);
                WaitForEditValue("RefreshCount", "4", logInteractionRatios: withInfoProvider);

                InputHelper.Tap(rotateButtonUIObject);
                InputHelper.Tap(changeAlignmentUIObject);
                Wait.ForIdle();
                if (withInfoProvider)
                {
                    InputHelper.Tap(adaptButtonUIObject);
                    Wait.ForIdle();
                }
                InputHelper.DragDistance(imageUIObject, 450, Direction.North, 600);
                WaitForEditValue("RefreshCount", "5", logInteractionRatios: withInfoProvider);

                InputHelper.Tap(rotateButtonUIObject);
                InputHelper.Tap(changeAlignmentUIObject);
                Wait.ForIdle();
                if (withInfoProvider)
                {
                    InputHelper.Tap(adaptButtonUIObject);
                    Wait.ForIdle();
                }
                InputHelper.DragDistance(imageUIObject, 450, Direction.West, 600);
                WaitForEditValue("RefreshCount", "6", logInteractionRatios: withInfoProvider);

                Log.Comment("Returning to the main PTR test page");
                TestSetupHelper.GoBack();
            }
        }
        public void RefreshRequestedHandlersWorkOnEitherContainerOrVisualizerOrBoth()
        {
            if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone2))
            {
                Log.Warning("Test is disabled on pre-RS2 due to chaining being disabled before this point");
                return;
            }

            using (var setup = new TestSetupHelper("PTR Tests")) // This literally clicks the button corresponding to the test page.
            {
                Log.Comment("Retrieve the refresh container page button as generic UIElement");
                UIObject refreshContainerButtonUIObject = FindElement.ByName("RefreshContainerPageButton");
                Verify.IsNotNull(refreshContainerButtonUIObject, "Verifying that we found a UIElement called RefreshContainerPageButton");
                Wait.ForIdle();

                //Navigate to the right page
                InputHelper.Tap(refreshContainerButtonUIObject);
                Wait.ForIdle();

                Log.Comment("Retrieve refresh on container button as generic UIElement");
                UIObject refreshOnContainerButtonUIObject = FindElement.ByName("RefreshOnContainerButton");
                Verify.IsNotNull(refreshOnContainerButtonUIObject, "Verifying that we found a UIElement called RefreshOnContainerButton");

                Wait.ForIdle();

                Log.Comment("Retrieve refresh on visualizer button as generic UIElement");
                UIObject refreshOnVisualizerButtonUIObject = FindElement.ByName("RefreshOnVisualizerButton");
                Verify.IsNotNull(refreshOnVisualizerButtonUIObject, "Verifying that we found a UIElement called RefreshOnVisualizerButton");

                Wait.ForIdle();

                Log.Comment("Retrieve refresh count text block as generic UIElement");
                UIObject textboxUIObject = FindElement.ByName("RefreshCount");
                Verify.IsNotNull(textboxUIObject, "Verifying that we found a UIElement called RefreshCount");
                Edit textBox = new Edit(textboxUIObject);

                Wait.ForIdle();

                Log.Comment("Retrieve AddOrRemoveRefreshDelay button as generic UIElement");
                UIObject AddOrRemoveRefreshDelayButtonUIObject = FindElement.ByName("AddOrRemoveRefreshDelay");
                Verify.IsNotNull(AddOrRemoveRefreshDelayButtonUIObject, "Verifying that we found a UIElement called AddOrRemoveRefreshDelay");

                Wait.ForIdle();

                Log.Comment("Retrieve RCRefreshRequestedComboBoxSwitcher button as generic UIElement");
                UIObject RCRefreshRequestedComboBoxSwitcherUIObject = FindElement.ByName("RCRefreshRequestedComboBoxSwitcher");
                Verify.IsNotNull(RCRefreshRequestedComboBoxSwitcherUIObject, "Verifying that we found a UIElement called RCRefreshRequestedComboBoxSwitcher");

                Wait.ForIdle();

                Log.Comment("Retrieve RVRefreshRequestedComboBoxSwitcher button as generic UIElement");
                UIObject RVRefreshRequestedComboBoxSwitcherUIObject = FindElement.ByName("RVRefreshRequestedComboBoxSwitcher");
                Verify.IsNotNull(RVRefreshRequestedComboBoxSwitcherUIObject, "Verifying that we found a UIElement called RVRefreshRequestedComboBoxSwitcher");

                Wait.ForIdle();

                InputHelper.Tap(AddOrRemoveRefreshDelayButtonUIObject);

                InputHelper.Tap(refreshOnContainerButtonUIObject);
                WaitForEditValue("RefreshCount", "1");
                InputHelper.Tap(refreshOnVisualizerButtonUIObject);
                WaitForEditValue("RefreshCount", "2");

                InputHelper.Tap(RVRefreshRequestedComboBoxSwitcherUIObject);

                //Now that both are on, the refresh count will go up twice as fast
                InputHelper.Tap(refreshOnContainerButtonUIObject);
                WaitForEditValue("RefreshCount", "4");
                InputHelper.Tap(refreshOnVisualizerButtonUIObject);
                WaitForEditValue("RefreshCount", "6");

                InputHelper.Tap(RCRefreshRequestedComboBoxSwitcherUIObject);

                InputHelper.Tap(refreshOnContainerButtonUIObject);
                WaitForEditValue("RefreshCount", "7");
                InputHelper.Tap(refreshOnVisualizerButtonUIObject);
                WaitForEditValue("RefreshCount", "8");

                InputHelper.Tap(RVRefreshRequestedComboBoxSwitcherUIObject);

                //Now that neither are on the refresh count won't increase
                InputHelper.Tap(refreshOnContainerButtonUIObject);
                Wait.ForIdle();
                LogRefreshVisualizerStates();
                Verify.AreEqual("8", textBox.Value);
                InputHelper.Tap(refreshOnVisualizerButtonUIObject);
                Wait.ForIdle();
                LogRefreshVisualizerStates();
                Verify.AreEqual("8", textBox.Value);

                Log.Comment("Returning to the main PTR test page");
                TestSetupHelper.GoBack();
            }
        }
        public void ExerciseScrollBar2APIs()
        {
            Log.Comment("Selecting ScrollBar2 tests");

            using (var setup = new TestSetupHelper("ScrollBar2 Tests"))
            {
                Log.Comment("Navigating to ScrollBar2DynamicPage");
                UIObject navigateToDynamicUIObject = FindElement.ByName("navigateToDynamic");
                Verify.IsNotNull(navigateToDynamicUIObject, "Verifying that navigateToDynamic Button was found");

                Button navigateToDynamicButton = new Button(navigateToDynamicUIObject);
                navigateToDynamicButton.Invoke();
                Wait.ForIdle();

                Log.Comment("Retrieving cmbIndicatorMode");
                ComboBox cmbIndicatorMode = new ComboBox(FindElement.ByName("cmbIndicatorMode"));
                Verify.IsNotNull(cmbIndicatorMode, "Verifying that cmbIndicatorMode was found");

                Log.Comment("Changing IndicatorMode to MouseIndicator");
                cmbIndicatorMode.SelectItemByName("MouseIndicator");
                Log.Comment("Selection is now {0}", cmbIndicatorMode.Selection[0].Name);

                Log.Comment("Retrieving btnSetIndicatorMode");
                UIObject btnSetIndicatorModeUIObject = FindElement.ByName("btnSetIndicatorMode");
                Verify.IsNotNull(btnSetIndicatorModeUIObject, "Verifying that btnSetIndicatorMode Button was found");

                Button btnSetIndicatorMode = new Button(btnSetIndicatorModeUIObject);
                Log.Comment("Tapping btnSetIndicatorMode");
                InputHelper.Tap(btnSetIndicatorMode);

                Log.Comment("Retrieving cmbScrollMode");
                ComboBox cmbScrollMode = new ComboBox(FindElement.ByName("cmbScrollMode"));
                Verify.IsNotNull(cmbScrollMode, "Verifying that cmbScrollMode was found");

                Log.Comment("Changing ScrollMode to Enabled");
                cmbScrollMode.SelectItemByName("Enabled");
                Log.Comment("Selection is now {0}", cmbScrollMode.Selection[0].Name);

                Log.Comment("Retrieving btnSetScrollMode");
                UIObject btnSetScrollModeUIObject = FindElement.ByName("btnSetScrollMode");
                Verify.IsNotNull(btnSetScrollModeUIObject, "Verifying that btnSetScrollMode Button was found");

                Button btnSetScrollMode = new Button(btnSetScrollModeUIObject);
                Log.Comment("Tapping btnSetScrollMode");
                InputHelper.Tap(btnSetScrollMode);

                Log.Comment("Retrieving cmbStyle");
                ComboBox cmbStyle = new ComboBox(FindElement.ByName("cmbStyle"));
                Verify.IsNotNull(cmbStyle, "Verifying that cmbStyle was found");

                Log.Comment("Changing Style to Hair");
                cmbStyle.SelectItemByName("Hair");
                Log.Comment("Selection is now {0}", cmbStyle.Selection[0].Name);

                Log.Comment("Retrieving btnSetStyle");
                UIObject btnSetStyleUIObject = FindElement.ByName("btnSetStyle");
                Verify.IsNotNull(btnSetStyleUIObject, "Verifying that btnSetStyle Button was found");

                Button btnSetStyle = new Button(btnSetStyleUIObject);
                Log.Comment("Tapping btnSetStyle");
                InputHelper.Tap(btnSetStyle);

                Log.Comment("Retrieving cmbOrientation");
                ComboBox cmbOrientation = new ComboBox(FindElement.ByName("cmbOrientation"));
                Verify.IsNotNull(cmbOrientation, "Verifying that cmbOrientation was found");

                Log.Comment("Changing Orientation to Horizontal");
                cmbOrientation.SelectItemByName("Horizontal");
                Log.Comment("Selection is now {0}", cmbOrientation.Selection[0].Name);

                Log.Comment("Retrieving btnSetOrientation");
                UIObject btnSetOrientationUIObject = FindElement.ByName("btnSetOrientation");
                Verify.IsNotNull(btnSetOrientationUIObject, "Verifying that btnSetOrientation Button was found");

                Button btnSetOrientation = new Button(btnSetOrientationUIObject);
                Log.Comment("Tapping btnSetOrientation");
                InputHelper.Tap(btnSetOrientation);

                Log.Comment("Retrieving btnSetValues");
                UIObject btnSetValuesUIObject = FindElement.ByName("btnSetValues");
                Verify.IsNotNull(btnSetValuesUIObject, "Verifying that btnSetValues Button was found");

                Button btnSetValues = new Button(btnSetValuesUIObject);
                Log.Comment("Tapping btnSetValues");
                InputHelper.Tap(btnSetValues);

                Log.Comment("Retrieving cmbIsEnabled");
                ComboBox cmbIsEnabled = new ComboBox(FindElement.ByName("cmbIsEnabled"));
                Verify.IsNotNull(cmbIsEnabled, "Verifying that cmbIsEnabled was found");

                Log.Comment("Changing IsEnabled to False");
                cmbIsEnabled.SelectItemByName("False");
                Log.Comment("Selection is now {0}", cmbIsEnabled.Selection[0].Name);

                Log.Comment("Retrieving btnSetIsEnabled");
                UIObject btnSetIsEnabledUIObject = FindElement.ByName("btnSetIsEnabled");
                Verify.IsNotNull(btnSetIsEnabledUIObject, "Verifying that btnSetIsEnabled Button was found");

                Button btnSetIsEnabled = new Button(btnSetIsEnabledUIObject);
                Log.Comment("Tapping btnSetIsEnabled");
                InputHelper.Tap(btnSetIsEnabled);

                Log.Comment("Changing IndicatorMode to TouchIndicator");
                cmbIndicatorMode.SelectItemByName("TouchIndicator");
                Log.Comment("Selection is now {0}", cmbIndicatorMode.Selection[0].Name);

                Log.Comment("Tapping btnSetIndicatorMode");
                InputHelper.Tap(btnSetIndicatorMode);

                Wait.ForIdle();

                Log.Comment("Returning to the main ScrollBar2 test page");
                TestSetupHelper.GoBack();
            }
        }