Appium Bootcamp - Chapter 2: The Console
Sauce AI for Test Authoring: Move from intent to execution in mo.|xBack to ResourcesBlogPosted
Sauce AI for Test Authoring: Move from intent to execution in mo.
|
x
[UPDATE- November 2019]You can observe the newest Get Started with Appium white papers here:Get Started with Appium- Java and Get Started with Appium- Ruby
This is the 2d post in a series called Appium Bootcamp by noted Selenium expertDave Haeffner.
Dave recently immersed himself in the exposed source Appium project and collaborated with conduct Appium contributor Matthew Edwards to work us this material. Appium Bootcamp is for those who are make new to mobile test automation with Appium. No familiarity with Selenium is required, although it may be utile. This is the second of eight posts; a new post will be released each workweek.
Configuring AppiumIn order to get Appium up and pass there are a few additional things we & # x27; ll take to take care of. If you haven & # x27; t already done so, install Ruby and setup the necessary Appium customer libraries (a.k.a. & quot; gems & quot;). You can say a write-up on how to do thathere.
Installing Necessary LibrariesAssuming you & # x27; ve already instal Ruby and need some additional help installing the gems, hither & # x27; s what you to do.
Install the gems from the command-line with
gem install appium_consoleOnce it completes, run
gem list | grep appium
You should see the undermentioned lean (your version numbers may vary):
appium_console (1.0.1)
appium_lib (4.0.0)
Now you hold all of the necessary gems installed on your system to postdate on.
An Appium Gems Primer
appium_libis the gem for the Appium Ruby client bandaging. It is what we & # x27; ll use to write and run our tests against Appium. It was installed as a colony toappium_console. appium_consoleis where we & # x27; ll pore most of our care in the remainder of this and the next post. It is an interactive prompting that enables us to send bid to Appium in real-time and receive a response. This is also cognize as arecord-eval-print loop (REPL). Now that we feature our libraries setup, we & # x27; ll need to grab a copy of our app to test against.
Pro tip: Tools like SUSA can handle this autonomously — upload your app and get results without writing a single test script.
Sample Apps
Don & # x27; t have a test app? Don & # x27; t perspire it. There are pre-compiled test apps available to kick the tires with. You can grab the iOS apphereand the Android apphere. If you & # x27; re using the iOS app, you & # x27; ll want to make sure to unzip the file before apply it with Appium. If you want the latest and sterling version of the app, you can compile it from source. You can observe instructions on how to do that for iOShereand Androidhere. Just make sure to put your test app in a known location, because you & # x27; ll require to reference the path to it next.
App Configuration
When it get to configuring your app to run on Appium there are a lot of similarities to Selenium -- namelythe use of Capabilities (e.g., & quot; detonator & quot; for short). You can delimit the necessary configurations of your app through caps by storing them in a file calledappium.txt. Here & # x27; s whatappium.txtlooks like for the iOS trial app to run in an iPhone simulator:
[caps]
platformName = & quot; ios & quot;
app = & quot; /path/to/UICatalog.app.zip & quot;
deviceName = & quot; iPhone Simulator & quot;
And here & # x27; s whatappium.txtaspect like for Android:
[caps]
platformName = & quot; android & quot;
app = & quot; /path/to/api.apk & quot;
deviceName = & quot; Android & quot;
avd = & quot; training & quot;
For Android, note the use of bothavd. The & quot; training & quot;value is for the Android Virtual Device that we configured in the previous post. This is necessary for Appium to auto-launch the emulator and connect to it. This eccentric of configuration is not necessary for iOS. For a full lean of available cap, readthis. Go ahead and create an appium.txt with the caps for your app.Launching The ConsoleNow that we have a test app on our system and configured it to run in Appium, let & # x27; s fire up the Appium Console. First we & # x27; ll need to start the Appium server. So let & # x27; s head over to the Appium GUI and launching it. It doesn & # x27; t matter which radio push is selected (e.g., Android or Apple). Just click theLaunchbutton in the top right-hand corner of the window. After tick it, you should see some debug information in the centerfield console. Assuming there are no errors or exceptions, it should be up ready to receive a session. After that, go rearward to your terminal window and runarc(from the same directory asappium.txt). This is the executing command for the Appium Ruby Console. It will take the caps fromappium.txtand found the app by tie it to the Appium server. When it & # x27; s execute you will have an emulator window of your app that you can interact with as well as an interactional command-prompt for Appium.
Outro
Now that we receive our trial app up and running, it & # x27; s time to interrogate our app and learn how to interact with it.
About Dave Haeffner: Dave is a recent Appium convert and the source of Elemental Selenium (a free, once hebdomadal Selenium tip newsletter that is say by thousands of testing pro) as well as The Selenium Guidebook (a step-by-step guide on how to use Selenium Successfully). He is too the Lord and upholder ofChemistryKit(an open-source Selenium framework). He has assist numerous companies successfully apply automate acceptance testing; include The Motley Fool, ManTech International, Sittercity, and Animoto. He is a founder and co-organizer of theSelenium Hangoutand has spoken at numerous conferences and meetups about acceptance examination. Follow Dave on Twitter -@ tourdedave
Continue the reading the other chapters:
Automate This With SUSA
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.
Try SUSA FreeTest Your App Autonomously
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.
Try SUSA Free