2/12/19

Introduction to Mobile Testing and Appium



Importance of Mobile Phone
  •         I want to pay my electricity bill.
  •         I need to communicate with my manager and submit my reports urgently.
  •         I want to buy new clothes for my kid, but I don't have the time to go to a store.
  •        Oh...it's 10 PM; I am running late for my flight. Where is my cab?
  •        I have been in this city for the first time; which hotel should I book?
      Now answer yourself. What do you need to perform these activities in a fraction of second? The answer would be −
  •       A smartphone,
  •       Internet connectivity, and
  •       A mobile app to do the job.



Various Mobile OS

Types of Mobile Apps 
Mobile Web App
–Web apps are not real applications; they are actually websites that open in your smartphone with the help of a web browser. Mobile websites have the broadest audience of all the primary types of applications.
Native App
–A native app is developed specifically for one platform. It can be installed through an application store (such as Google Play Store or Apple’s App Store).
–Example − Whatsapp, Facebook. This app can use all the system application’s(the apps which comes by default with your mobile )
Hybrid App
–Hybrid Apps are a way to expose content from existing websites in App format. They can be well described as a mixture of Web App and Native App.
Tools Available
  • Appium
  • Selendroid                        
  • ios-driver                        
  • Calabash
  • MoneyTalk
  • Frank
  • KIF(keep it functional)
  • Robotium
     
    Open source Tools Requirements
    • Application source code should not be modified for test automation : I don't want to compile or modify the source code of the application, whatever the application we are going to submit the same app i need to test
    • Explanation : There are many open source mobile automation testing tools (like Robotium) which needs compilation or modification of the source code before conducting testing and even after testing also we need to remove those changes. It means in these cases we are not going to test the application whatever we are going to submit to the play store.
    • Tests should run across Simulators/Emulators & Real Devices: my tool should support simulators(virtual device for iOS), emulators(virtual device for Android), real devices
    • Tests should be written using Java and any test automation frameworks: written in java so that it can support any framework
    • Large open source community for continuous maintenance and support:larger community support
    • Tools which fulfills open source requirements:


    Why Appium (Advantages)

    • Cross platform: Android & iOS: we can test native, hybrid, web app
    • Allows you to communicate with other apps , Ex: WhatsApp (Majority of tools doesn't support this)
    • No pre-compilation of your app
    • support for built-in app : alarm, phone, calendar etc
    • Any WebDriver compatible language is supported : Java, objective C, Ruby, php , C# : we just need language specific libraries to work on
      Limitations of Appium
      • For Android, No Support for Android API level < 17(for android v>4.1) if you mobile having less than 17 then we need to go for selendroid.
      • Script execution is very slow on iOS platform & android virtual devices
      • No support for Toast messages: we can handle this 
      • no parallel execution directly : we can handle using sauce labs
        What is Appium?
        • Appium is mobile web, native and hybrid software application test automation tool developed and supported by Sauce Labs .
        • It is open-source software automation tool which is useful to automate android and IOS platform apps.
          Appium Architecture

          • As Appium is an HTTP server(webserver), its performs pretty much same as Selenium Webdriver server 
          • Appium works as a Client/Server architecture.
          • To JSON wire protocol the communication will happen with session ID's only.
          • whenever the client sends a request the server will create a session and it will send back session ID to the client so that the future communication between client and server will happen with this session ID only
          • Q) How come the server will identify which session it needs to create?
          • A) usually the client has desired capabilities which we need to pass using which the session will be created .. DC contains application name, platform version, package name, activity name
          • Appium Desired capabilities?
          • Desired Capabilities are sent by the Client to Server via JSON Objects by requesting the automation session we need.
          • These desired capabilities are found in the link below
          http://appium.io/slate/en/v1.2.0/?java#appium-server-capabilities

          0 comments:

          Post a Comment