Friday, 7 June 2013

How to use Appium Inspector???....

Appium Inspector


Initially when I started to learn about appium inspector and its usage, I did not get better documentation with the steps on it. Finally I got it with the help of appium google group and some exploration. So I thought to document that here, and it would be helpful for new starters...

I used appium inspector for the following purpose,


  • To understand the element hierarchy
  • To find the xpath, name and value of the objects
  • To record the manual actions


The steps to use appium inspector are as below,



  • Initially download the appium.app from here, then add it to the Applications in your machine
  • Now Double click on the appium.app, it will open the appium server with the default IP Address 0.0.0.0 and  the port 4723 as below,
Appium Server



  • Next we have to specify the app, which we want to open in appium inspector.  
                 1. Check the check box 'App Path', Now 'Choose' button is enabled

                 2. Click on the 'Choose' button and select your .app file from your local, e.g. Recipes.app

                                 
Add the .app file in the server
                                 

  • Now click on the 'Launch' button, Once you launched the appium server, the blue color icon, which present beside the 'Launch' button is enabled.
       
Blue color icon is enabled


  • Click on the blue color icon, it will open up the appium inspector and simulator with your application as below,


Appium Inspector



  • Now you will see the element hierarchy of the application in the first column of appium inspector.
  • Choosing the particular element will display ,

             1. Its childs in the second column
             2. Highlights the object in the app.
             3. Element's xpath and its attributes at the right bottom corner.


Parts of Appium Inspector

  • And you can do actions by clicking on the action buttons Tap, Swipe etc displayed in the left bottom of the appium inspector.

  • By clicking on the 'Record' button we can create the automation script as below, you can see the recording script below the appium inspector,


Recording




25 comments:

  1. Hi Can you explain the steps how to launch of windows ?

    ReplyDelete
  2. Hi Mahesh,

    Actually appium is not fully supported for Windows platform. For now, Appium inspector has some issue in Windows.

    But the usage is as follows,

    1. Open the appium.exe
    2. Enter App path, Package and Activity details. Then check the check boxes and launch the server.
    3. Go to File > Inspector in the appium server. It will launch the appium inspector. But there will not be any data. Clicking on 'Refresh' will lead to some exceptions.

    Regards,
    Elango.

    ReplyDelete
  3. hi can you pencil down the steps for configuring android on mac please
    Thank you

    ReplyDelete
  4. Thank you for the info, Elangovan. Is .app an iOS application or Mac OS application? I would be nice if you give more details on how to convert xcode project into .app?

    Warm Regards,
    Anonymous.

    ReplyDelete
  5. You can get .app file extracting the .ipa file, but in order to use the .app with the simulator the file must be generated for the simulator (CPU arch x86).
    Generally the ipa file are generated to run on a device (CPU ARM)

    ReplyDelete
  6. Hello,
    I am new to appium and trying to use it ios automation. It happens that once I am done with the recording and I stop the inspector, the java test code that was generated does not work for any more. I tried copying the java code and executing etc but it did not worked. Is there a way to save it and reuse it on other devices. If yes, can anyone guide me about how to do it? So that once i am done with the automation code, i will just run my test cases which are in java.

    ReplyDelete
  7. how do i re-run the recorded script ?

    ReplyDelete
  8. Thanks Elango, Very much helpful.

    ReplyDelete
  9. Good One. Was helpful

    ReplyDelete
  10. Hi Elango,

    Yes. It leads to exception while i followed the steps you provided for windows.

    My Question is

    Is it possible to record in windows?

    ReplyDelete
  11. Hi Elango,

    I could not find Appium.App file in the provided link. i got only AppiumForWindows file in that link.

    Please help me on this...

    ReplyDelete
    Replies
    1. Look for The Appium.exe file then follow instruction given by Elogolan on 22/08 in the comments above

      Delete
  12. i am totally new to the appium. i am trying to launch simulator & inspector but after the launch of the simulator it gives me the error Application can not be launched.
    will inspector get launched after the simulator???

    ReplyDelete
  13. Hi Elango,

    Can you let me know how to re-run Appium recorded code? Also where does the app save the recorded code?

    Regards,
    Prashant

    ReplyDelete
  14. hi i encountered a problem loading appium inspector in my macbook


    Could not Launch Appium Inspector "Could not start a new session"

    Be sure the Appium server is running with an application opened by using the "App Path" parameter in Appium.app (along with package and activity for Android) or by connecting with selenium client and supplying this in the desired capabilities object."

    error: Failed to start an Appium session, err was: Error: Could not find a device to launch. You requested 'iPad 2 (7D3413F6-F99B-4B56-AF0D-5842278377B2) (8.1 Simulator)', but the available devices were: ["iPad 2 (8.1 Simulator) [7D3413F6-F99B-4B56-AF0D-5842278377B2]","iPad Air (8.1 Simulator) [AA6257B1-D3E0-49A6-85C2-F865B17ED6CD]","iPad Retina (8.1 Simulator) [6D0482A4-0951-43FF-AC0C-75C910B52FB7]","iPhone 4s (8.1 Simulator) [212DB040-8023-436D-936E-9ED2115715F3]","iPhone 5 (8.1 Simulator) [7BD46F32-1080-4E35-9594-A3ED679FDED9]","iPhone 5s (8.1 Simulator) [536F6937-7CC7-42CD-984E-3B79FF163808]","iPhone 6 (8.1 Simulator) [C7F06CC8-934B-429A-9ED0-2637A069502A]","iPhone 6 Plus (8.1 Simulator) [19D4AA61-799E-4018-BB1D-B73FB51E7629]"]

    Can anyone help me come out of this ? I am very new to Appium

    Thank you

    ReplyDelete
  15. You can see available simulators with terminal command xcrun simctl list.
    you might be using 8.2 simulators. In Appium app, go to iOS Settings, In Basic settings Change Platform Version menu to 8.2. Then relaunch appium server. now appium inspector might work. It worked for me.

    ReplyDelete
  16. I have installed appium 1.3.7, on Mac 10.9.7 and fI am unable to identify the element using appium inspector. If I select the element form the hierarchy, the respective element is not highlighting. What could be the solution for this.

    ReplyDelete
  17. how do i re-run the recorded script.
    please help

    ReplyDelete
  18. Hi Mahesh

    In My mobile app, we have sign up with the gamil or facebook.

    My test case is:
    Click on sign up with Gmail->My script is working up to click on " sign up with Gmail" button
    i could not identify the element properties of gmail screen.

    ReplyDelete

  19. Best place to learn Appium Android IOS Automation Testing Training in Chennai

    Go for Appium training in chennai for real time mobile automation testing training with real time project support.
    Mr. Vishwa is a best person who can teach and develop people in Appium and Selenium,Coded UI Automation Tools with real time scenarios You can contact 8122241286 for Best APPIUM and selenium Training in Chennai

    ReplyDelete
  20. Well explained. Got to learn new things from your Blog on Appium.Appium training in chennai

    ReplyDelete
  21. Just like a selenium IDE playback and record tool, Appium consist of an inspector that is used to record and playback. With the help of this, you can record and play native application behaviour which is achieved by inspecting DOM. It helps in generating the test scripts any language that is preferred. But Appium Inspector is not a good support for Windows and they use UIAutomator viewer in the option.

    ReplyDelete