Best FlaUI code snippet using FlaUI.UIA3.Patterns.ScrollPattern.Scroll
ScrollPattern.cs
Source:ScrollPattern.cs
...7using UIA = Interop.UIAutomationClient;89namespace FlaUI.UIA3.Patterns10{11 public class ScrollPattern : ScrollPatternBase<UIA.IUIAutomationScrollPattern>12 {13 public static readonly PatternId Pattern = PatternId.Register(AutomationType.UIA3, UIA.UIA_PatternIds.UIA_ScrollPatternId, "Scroll", AutomationObjectIds.IsScrollPatternAvailableProperty);14 public static readonly PropertyId HorizontallyScrollableProperty = PropertyId.Register(AutomationType.UIA3, UIA.UIA_PropertyIds.UIA_ScrollHorizontallyScrollablePropertyId, "HorizontallyScrollable");15 public static readonly PropertyId HorizontalScrollPercentProperty = PropertyId.Register(AutomationType.UIA3, UIA.UIA_PropertyIds.UIA_ScrollHorizontalScrollPercentPropertyId, "HorizontalScrollPercent");16 public static readonly PropertyId HorizontalViewSizeProperty = PropertyId.Register(AutomationType.UIA3, UIA.UIA_PropertyIds.UIA_ScrollHorizontalViewSizePropertyId, "HorizontalViewSize");17 public static readonly PropertyId VerticallyScrollableProperty = PropertyId.Register(AutomationType.UIA3, UIA.UIA_PropertyIds.UIA_ScrollVerticallyScrollablePropertyId, "VerticallyScrollable");18 public static readonly PropertyId VerticalScrollPercentProperty = PropertyId.Register(AutomationType.UIA3, UIA.UIA_PropertyIds.UIA_ScrollVerticalScrollPercentPropertyId, "VerticalScrollPercent");19 public static readonly PropertyId VerticalViewSizeProperty = PropertyId.Register(AutomationType.UIA3, UIA.UIA_PropertyIds.UIA_ScrollVerticalViewSizePropertyId, "VerticalViewSize");2021 public ScrollPattern(FrameworkAutomationElementBase frameworkAutomationElement, UIA.IUIAutomationScrollPattern nativePattern) : base(frameworkAutomationElement, nativePattern)22 {23 }2425 public override void Scroll(ScrollAmount horizontalAmount, ScrollAmount verticalAmount)26 {27 Com.Call(() => NativePattern.Scroll((UIA.ScrollAmount)horizontalAmount, (UIA.ScrollAmount)verticalAmount));28 }2930 public override void SetScrollPercent(double horizontalPercent, double verticalPercent)31 {32 Com.Call(() => NativePattern.SetScrollPercent(horizontalPercent, verticalPercent));33 }34 }3536 public class ScrollPatternPropertyIds : IScrollPatternPropertyIds37 {38 public PropertyId HorizontallyScrollable => ScrollPattern.HorizontallyScrollableProperty;3940 public PropertyId HorizontalScrollPercent => ScrollPattern.HorizontalScrollPercentProperty;4142 public PropertyId HorizontalViewSize => ScrollPattern.HorizontalViewSizeProperty;4344 public PropertyId VerticallyScrollable => ScrollPattern.VerticallyScrollableProperty;4546 public PropertyId VerticalScrollPercent => ScrollPattern.VerticalScrollPercentProperty;4748 public PropertyId VerticalViewSize => ScrollPattern.VerticalViewSizeProperty;49 }50}
...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!