Posts

Showing posts with the label Appium

C# Appium ScrollTo functionality

As on today, ScrollTo functionality in Appium (dot net binaries) is not working .Instead we need to use Swipe functionality if you want to scroll in the app. Let us discuss about swipe functionality in Appium. I used TouchAction to perform swipe.It needs x and y coordinates and the way i got those coordinates is explained in the sample code. new TouchAction (getDriver()) . press(startx, starty) . waitAction(duration) . moveTo(endx - startx, endy - starty) . release() . perform(); Sample Code: TouchAction act = new TouchAction(WebDriver); Size dimensions = WebDriver.Manage().Window.Size; double screenHeightStart = (dimensions.Height * 0.5); double screenHeightEnd = dimensions.Height * 0.2; act.Press(0, screenHeightStart).Wait(100).MoveTo(0 - 0, screenHeightEnd - screenHeightStart) .Release().Perform(); In the Appium documentation for scrolling ,suggested work around for c# is  Dictionary< string , string > scrollObject = new...

C# Appium Desired Capabilities settings

I will cover Appium setup in another blog . Once the Appium setup is done ,next step is to set DesiredCapabilities for the Appium webdriver. Below is the sample code in C#                 DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.SetCapability(MobileCapabilityType.PlatformName, "iOS"); capabilities.SetCapability(MobileCapabilityType.PlatformVersion, "9.3"); capabilities.SetCapability(MobileCapabilityType.DeviceName, "iPhone 6"); capabilities.SetCapability(MobileCapabilityType.NewCommandTimeout,60*3); capabilities.SetCapability(IOSMobileCapabilityType.LaunchTimeout, 60*10); //replace with your app path capabilities.SetCapability(MobileCapabilityType.App, "IOS app path(*.app)");   AppiumDriver = new IOSDriver ( new Uri("http://172.*.*.*:4723/wd/hub" ), capabilities); AppiumDriver.Manage().T...