title: Selenium: Click and Hold the element and then Slide it
body: <p>In my application I have a scenario where I need to slide an element in list view to add new entry to the item. I have to automate it using Selenium and C#. Application is developed using Ionic and Angular Frameworks.</p>
  
  <p>In Selenium there is an option to <code>ClickAndHold</code> and <code>MoveByOffset</code> methods but none of these seems to be working. At the same time no errors are displayed. Please help.</p>
  
  <p>Code I have tried so far is as below.</p>
  
  <p><code>Actions dragger = new Actions(driver);</code></p>
  
  <p><code>elementToSlide = driver.FindElement(By.XPath("//ion-item-slide[1]"));</code></p>
  
  <p><code>dragger.ClickAndHold(elementToSlide).MoveByOffset(-47,0).Build().Perform();</code></p>
  
  <p>Images are attached for reference. The first element in the list view slides.</p>
  
  <p><a href="https://i.stack.imgur.com/08lkj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/08lkj.png" alt="Before performing slide"></a></p>
  
  <p><a href="https://i.stack.imgur.com/dGMGm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dGMGm.png" alt="After performing slide"></a></p>