Q: Testing swipe on responsive website using Selenium Webdriver C# I'm trying to test a swipe across an image gallery on a responsive website. On a mobile device it would be a finger swipe, using a desktop browser it functions the same with a mouse click/hold/drag. It's the desktop browser functionality I'm trying to replicate.
The code I have is:
Driver.Navigate().GoToUrl(Properties.Settings.Default.TestPage);

var mainImage = Driver.FindElement(By.CssSelector(".main-image"));

var imageAcross = (mainImage.Size.Width / 4 ) * 3;
var imageDown = mainImage.Size.Height/2;

var builder = new Actions(Driver);

builder.MoveToElement(mainImage, imageAcross, imageDown).ClickAndHold().Build().Perform();

TakeScreenshot(TestContext.CurrentContext.Test.Name);

builder.MoveByOffset(-imageDown, 0).Release().Build().Perform();

TakeScreenshot(TestContext.CurrentContext.Test.Name);

The TakeScreenshot function, as the name suggests, saves a screenshot. I take one before and after the move.
The first builder.MoveToElement places the cursor where I would expect and after the builder.MoveByOffset the cursor has moved as expected. However the swipe didn't change the gallery image. It's as if the ClickAndHold was ignored.
The CSS element .main-image is a div tag that has Javascript attached that changes an image within it on the swipe. The browser I'm using for testing is PhantomJS.
Is there something I am doing wrong? Or any suggestions on how to get the swipe to work?
