How to use TouchScroll_Arbitrary method of WebDriverAPI.TouchScroll class

Best WinAppDriver code snippet using WebDriverAPI.TouchScroll.TouchScroll_Arbitrary

TouchScroll.cs

Source:TouchScroll.cs Github

copy

Full Screen

...31 {32 TearDown();33 }34 [TestMethod]35 public void TouchScroll_Arbitrary()36 {37 var alarmPivotItem = session.FindElementByAccessibilityId("AlarmPivotItem");38 var stopwatchPivotItem = session.FindElementByAccessibilityId("StopwatchPivotItem");39 Assert.IsNotNull(alarmPivotItem);40 Assert.IsNotNull(stopwatchPivotItem);41 Assert.IsTrue(alarmPivotItem.Selected);42 Assert.IsFalse(stopwatchPivotItem.Selected);43 // Perform scroll right touch action to switch from Alarm tab to Stopwatch tab44 touchScreen.Scroll(100, 0);45 Thread.Sleep(TimeSpan.FromSeconds(1));46 Assert.IsFalse(alarmPivotItem.Selected);47 Assert.IsTrue(stopwatchPivotItem.Selected);48 // Perform scroll left touch action to scroll back from Stopwatch tab to Alarm tab49 touchScreen.Scroll(-100, 0);...

Full Screen

Full Screen

TouchScroll_Arbitrary

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using OpenQA.Selenium;7using OpenQA.Selenium.Appium;8using OpenQA.Selenium.Appium.Android;9using OpenQA.Selenium.Remote;10using OpenQA.Selenium.Appium.Enums;11using OpenQA.Selenium.Appium.MultiTouch;12using OpenQA.Selenium.Appium.Interfaces;13using OpenQA.Selenium.Appium.Android.Interfaces;14using OpenQA.Selenium.Appium.Android.MultiTouch;15using OpenQA.Selenium.Appium.Android.API.Demo;16{17 {18 static void Main(string[] args)19 {20 var capabilities = new DesiredCapabilities();21 capabilities.SetCapability("platformName", "Android");22 capabilities.SetCapability("deviceName", "Android Emulator");23 capabilities.SetCapability("app", @"C:\Users\HP\Documents\Visual Studio 2015\Projects\WebDriverAPI\WebDriverAPI\bin\Debug\com.android.calculator2-2.apk");24 capabilities.SetCapability("appPackage", "com.android.calculator2");25 capabilities.SetCapability("appActivity", "com.android.calculator2.Calculator");26 capabilities.SetCapability("noReset", true);

Full Screen

Full Screen

TouchScroll_Arbitrary

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using OpenQA.Selenium;7using OpenQA.Selenium.Remote;8using OpenQA.Selenium.Appium;9using OpenQA.Selenium.Appium.Android;10using OpenQA.Selenium.Appium.MultiTouch;11using OpenQA.Selenium.Appium.Interfaces;12using OpenQA.Selenium.Support.UI;13using OpenQA.Selenium.Appium.Enums;14using OpenQA.Selenium.Appium.Service;15{16 {17 static void Main(string[] args)18 {19 AppiumServiceBuilder builder = new AppiumServiceBuilder();20 builder.UsingAnyFreePort();21 builder.UsingDriverExecutable(@"C:\Program Files (x86)\Appium\node.exe");22 builder.WithAppiumJS(@"C:\Program Files (x86)\Appium\node_modules\appium\bin\appium.js");23 builder.WithLogFile(@"C:\Program Files (x86)\Appium\log.txt");24 AppiumLocalService service = builder.Build();25 service.Start();26 DesiredCapabilities capabilities = new DesiredCapabilities();27 capabilities.SetCapability("app", @"C:\Users\Public\Documents\Emulator Samples\Windows Phone Emulator 8.1 Sample Applications\Windows Phone 8.1 Samples\Windows Phone 8.1 SDK Samples\XAML\XAML Controls\XAML Controls Sample Application\XAML Controls Sample Application.appx");28 capabilities.SetCapability("deviceName", "WindowsPC");29 capabilities.SetCapability("platformName", "Windows");30 capabilities.SetCapability("platformVersion", "8.1");31 AndroidDriver driver = new AndroidDriver(service, capabilities);32 TouchScroll_Arbitrary(driver);33 driver.Quit();34 service.Dispose();35 }36 public static void TouchScroll_Arbitrary(AndroidDriver driver)37 {38 TouchAction scrollDown = new TouchAction(driver);39 scrollDown.Press(300, 400).MoveTo(300, 200).Release().Perform();40 TouchAction scrollUp = new TouchAction(driver);41 scrollUp.Press(300, 200).MoveTo(300, 400).Release().Perform();

Full Screen

Full Screen

TouchScroll_Arbitrary

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using OpenQA.Selenium;7using OpenQA.Selenium.Remote;8using OpenQA.Selenium.Appium;9using OpenQA.Selenium.Appium.Android;10using OpenQA.Selenium.Appium.MultiTouch;11using OpenQA.Selenium.Appium.Interfaces;12using OpenQA.Selenium.Appium.Enums;13using OpenQA.Selenium.Appium.MultiTouch;14using OpenQA.Selenium.Appium.iOS;15{16 {17 static void Main(string[] args)18 {19 DesiredCapabilities cap = new DesiredCapabilities();20 cap.SetCapability("deviceName", "Android Emulator");21 cap.SetCapability("platformName", "Android");22 cap.SetCapability("platformVersion", "4.4.2");23 cap.SetCapability("appPackage", "com.android.calculator2");24 cap.SetCapability("appActivity", "com.android.calculator2.Calculator");

Full Screen

Full Screen

TouchScroll_Arbitrary

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using OpenQA.Selenium;7using OpenQA.Selenium.Chrome;8using OpenQA.Selenium.Interactions;9using OpenQA.Selenium.Support.UI;10using OpenQA.Selenium.Interactions.Internal;11using System.Threading;12using OpenQA.Selenium.Remote;13using OpenQA.Selenium.Appium;14using OpenQA.Selenium.Appium.Android;15using OpenQA.Selenium.Appium.Interfaces;16using OpenQA.Selenium.Appium.MultiTouch;17using OpenQA.Selenium.Appium.Android.Interfaces;18using OpenQA.Selenium.Appium.Android.Enums;19using OpenQA.Selenium.Appium.Enums;20{21 {22 static void Main(string[] args)23 {24 var options = new ChromeOptions();25 options.AddArgument("disable-infobars");26 options.AddArgument("--disable-extensions");27 options.AddArgument("--start-maximized");28 options.AddArgument("--disable-notifications");29 options.AddArgument("--disable-popup-blocking");30 options.AddArgument("--disable-translate");31 options.AddArgument("--disable-geolocation");32 options.AddArgument("--disable-bundled-ppapi-flash");33 options.AddArgument("--disable-internal-flash");

Full Screen

Full Screen

TouchScroll_Arbitrary

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using OpenQA.Selenium;7using OpenQA.Selenium.Remote;8using OpenQA.Selenium.Support.UI;9using OpenQA.Selenium.Appium;10using OpenQA.Selenium.Appium.Android;11using OpenQA.Selenium.Appium.Enums;12using OpenQA.Selenium.Appium.MultiTouch;13using OpenQA.Selenium.Appium.Interfaces;14using OpenQA.Selenium.Appium.MultiTouch;15using OpenQA.Selenium.Appium.Android.Interfaces;16using OpenQA.Selenium.Appium.Android.Enums;17using OpenQA.Selenium.Appium.Android;18using OpenQA.Selenium.Appium.iOS;19using OpenQA.Selenium.Appium.iOS.Enums;20using OpenQA.Selenium.Appium.iOS.Interfaces;21using OpenQA.Selenium.Appium.iOS;22using OpenQA.Selenium.Appium.Windows;23using OpenQA.Selenium.Appium.Windows.Enums;24using OpenQA.Selenium.Appium.Windows.Interfaces;25using OpenQA.Selenium.Appium.Windows;26using OpenQA.Selenium.Appium.Service;27using OpenQA.Selenium.Appium.Service.Options;28{29 {30 static void Main(string[] args)31 {32 AppiumServiceBuilder builder = new AppiumServiceBuilder();33 builder.UsingAnyFreePort();34 builder.WithIPAddress("

Full Screen

Full Screen

TouchScroll_Arbitrary

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using OpenQA.Selenium;7using OpenQA.Selenium.Chrome;8using OpenQA.Selenium.Interactions;9using OpenQA.Selenium.Support.UI;10using OpenQA.Selenium.Remote;11{12 {13 static void Main(string[] args)14 {15 RemoteWebDriver driver = null;16 {17 driver = new ChromeDriver();18 driver.Manage().Window.Maximize();19 TouchScroll scroll = new TouchScroll(driver);20 scroll.ScrollDown(100);21 scroll.ScrollUp(50);22 }23 catch (Exception e)24 {25 Console.WriteLine(e.Message);26 }27 {28 driver.Quit();29 }30 }31 }32}

Full Screen

Full Screen

TouchScroll_Arbitrary

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using OpenQA.Selenium;7using OpenQA.Selenium.Chrome;8using OpenQA.Selenium.Interactions;9using OpenQA.Selenium.Remote;10using OpenQA.Selenium.Support.UI;11using OpenQA.Selenium.Appium;12using OpenQA.Selenium.Appium.Android;13using OpenQA.Selenium.Appium.MultiTouch;14using OpenQA.Selenium.Appium.Interfaces;15using System.Diagnostics;16using System.Threading;17{18 {19 static void Main(string[] args)20 {21 ProcessStartInfo startInfo = new ProcessStartInfo();22 startInfo.FileName = @"C:\Program Files (x86)\Appium\node.exe";23 startInfo.Arguments = @"C:\Program Files (x86)\Appium\node_modules\appium\bin\appium.js";24 startInfo.UseShellExecute = false;25 startInfo.RedirectStandardOutput = true;26 Process.Start(startInfo);27 Thread.Sleep(5000);28 AppiumOptions appiumOptions = new AppiumOptions();29 appiumOptions.AddAdditionalCapability("platformName", "Android");30 appiumOptions.AddAdditionalCapability("deviceName", "Android Emulator");31 appiumOptions.AddAdditionalCapability("appPackage", "com.android.chrome");32 appiumOptions.AddAdditionalCapability("appActivity", "com.google.android.apps.chrome.Main");

Full Screen

Full Screen

TouchScroll_Arbitrary

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using OpenQA.Selenium;7using OpenQA.Selenium.IE;8using OpenQA.Selenium.Remote;9using OpenQA.Selenium.Support.UI;10using OpenQA.Selenium.Interactions;11using System.Collections.ObjectModel;12using OpenQA.Selenium.Interactions.Internal;13using System.Threading;14using OpenQA.Selenium.Appium;15using OpenQA.Selenium.Appium.Android;16using OpenQA.Selenium.Appium.MultiTouch;17using OpenQA.Selenium.Appium.Interfaces;18using OpenQA.Selenium.Appium.Android.Interfaces;19using OpenQA.Selenium.Appium.Enums;20using OpenQA.Selenium.Appium.Service;21{22 {23 static void Main(string[] args)24 {25 string driverPath = @"C:\Users\Public\Documents\QTP\Drivers\";26 AppiumDriver<IWebElement> driver;27 AppiumLocalService appiumService;28 DesiredCapabilities capabilities = new DesiredCapabilities();29 AppiumOptions options = new AppiumOptions();30 DriverService service;31 TouchAction touchAction = new TouchAction(driver);32 appiumService = new AppiumServiceBuilder().UsingAnyFreePort().Build();33 appiumService.Start();34 capabilities.SetCapability("deviceName", "Android Emulator");35 capabilities.SetCapability("platformName", "Android");36 capabilities.SetCapability("platformVersion", "8.0");37 capabilities.SetCapability("appPackage", "com.android.chrome");38 capabilities.SetCapability("appActivity", "com.google.android.apps.chrome.Main");39 capabilities.SetCapability("autoGrantPermissions", true);40 capabilities.SetCapability("noReset", true);41 options.AddAdditionalCapability("deviceName", "Android Emulator");42 options.AddAdditionalCapability("platformName", "Android");43 options.AddAdditionalCapability("platformVersion", "8.0");44 options.AddAdditionalCapability("appPackage", "com.android.chrome");45 options.AddAdditionalCapability("appActivity", "com.google.android.apps.chrome.Main");46 options.AddAdditionalCapability("autoGrantPermissions", true);

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run WinAppDriver automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful