Appium Tutorial






Hi everyone, thanks for visiting my blog. During my career I have used many android automation tools like Appium, Espresso , Selendroid etc. I have started this blog to share my expereince in simple and short tutorials so that any one who wants to shift from Manual to Automation can do it from the scratch.

Appium is very popularly used Automation Testing toll which supports both android and IOS and hence it is used by many organization. Below are links to the posts of Appium Tutorial which you can explore to start setting up Appium and writing your test cases

Appium Tutorials -

  Advance Appium Tutorials -

     1. Implicit and Explicit Wait in Appium
     2. Database Testing with Appium & JDBC
     3. Creating Maven Project with Appium 
     4. Jenkins Setup for Appium & Maven project
     5. Page Object Model ( POM ) in Appium
     6. Swipe Left, Right , Up & Down using Appium 
     7.How to Test Toast Messages using Appium? 
  
Note - Learn More About Android Studio HERE

90 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. Hi Anuja Jain

    Can you tell me how to start and stop appium server programmatically using java code in ubuntu OS

    ReplyDelete
    Replies
    1. Sure I will check and share that post as well.. stay connected via social media for latest update

      Delete
    2. Hi you can check this post http://www.qaautomated.com/2016/01/how-to-start-appium-server-using-java.html
      You need to give path as per UNIX Environment and make sure you have install node.js via npm -(Refer http://www.qaautomated.com/2016/11/how-to-install-appium-on-ubuntu.html)

      Delete
  3. Hello Anuja
    can you please help in verifying the toast message in appium

    ReplyDelete
  4. hi getting the below error in appium


    info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : version
    > info: [debug] Didn't get app but did get Android package, will attempt to launch it on the device
    > info: [debug] Creating new appium session 8ec1d872-bce5-499e-9a5d-0260e353001b
    > info: Starting android appium
    > info: [debug] Getting Java version
    > info: [debug] Cleaning up android objects
    > info: [debug] Cleaning up appium session
    > info: [debug] Error: 'java -version' failed. Error: spawn ENOENT
    > at [object Object]. (C:\Program Files\Appium\node_modules\appium\lib\devices\android\android-common.js:1057:17)
    > at exithandler (child_process.js:633:7)
    > at ChildProcess.errorhandler (child_process.js:649:5)
    > at ChildProcess.EventEmitter.emit (events.js:95:17)
    > at Process.ChildProcess._handle.onexit (child_process.js:795:12)
    > info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: 'java -version' failed. Error: spawn ENOENT)","origValue":"'java -version' failed. Error: spawn ENOENT"},"sessionId":null}
    > info: <-- POST /wd/hub/session 500 29.641 ms - 208

    ReplyDelete
  5. Can I tap using screen coordinates If not able to find id etc of elements ?

    ReplyDelete
    Replies
    1. Hi,
      Yes in Appium you can perform tap using co-ordinates.

      Regards,
      Anuja

      Delete
  6. Thank you by the tutorials, I helped me a lot. I am new about moviles test theme and i have a doubt: How am i generate the code of the application who i want to test? that is, the bibliographies almost always give me a example code but they dont tell me where are they generate the test code?
    I would like I know this, please help me.

    ReplyDelete
  7. I started the test´s world with visual studio, microsoft test manager and selenium for web and desktop application the last year, and i liked it.
    At present I am interested in automated mobile testing and i am working with appium and android studio. I have accomplished to do test examples but i dont understand How am i generate the code of the application who i want to test? the examples come with yours code.
    I saw examples with Appium on Mac and i have seen how is it generate the code.
    I have not seen test examples on windows where it is explain the generate test code whit appium and android studio.
    Thank you for yours attention

    ReplyDelete
  8. Thanks for the tutorial, I been searching for this for a long time, At last reached to the got post. Thank you giving a information

    ReplyDelete
  9. Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
    Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
    System info: host: 'DESKTOP-1M92PA5', ip: '192.168.0.109', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
    Driver info: driver.version: RemoteWebDriver
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:641)


    I m getting this error when i m trying to execute my script. The thing is the the contact to the appium server is not happening

    driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
    //driver = new AndroidDriver(new URL("http://172.20.67.130:4723/wd/hub/"), capabilities);
    System.out.println("driver in try method executed");

    I have tried with some other URL and no luck, could anyone help me resolve it ?

    ReplyDelete
  10. Hi,

    how can i select grid view element in appium

    ReplyDelete
  11. can u tell me how to run test case of android without using apk file and using of android source code in android studio

    ReplyDelete
  12. Hi, Good job.. nice tutorials :) is there any real time example source code available? for practicing?
    Thanks, Ranjith

    ReplyDelete
  13. Hello, Anuja!
    I am facing one problem in automating my application.
    I select a radio button first and then try to click OKAY, but what happens is only the radio button gets selected and OKAY button does not.
    Tried the code elsewhere, it runs perfectly.
    Also tried executing following two commands separately, with success.
    Test case gets passed, but actually it does not work.
    Please review the following two commands:

    @Test public void SelectGroupsAndStudents() {

    // Select Group
    driver.findElement(By.xpath("//android.widget.RadioButton[@text='Mahatma Fhule']")).click();

    driver.findElement(By.xpath("//android.widget.RadioButton[@text='Select Groups']")).click();

    Please note that the second command does not get executed.

    Any help will be appreciated!
    Thanks!

    ReplyDelete
  14. Can you please one sample project video.

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete
  16. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
    For iPhone Online Training | Android Online Training

    ReplyDelete
  17. Hi,
    Anuja my script is working fine bellow android version 7 but above 7.1 and 8 not working .My appium version is v1.7.2

    ReplyDelete
  18. Any one please tell me how to test toast error messages. Please share code

    ReplyDelete
    Replies
    1. Hi, Check this out - http://www.qaautomated.com/2017/12/how-to-test-toast-messages-using-appium.html

      Delete
    2. Hey Anuja, i have configured appium successfully with android studio now i am facing an issue. I have booking.com app installed on my fone and i am trying to automate but its not working even package and activity is correct. Please help me in resolving this issue.

      Error: cannot start the 'com.booking' application. Orginal error: Error executing abd.exe

      Delete
  19. Hi Anuja,
    Ashish this side and i am new in appium. Actually I don't find UI automator bat file in my sdk folder. Can you help me please?

    ReplyDelete
    Replies
    1. It will be in bin folder under tools....

      Delete
  20. Hey Anuja, i have configured appium successfully with android studio now i am facing an issue. I have booking.com app installed on my fone and i am trying to automate but its not working even package and activity is correct. Please help me in resolving this issue.

    Error: cannot start the 'com.booking' application. Orginal error: Error executing abd.exe

    ReplyDelete
  21. Hi there... nice blog. I'm specifically looking for Appium with iOS. Can you cover up simple steps for starters on iOS automation using appium?

    ReplyDelete
  22. Nice and informative tutorial of appium.Thanks for sharing such nice article, keep on updating.

    Pega Training in Chennai
    Pega Training

    ReplyDelete
  23. Hello Anuja, thanks for your effort and more grease to your elbow.
    Kindly see the error I am getting when rebuilding my project. Please assist. Thanks.

    build failed 1m 58s 827ms
    Starting Gradle Daemon 9s 596ms
    Run build 1m 32s 408ms
    Load build 2s 74ms
    Evaluate settings 2s 29ms
    Configure build 3s 928ms
    Calculate task graph 8s 77ms
    Run tasks 1m 18s 65ms
    null
    InnerClass annotations are missing corresponding EnclosingMember annotations. Such InnerClass annotations are ignored.
    Default interface methods are only supported starting with Android N (--min-api 24): java.util.Collection com.google.common.collect.BiMap.values()
    Default interface methods are only supported starting with Android N (--min-api 24): boolean com.google.common.base.Predicate.test(java.lang.Object)
    Default interface methods are only supported starting with Android N (--min-api 24): java.util.Collection com.google.common.collect.ListMultimap.get(java.lang.Object)
    null
    com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\Eigenaar\AndroidStudioProjects\GoodEnergyApplication\app\libs\guava-25.0-jre.jar
    com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.
    com.android.tools.r8.CompilationFailedException: Compilation failed to complete
    com.android.tools.r8.utils.AbortException

    ReplyDelete
  24. How to relaunch app?

    ReplyDelete
  25. Love to read it,Waiting For More new Update and I Already Read your Recent Post its also nice blog Keep Updating Us..i am following in future also..,

    Best Software Training Institute in Chennai

    Best Online Training Institute in Chennai


    ReplyDelete
  26. Hi Anuja,
    When I copy the apk like (//File f=new File("src/main/java")File fs= new File(f,"Naukri com Job Search_v10.7.apk");)
    inside the project and try to run a script its working as expected from both emulator and real device too.when I try to use to use
    cap.setCapabilities("appPacakge" "com.mobisystems.fileman")
    ca.setCapabilities("appActivity","com.mobisystems.files.FileBrowser")
    I am seeing the below issue
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)

    ReplyDelete
  27. can you please suggest with correct information ?

    ReplyDelete
  28. Excellent informative blog, Thanks for sharing.
    Wedding Photographer

    ReplyDelete
  29. Excellent and very cool idea and the subject at the top of magnificence and I am happy to this post..Interesting post! Thanks for writing it.What's wrong with this kind of post exactly? It follows your previous guideline for post length as well as clarity.
    datapower tutorial video

    ReplyDelete
  30. Thanks for sharing. I really liked your post, keep sharing!!

    CEH Training In Hyderbad

    ReplyDelete
  31. Thank you so much for the tutorials. Very helpful.

    ReplyDelete
  32. Wonderful post.I learned some new things from your post.Really enjoying your sharing, you have a great teaching style and make these new concepts much easier to understand. Thanks.Really enjoying your sharing, you have a great teaching style and make these new concepts much easier to understand. Thanks.Training with placement in Hyderabad

    ReplyDelete
  33. I feel happy about and learning more about this topic. keep sharing your information regularly for my future reference. This content creates a new hope and inspiration with in me. Thanks for sharing article like this. the information which you have provided is better then other blog.
    Best IELTS Coaching in Dwarka sector 7

    ReplyDelete
  34. Hey Anuja,
    I am working on Mobile application as Manual QA.Now I need to start working on Automation part.What do you suggest.Which tool Appium or Espresso I should use and why ?.
    Ankit

    ReplyDelete
  35. I enjoyed over read your blog post. Your blog have nice information, I got good ideas from this amazing blog. I am always searching like this type blog post. I hope I will see again.
    Best Web Development Institute Delhi
    Top Company to Develop website in PHP
    Best Website Development Services
    Website Redesign Services
    Best Graphic Design Agency Rohini
    Digital Marketing Company in North Delhi
    Web Services

    ReplyDelete
  36. Can you please let me know, how to identify the locators in File Manager app using Appium

    ReplyDelete
  37. Hello @Anuja,
    Am facing with the below issue it would be helpful if u can suggest on this

    I am setting up Appium in Android Studio and for this I have added the below Jars to Project

    Java-client-7.0.0.jar
    Selenium Jars (Latest)
    selenium-api-3.14.0.jar
    selenium-remote-driver-3.14.0.jar
    And below is my code to launch a Message app in Android mobile

    package com.example.appiumcalc;

    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;

    import java.net.MalformedURLException;
    import java.net.URL;
    import java.util.concurrent.TimeUnit;

    import org.openqa.selenium.remote.DesiredCapabilities;
    import org.openqa.selenium.remote.RemoteWebDriver;


    import io.appium.java_client.android.AndroidDriver;
    import io.appium.java_client.remote.MobileCapabilityType;

    public class AppiumCalc {

    public static void main(String[] args) throws MalformedURLException, InterruptedException {

    DesiredCapabilities capabilities = new DesiredCapabilities();

    capabilities.setCapability(AUTOMATION_NAME, "Appium");
    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android");
    capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
    capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "7.0");


    capabilities.setCapability("appPackage", "com.google.android.apps.messaging");

    capabilities.setCapability("appActivity", "com.google.android.apps.messaging.ui.conversationlist.ConversationListActivity");
    URL url = new URL("http://0.0.0.0:4723/wd/hub");
    WebDriver driver = new RemoteWebDriver(url, capabilities);

    driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);




    Thread.sleep(5000);
    }


    }
    The Error which am facing is as below :
    Duplicate class org.openqa.selenium.SearchContext found in modules java-client-7.1.0.jar (java-client-7.1.0.jar) and selenium-api-3.14.0.jar (selenium-api-3.14.0.jar)
    Duplicate class org.openqa.selenium.WebDriver found in modules java-client-7.1.0.jar (java-client-7.1.0.jar) and selenium-api-3.14.0.jar (selenium-api-3.14.0.jar)
    Duplicate class org.openqa.selenium.WebElement found in modules java-client-7.1.0.jar (java-client-7.1.0.jar) and selenium-api-3.14.0.jar (selenium-api-3.14.0.jar)

    Could you please suggest how to setup and proceed further
    Thank you so much for the help.

    ReplyDelete
  38. Nice! I like to share it with all my friends and hope they will also like this information.
    Power Bi Training In Hyderabad
    Power Bi Online Training
    Power Bi Training

    ReplyDelete
  39. Hi Anuja, How to switch from Native app to Chrome Browser? My native app launches chrome and I need to verify the URL on chrome and come back to native app.

    ReplyDelete
  40. We as a team of real-time industrial experience with a lot of knowledge in developing applications in python programming (7+ years) will ensure that we will deliver our best in python training in vijayawada. , and we believe that no one matches us in this context.

    ReplyDelete

  41. I am really happy to say it’s an interesting post to read . I learn new information from your article , you are doing a great job . Keep it up and a i also want to share some information regarding best selenium online training and selenium training videos

    ReplyDelete
  42. Hey Loved the post! Great article and congrats on Reaching the To 50! I will be back to visit often

    Power bi training in Hyderabad

    ReplyDelete
  43. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging

    Selenium Training in Chennai | Certification | Online Courses

    selenium training in chennai

    selenium training in chennai

    selenium online training in chennai

    selenium training in bangalore

    selenium training in hyderabad

    selenium training in coimbatore

    selenium online training

    ReplyDelete
  44. Good article! It was awesome to read, thanks for sharing this great content to my vision, keep sharing…
    GMAT online Training
    GMAT coaching in hyderabad

    ReplyDelete
  45. Awesome, I’m really thankful to you for this amazing blog. Visit Ogen Infosystem for creative website designing and development services in Delhi, India.
    Website Designing Company in Delhi

    ReplyDelete
  46. I am overwhelmed by your post with such a nice topic. Usually I visit your blogs and get updated through the information you include but today’s blog would be the most appreciable. Well done!
    Best Institutes For Digital Marketing in Hyderabad

    ReplyDelete
  47. software testing company in India
    software testing company in Hyderabad
    Nice and informative article.
    Thanks for sharing such a helpful tutorial with us.

    ReplyDelete
  48. Tibet is available on the northern side of the Himalayas. Many people ask a query about Tibet, Is Tibet a different country or a part of China? That all answers you will find on that link. vacation in tibet
    .
    if you have not aware of tibet travel, That all answers you will find here. Lhasa is the capital city of Tibet who gives the tourists the best chance to experience the authentic Tibetan sacred land Or Many more holiday destination are also available in Tibet such as Potala Palace, Jokhang temple, and namtso, etc

    ReplyDelete
  49. One of the most attractive places for tourists is the thailand tour. Thailand is a kingdom of Thailand and is a country of southeast Asia, and it's also known as siam. the south-east Asian nation can expect to have an increasing flow of Indian families exploring every nook and cranny of the country.
    The most famous places to visit in thailand are Pattaya and Lampang. Pattaya is a famous holiday place for Indians and here is a waterpark to choose from Ramayan and cartoon and they provide fun for children & adults both. Lampang is famous for horse and here is in the evening gives lots of street food and full entertainment.

    ReplyDelete
  50. Taman Saraswati temple is a famous temples of bali this temple is dedicated to Hindu goddess Saraswati. and in Taman Saraswati temple has lotus ponds and water garden. Lots of tourists visit this temple because of dance performances and This dance performances held on Tuesday and Thursday only.
    Besakih temple is a pura complex in the village of Besakih and it's located in eastern Bali. Besakih temple is the largest and the holiest temple of the Hindu religion. It nearly 1000 meters up from Gunung Agung . This is the best bali temles of bali for tourists.

    ReplyDelete
  51. Feeling good to read such a informative blog, mostly i eagerly search for this kind of blog. I really found your blog informative and unique, waiting for your new blog to read.
    Digital marketing Service in Delhi
    SMM Services
    PPC Services in Delhi
    Website Design & Development Packages
    SEO Services Packages
    Local SEO services
    E-mail marketing services
    YouTube plans

    ReplyDelete


  52. I am have been reading this post from the beginning,it has been helping to Gain some knowledge & i feel thanks to you for posting such a good blog, keep updates regularly.i want to share about ibm datapower tutorial .

    ReplyDelete
  53. I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. Thanks for sharing your informative post on development.

    Manal testing Training in Gurgaon
    Selenium Training in Gurgaon
    Cucumber Training in Gurgaon
    Microservices Testing Training in Gurgaon

    ReplyDelete
  54. We are well established IT and outsourcing firm working in the market since 2013. We are providing training to the people ,
    like- Web Design , Graphics Design , SEO, CPA Marketing & YouTube Marketing.Call us Now whatsapp: +(88) 01537587949
    : Digital Marketing Training
    Free bangla sex video:careful
    good post outsourcing institute in bangladesh

    ReplyDelete
  55. Truxt label improves your legitimacy and reliability. The TRUXT label proves that the service provider applies the best management processes to maintain and grow their business. With this label, you have visibility of the label truxt for the digital service provider.
    The TRUXT label proves that the service provider has attained a risk profile, allowing you to work with them with confidence. truxt can count on new providers you will never be able to collaborate with if they are not labeled and the service provider identifies its weak points and implements actions to improve them.

    ReplyDelete
  56. Martinique car rental is only liked by localizes people due to its agencies in Martinique. They provide these four cars are the Citron Jump, Peugeot 308, BMW X1, and Dacia Sandero or Kia Picato.
    martinique car rental provide friendly budget you have must try and it's mainly located near airport or busy city area. If you have lost your bus or a Train then you should have to try car rental because they are cheaper than the other transportation like taxi etc.

    ReplyDelete
  57. Games4html5 is a specially platform to provides the latest free h5 games for the majority of players to play online. Players can find the most popular game you want through the funny home game leader board, or they can enter the game list to find their favorite games, which is more convenient without downloading the computer version. Our most popular game is ninja jump, colorful gemstones match, Happy hitting bricks, incredible ninja, and Pumpkin man sprint and so on. Let's enjoy the fun of the game.
    Color magnet games
    Rescue juliet games

    ReplyDelete
  58. I must thank you for the efforts you have put in writing this blog. Fut Istanbul

    ReplyDelete
  59. Qutub minar is situated in the Mehrauli area of New Delhi. qutub minar is made of red sandstone and marble and the height of Qutub minar is 72.5 meters. this is the tallest minaret in the world. this minar started by qutubdin tuglak during 1192 on the victory over Hindu last kingdom.
    in 1976 the public allowed access to the first floor of the minaret and access to the top was stope after 2000 because of suicides in qutub minar delhi. on 1981, 4 December the stairs light was fused and 400 to 500 tourists stampeded toward the exit then 47 was killed and some were injured. then this incident the tower has been closed for the public.

    ReplyDelete
  60. In 1880, bal gangadhar tilak and his college friend had laid the foundation of a new English school, then he started two newspapers, the name of paper are Kesari and printed in multiple languages that were Marathi, Mahratta, and English. bal gangadhar tilak story

    ReplyDelete
  61. truck art is a talent, You can see Shayari written the backside of truck Shayari like example "Buri Nazar wale tera muh Kala" and "Dekho Magar Pyaar Se" etc, and they decourated their truck with flowers and painting this is the indian truck art.

    ReplyDelete
  62. child labour in india, we usually see children on the roadside or factories where they sell clothes, they sell pens, pencils, etc. On the roadside, but this is only for the poverty life of these people because they have to eat Require money. The situation of labour india in India is not good, hence, the crime rate in India is very high for another country.

    ReplyDelete
  63. Thank you for sharing valuable comments for us its very incredible post to whom looking for a particular course if any one who want to learn tally core to advance
    Appium Training in Bangalore

    ReplyDelete