I am new to mobile testing. I want to configure appium for testing android applicaiton on Mac machine. Can someone provide the steps to do. And I want to using with selenium webdriver using Java. Posts about appium written by Manish Singh. Hello there, After writing my first technical blog(don’t know if this is called a blog or a document) on setting up Appium on windows Mobile Automation – Appium Environment Setup on Windows Now moving forward to setting up Appium on Mac which is bit tricky and very less resources i have found on internet.The challenges what i had faced while this. The Mac Driver for OS X. Appium has beta support for automation of OS X desktop applications. Development of this driver happens at the appium-mac-driver, and relies on a native OS X binary called AppiumForMac. Requirements and Support (In addition to Appium's general requirements) Mac OS X. Appium for Mac can control the native user interface of Mac applications using Selenium / WebDriver and the OS X Accessibility API. Check out the example which will control the calculator app. The WebDriver server is on port 4622. If you build it yourself, you can change this value in AppiumForMacAppDelegate.m. Appium for Mac is an open source test automation framework for use with native, hybrid and mobile web apps. Native apps are those written using iOS, Android, or Windows SDKs. Mobile web apps are web apps accessed using a mobile browser (Appium supports Safari on iOS and Chrome or the built-in ‘Browser’ app on Android). Hybrid apps have a wrapper around a “webview” – a native control.
Appium Setup in Mac for iOS App Automation :
We need Macbook(MAC OS X 10.7 (minimum version required)) for iOS automation.This cannot be done on Windows machine as Xcode will run only on Macbook
[1] Java JDK
[i] Download Java JDK from download link
[i] Download Java JDK from download link
[ii]Environment variables set up for Java JDK :
[a]echo export “JAVA_HOME=$(/usr/libexec/java_home)” >> ~/.bash_profile
and restart your shell (Close the terminal and open)
[b]If you have multiple JDK versions installed and you want it to be a specific one, you can use the -v flag to java_home like so:
echo export “JAVA_HOME=$(/usr/libexec/java_home -v 1.7)” >> ~/.bash_profile
[c]Checking bash_profile page – In terminal “vim ~/.bash_profile” will open the bash_profile page which contains :
export JAVA_HOME=$(/usr/bin/java)
export JAVA_HOME=$(/usr/libexec/java_home)
“:wq” to quit from bash_profile page
[2] Xcode
Download Xcode from download link
[3] Node.js
Install node js from download link and download link1
[4]ideviceinstaller
Install ideviceinstaller on Mac OSX
About the App
- App name: ideviceinstaller
- App description: Cross-platform library and tools for communicating with iOS devices
- App website: http://www.libimobiledevice.org/
Install the App
- Press Command+Space and type Terminal and press enter/return key.
- Run in Terminal app:
- ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” /dev/null
- and press enter/return key. Wait for the command to finish.
- Run:
- brew install ideviceinstaller
Done! You can now use ideviceinstaller.
[5] Appium App
Download appium.dmg (GUI) from Download link and install it
[6]Install appium via cmd line tools
Using Appium from Command Line
Installation
- Open a terminal session
- Install homebrew (instructions)
- Run the below commands
$ brew install node # install node and npm
$ npm install -g appium # globally install appium
$ npm install wd
$ appium # Launch your appium server!
Usage (Optional)
Whenever you want to begin an appium server session, type appium to run the server.
Arguments can be added to that command.
appium –app path/to/app –device-name “iPhone Simulator”
Using Appium.app inspector with server (Optional)
In my development env setup, I don’t use the Appium.app server, but I DO use the inspector.
- Start your Appium server with the –app and –device-name arguments
- Click on the Appium.app inspector icon
- The iPhone Simulator will launch, and may give you an authorization prompt for Instruments to control it
[7] Appium Dependencies Check
Launch the Appium(GUI) and select Appium Doctor,Appium Doctor will checks for all dependencies and display a message “Everything looks good, bye!” if all dependencies are installed
If some dependencies are not installed it will ask to install and we can install from pop up shown
[8]Application(.ipa file)
[i]For automation we need app signed with a Development certificate(Not enterprise, not from the app store, not release).You can ask any of your developer to give the build in development mode)
or
[i] In Xcode, make sure the Debug Code Signing Identity in Build Settings->Code Signing is set to Developer provisioning profile.
[ii] Build and run (⌘R) the app directly to the real device/Simulator from Xcode. After that stop the running.
[iii] Build the app (⌘B) so it will generate the .app file
[iv]Note down the build path of your application where your ‘.app’ file will be created
[i]Make sure you are automating a .ipa file but not .app file
[9]Device settings:
[i]In your iOS device, Go to Settings -> Developer and Enable the UI Automation (instructions)
[ii] Your device may not be enabled for development.Go to Xcode ->Click Open Developer Tools-> Click Instruments->In top of the Instruments tab you can find Choose a profiling template(Choose your iPhone device)->Select Automation->Click Choose button andClick the Play button.
[iii]Device should be unlocked
[10]Launch Appium and start Inspector
[i]Get device udid from iTunes
[ii] I launched Appium and then started Inspector. I got errors that “A session could not be started” with different original errors. The one that stuck around most, said: “instruments crash on startup”. workaround for it is:
- Start Appium GUI app
- Open Developer Settings of Appium GUI app
- Put a tick in Enabled
- Put a tick in Custom Server Flags
- In the text field of Custom Server Logs put –native-instruments-lib
- Open General Settings and make sure Server Address is 0.0.0.0 and Port is 4725
- Open iOS Settings
- In iOS Settings, Basic tab
- Add App Path (App location in the machine)
- Force Device, mine is iPhone 5, Platform 9.2, if you still get errors, in the appium log available devices are listed, find them and select to force device with data from the list or find device from xcode simulators list
- In iOS Settings, Advanced tab
- Put a tick in Use Native Instruments Library
- Put a tick in Instruments Launch Timeout, add 900,000 ms
- Press Launch btn in Appium GUI app
- Press Inspector btn in Appium GUI app
Finally the Inspector loads the app in a simulator of the forced device
[11] Appium Project creation in Eclipse :
Download Eclipse for Java from download link
[i]Launch Eclipse
[ii]Top left ->File->New->Select Java Project
[i]Launch Eclipse
[ii]Top left ->File->New->Select Java Project
[iii]Add Project name and select Finish
[iv]Java Project will be created
[v]Select Created Project,Right click on Src->New and select Package
[vi]Add Package name and select Finish
[vii]Right click on Src->New and select Class
[viii]Add Class name and select FinishNow we Created a Appium Project. Add jars mentioned at steps [12] &[13] (Appium Client library and Selenium Server Jar) to Appium Project (Right click on project ->Properties->Add External Jars)
[iv]Java Project will be created
[v]Select Created Project,Right click on Src->New and select Package
[vi]Add Package name and select Finish
[vii]Right click on Src->New and select Class
[viii]Add Class name and select FinishNow we Created a Appium Project. Add jars mentioned at steps [12] &[13] (Appium Client library and Selenium Server Jar) to Appium Project (Right click on project ->Properties->Add External Jars)
[12]Appium client library-Java (download)
[13]Selenium Server jar (download)
[14]TestNG -optional (download)
It was an honor to finally meet face-to-face with one of my open source heroes Dan Cuellar and talk about the future of Appium.
Dan Cuellar is the original creator of Appium. Jonathan Lipps is the leading developer on the Appium project now, but Dan is still proving leadership in the vision and direction of Appium automation.
Before we get into the future of Appium lets, cover some intro info first.
What is Appium?
Download Appium Server For Windows
Originally Appium was developed as an automated tool used to create test scripts that can run against native mobile applications and mobile-web apps on iOS or Android leveraging WebDriver.
Appium vs Selenium
You might be confused about what the difference is between Selenium and Appium. They are different technologies for different testing needs. Appium is for mobile test automation, and Selenium is for browser-based automated testing.
Evolution of Appium
At the Selenium Conference 2017 in Austin, Texas Dan gave a presentation on Automation for Apps. In it he laid out the evolution of open source automation as starting off with Selenium WebDriver which automated website, and then with Appium that generalize WebDriver to automate mobile apps. The next step is to bring in the ability to automate other kinds of apps on Windows and Mac.
This ultimate evolution is called the StarDriver vision — one protocol to automate all the things, and this is one of the first steps towards it.
WinAppDriver
Windows Application Driver developed by Yousef Durr at Microsoft is the Windows implementation of Appium to automate Windows applications.
Appium For Mac
Stuart Rusell of Intuit has stated a proof of concept called AppiumForMac to help you automate mac apps using the same Appium Selenium WebDriver.
For those of you that don't like video here is the full transcript of my interview with Dan at this year's Selenium Conference in Austin.
Download Appium For Windows
Dan's Session at Selenium Conference 2017 in Austin, Texas
Joe: … Excited to be here with us. Here we have the creator of Appium, Dan. He's doing a session on Appium, so Dan can you tell us a bit more what your session is going to be on?
Dan: Cool. Yeah, so Stuart Russell into it and and Yousef Durr of Microsoft and I are going to present on automating desktops on Appium. So it's the next step in the StarDriver vision. We started with Web Driver which automated websites, and then with Appium we sort of generalized it to do mobile applications.
The next step is we're bringing in other kinds of apps. We're going to talk about Windows Support and Mac Support. Windows Support which has almost been fully released but it's in Beta now, and Mac Support which is also in Beta. And then about the StarDriver vision of one protocol to automate all the things, and how we're achieving that.
Joe: Oh, cool.
What is Appium's view of the Automation
Dan: Appium takes a more broad view on it and says: “Well, why have a protocol just to automate one thing?” We feel that automation is similar enough that we might be able to develop one protocol to automate everything, which we refer to currently as the StarDriver Vision.
At Appium, we're working on continuing to generalize the web driver's specifications, so that perhaps one day we might have one protocol to automate all the things. Much further down the line, eventually people will just bring their own implementations to the table, and we won't be doing anything. We'll just be standing around taking credit for it or something.
What is WinAppDriver
Joe: I heard of a WinAppDriver. Is this something to do with Appium?
Dan: Yes, that's the Window implementation for Appium.
Joe: Okay. So I could literally automate a web-based application using Appium. If I had a calculator or a Windows VB6 application …
Dan: A Windows-based application?
Joe: Yes.
Dan: Yes. And it does support some web content. We'll go into specifics in the talk.
Joe: Okay, cool.
Dan: Yes, a full web content hopefully soon on Windows. But it does have some support for it.
Joe: So if someone's familiar with Appium already, how would they be able to leverage this, is it the same technology?
Dan: Yes, it's the same technology. You really need to learn very little other than a different set of capabilities. It's just the same protocol like differently. So less of a learning [inaudible 00:02:06] … and then the Selenium people when they came to Appium.
Download Appium Desktop
Automate Windows and Mac apps
Joe: Right, okay. You mentioned it would also work on Mac or Linux based on …
Dan: Mac right now. There exists no implementation for Linux but it's certainly possible to write one.
Joe: All right, cool.
Dan: I just haven't had anyone chip in with that yet.
Joe: Okay, so you'll actually be actively involved in the development of this. I know you've been a little hands-up with Appium.
Dan: Yeah, I wrote the prototype for the Mac implementation and I tried to write a prototype for the Windows one, but some people in Russia wrote a better one, then Microsoft came and wrote their own so when you have the vendor writing it themselves, I think it'll be hard for someone on the outside to do any better than that. That's the approach we're looking for anyway – to eventually have the vendors come in and do all of the implementations and have the protocols be its own thing that we work on together and the tooling around that …
Growth of Appium
Joe: Yup, so when you created Appium did you ever think it would develop to this point where you're actually branching off into …
Dan: Yes and no. I never expected Appium to ever work. Once Appium worked, I thought Windows apps and Mac apps were kind of inevitable. We always sort of had this [inaudible 00:03:07] automation for apps. Jonathan and I joked about like … one day Windows and Mac. We weren't really joking, we really thought that one day this would happen. Why not use this for everything. I never thought Appium would ever become anything, but once that Leaf happened, I assumed … more and more responsible than I used to.
Appium Vs Espresso
Joe: Good. Now I just want to get your opinion on this. You hear more and more about Espresso, and I've been getting to ask a question on what's the difference between Espresso and Appium. I don't know if you're familiar with Espresso …
Dan: Yes, yes
Joe: What would you have used on that?
Dan: For some people, you might want to read about the correct choice, there's a lot of advantages having Appium, and there's also a lot of advantages to going with the Google supply to protocol Espresso, which is shipped with the later versions of Android. If you don't need some of the benefits of Appium, such as compatibility with the Legacy Android devices, one protocol for both iOS and Android and some of the other tooling that comes around that we have … And you have a team that writes Java code, I know the developers, Espresso might be a good choice because you'll have a more tightly coupled set of automation.
But that being said, there are still many benefits that Appium brings to the table. For most people, Appium is still the correct choice. There does exist that new niche developer market who does do their own automation and who wants to use it. Where to Espresso could work well for them and could provide things Appium wouldn't.
Joe: Cool.