• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Programming Languages
    • Java Tutorials
    • Python Tutorials
    • JavaScript Tutorials
  • Automation Tools and Different Tools
    • Web Automation
      • Selenium with Java
        • Selenium Basic
        • Selenium Advance
        • Selenium Realtime
        • Framework
        • Selenium Interview
        • Selenium Videos
        • Selenium with Docker
      • Selenium with Python
      • WebdriverIO
        • Selenium Webdriver C# Tutorial
      • Cypress
      • Playwright
    • TestNG
    • Cucumber
    • Mobile Automation
      • Appium
    • API Testing
      • Postman
      • Rest Assured
      • SOAPUI
    • testRigor
    • Katalon
    • TestProject
    • Serenity BDD
    • Gradle- Build Tool
    • RPA-UiPath
    • Protractor
    • Windows Automation
  • Automation For Manual Testers
  • Services
  • Online Training
  • Contact us
  • About me
  • Follow us
    • Linkedin
    • Facebook Group
    • Facebook Page
    • Instagram

Automation

Selenium WebDriver tutorial Step by Step

You are here: Home / Appium Tutorials / Different way to Scroll in Appium in Android and IOS devices.

Different way to Scroll in Appium in Android and IOS devices.

April 21, 2016 by Mukesh Otwani 104 Comments

Welcome back to Appium tutorials in this post we will discuss how to scroll in Appium.

Recently I got an application where I had to scroll down to click on that element.

I have worked on web application automation extensively so I used to do with JavaScript Executor.

If you have never used Java Script Executor then I would highly recommend to check below the article.

Java Script usage in Selenium

It helped me for Highlighting elements, Scroll into View, Scroll pages and so on.

 

But I become helpless when I switched to Mobile application because above methods were not working for me.

 

Methods for Scroll in Appium

I did some googling and found that AndroidDriver class has inbuilt method which performs scroll till the element not found.

Please check the Appium reference where you can find multiple articles on Appium

Complete Appium guide for IOS and Android

 

Please check below Screenshot.

 

First Method-

As you can see the description this will scroll until element not found with text.

Scroll in Appium

 

 

Second Method

This method also will perform scroll method but this will search for exact text for scrolling.

 

Scroll in Appium

Program for Scroll in Appium

public class TestHybrid5 
{

	private static AndroidDriver driver;
	 
	public static void main(String[] args) throws MalformedURLException, InterruptedException 
	{
	 
	 
	File classpathRoot = new File(System.getProperty("user.dir"));
		
	File appDir = new File(classpathRoot,"/app");
	
	File app = new File(appDir,"appname.apk");

	
	 // Create object of DesiredCapabilities class                             
	 
	DesiredCapabilities capabilities = new DesiredCapabilities();
	 
	capabilities.setCapability("app", app.getAbsolutePath());
	 
	// Optional
	 
	capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
	 
	 
	// Specify the device name (any name)
	 
	capabilities.setCapability("deviceName", "My New Phone");
	 
	 
	// Platform version
	 
	capabilities.setCapability("platformVersion", "6.0");
	 
	 
	// platform name
	 
	capabilities.setCapability("platformName", "Android");
	 
	 
	// specify the application package that we copied from appium                
	
	capabilities.setCapability("appPackage", "app Package name");
	 
	 
	// specify the application activity that we copied from appium                   
	capabilities.setCapability("appActivity", "specify the activity here");
	 
	 
	// Start android driver default it will be 4723
	 
	driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
	 
	 
	// Specify the implicit wait of 5 second
	 
	driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
	 
	
	// scrollTo("") this method will scroll automatically until specific text is not matching.
        // We have two methods so depends on your requirement you can use accordingly.
	driver.scrollTo("SAVE");
	
	driver.findElement(By.id("app_id_screen_save_button")).click();
	
	
	
	 
	}
}

 

This is very small article but a very helpful. Try from your side and let me know if an issue in Appium.

Recently I launched blog for discussion http://forumsforqa.com/

 

Filed Under: Appium Tutorials Tagged With: Scroll in Appium

Reader Interactions

Comments

  1. Biswa bhusan Mishra says

    April 26, 2016 at 4:14 PM

    Nice One Mukesh..Waiting to see some advanced action related script.

    Reply
    • Mukesh otwani says

      April 26, 2016 at 11:57 PM

      Sure Biswa will upload soon

      Reply
  2. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  3. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  4. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  5. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  6. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  7. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  8. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  9. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  10. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  11. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  12. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  13. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  14. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  15. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  16. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  17. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  18. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  19. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  20. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  21. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  22. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  23. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  24. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  25. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  26. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  27. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  28. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  29. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  30. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  31. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  32. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  33. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  34. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  35. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  36. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  37. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  38. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  39. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  40. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  41. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  42. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  43. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  44. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  45. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  46. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  47. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  48. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  49. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  50. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  51. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  52. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  53. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  54. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  55. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  56. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  57. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  58. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  59. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  60. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  61. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  62. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  63. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  64. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  65. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  66. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  67. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  68. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  69. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  70. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  71. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  72. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  73. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  74. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  75. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  76. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  77. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  78. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  79. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  80. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  81. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  82. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  83. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  84. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  85. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  86. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  87. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  88. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  89. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  90. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  91. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  92. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  93. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  94. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  95. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  96. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  97. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  98. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  99. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  100. Mukesh Otwani says

    April 25, 2016 at 3:11 PM

    Test Comment

    Reply
  101. Selenium learner says

    April 21, 2016 at 12:22 PM

    Thanks Mukesh Nice post.

    Reply
    • Mukesh Otwani says

      April 21, 2016 at 12:23 PM

      Thanks Keep visting.

      Reply
      • Tarun Tiwari says

        April 24, 2016 at 11:56 PM

        Can you please update swipe event on mobile.

        Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Free Selenium Videos

https://www.youtube.com/watch?v=w_iPCT1ETO4

Search topic

Top Posts & Pages

  • Selenium Webdriver tutorial for beginners
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Selenium Webdriver C# Tutorial
  • WHAT ARE YOUR EXPECTATIONS FROM US?

Stay connected via Facebook

Stay connected via Facebook

Archives

Footer

Categories

Recent Post

  • API Testing Using Postman And RestAssured
  • Disable Personalise Your Web Experience Microsoft Edge Prompt In Selenium
  • How To Fix Error: No tests found In Playwright
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Best and easy way to Group test cases in selenium

Top Posts & Pages

  • Selenium Webdriver tutorial for beginners
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Selenium Webdriver C# Tutorial
  • WHAT ARE YOUR EXPECTATIONS FROM US?