by ITArray | Mar 17, 2017 | Appium, Automation, Mobile, QA, Testing, ui, Unit testing
Hello friends,
I work as a software test engineer already more than 6 years. And during these 5 years, I understood one thing – if You want to start to learn something new from the beginning, then You will Google for it. And as a result – You will find a lot of information without examples and simple explanation or You will find nothing at all, except some raw documentation.
I found that topics about mobile automation sometimes scare the people. So, I want to reveal the myths about mobile automation.
This article describes the simplest way of how to setup and run Your first test. An example is based on Appium 1.5.3 and Android system. It’s not about advanced usage of the latest version, etc.
What You need for starting with mobile automation
There are few thing that You need to have.
- Computer. MacBook is preferable to perform automation testing for iOS also.
- Pre-installed Android SDK or Android Studio is even better. Download here.
- Configured environment like for Selenium WEB testing.
- Appium desktop application latest version (1.5.3). Download here.
Base configuration
After downloading of Android Studio and setup of Android SDK You need to add the path to the folder with android SDK to the PATH of environments.
Run 1st test
- Create simple maven project in Eclipse or IntelliJ
- Add Appium dependency:
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>2.2.0</version>
</dependency>
- Download test application that is used as an example. You can find it here or on Play Store here
- Create test class based on JUnit test framework and past the code inside:
public class PresentationTest {
private static final String MYREACTIONS_ID = "com.denyszaiats.myreactions:id/";
protected static DesiredCapabilities capabilities;
@Test
public void testPresentationTapGame() throws InterruptedException, MalformedURLException {
capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("platformVersion", "6.0");
capabilities.setCapability("deviceName", "emulator-5554");
capabilities.setCapability("app", {PATH_TO_APK_FILE});
AppiumDriver driver = new AndroidDriver(
new URL("http://0.0.0.0:4723/wd/hub"),
capabilities
);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.findElementById(MYREACTIONS_ID + "imageLangEn").click();
driver.findElementById(MYREACTIONS_ID + "skip_login_button").click();
driver.findElementById(MYREACTIONS_ID + "buttonGuideOk").click();
driver.findElementById("android:id/home").click();
driver.findElementById("android:id/home").click();
driver.findElementByXPath("//*[@text='Crazy Fingers']").click();
driver.findElementById(MYREACTIONS_ID + "buttonGuideOk").click();
driver.findElementById(MYREACTIONS_ID + "handButton").click();
driver.findElementById(MYREACTIONS_ID + "imageRightHand").click();
driver.findElementById(MYREACTIONS_ID + "fingerButton").click();
driver.findElementById(MYREACTIONS_ID + "imageIndexFinger").click();
driver.findElementById(MYREACTIONS_ID + "startButton").click();
WebElement tapButton = driver.findElementById(MYREACTIONS_ID + "imageTapButton");
int x = tapButton.getLocation().x + 50;
int y = tapButton.getLocation().y + 50;
for (int i = 0; i < 350; i++) {
driver.tap(1, x, y, 1);
}
String result = driver.findElementById(MYREACTIONS_ID + "resultsFasterClicker").getText();
assertEquals(result, "350");
}
}
- Open Android simulator. Or create a new Android simulator. Or connect Your Android test device. Do not forget to enable developer mode on Your real device.
- Open Appium desktop app and start it. Wait few seconds before Appium is ready to use. Run the test with JUnit.
This is it. Just several simple steps to run the simplest scenario with Appium.
I hope that now You’re confident with mobile automation and You know how to start with it.
Thanks for reading this article!
by ITArray | Jan 13, 2017 | Appium, Automation, QA, Selenium, Testing, ui, Visual Testing
Who said that Python is not friendly with Front-end?
ITArray released the 1st version of Automotion-Python framework that can be used for visual validation of the web and mobile application.
You can find it by link https://github.com/ITArray/Automotion-Python
If You want to connect the library to Your project with “Tox” – simply add this dependency to Your tox.ini file:
http://github.com/ITArray/Automotion-Python/tarball/master#egg=Automotion
It’s super simply in usage:
from automotion import responsive_ui_validator
ui_validator = responsive_ui_validator.ResponsiveUIValidator(self.driver)
result = ui_validator.init("Open navigation drawer scenario").find_element(self.driver.find_element_by_name("Name"), "Name")\
.same_size_as(self.driver.find_element_by_id("Id"), "Search Icon")\
.same_offset_bottom_as(self.driver.find_element_by_id("Id"), "Search Icon")\
.same_offset_top_as(self.driver.find_element_by_id("Id"), "Search Icon")\
.not_overlap_with(self.driver.find_element_by_id("Id"), "Search Icon")\
.inside_of(self.driver.find_element_by_id("Id"), "Toolbar")\
.width_between(100, 200)\
.height_between(100, 200)\
.draw_map()\
.validate()
ui_validator.generate_report("ReportToolbarIcons")
Leave Your feedback and comments. Also join and contribute into Automotion if You have ideas.
Thanks for reading my blog!
by ITArray | Dec 20, 2016 | Mobile, Selenium, Testing, ui
Try to ask any QA automation engineer the simple question “How to verify that element is presented on the page?”. The answer will be simple and obvious “It needs to check that element is displayed”.
Let’s try to look on this case from another perspective. How many times we’ve been using the web applications with terrible design? Yes, everything works as expected on the web pages and all the elements are displayed. But the main human’s instrument for perception of external world is the eyes and the brain. We see the world in 3D. But on the background human’s brain try to simplify the perception by dividing all the things into vertical and horizontal. If the things are aligned without these primitive options – then our brain will turn on another validator to catch what is wrong. This fact was proved by scientist few years ago.

So, this is just another validator of external world – and what? Yes, it sounds like nothing serious. Our brain is so powerful that can perform millions of validations per second.
The main problem is the next: once the brain is switching to another processes of the world perception, some of other important activities may be slowed down. What does it mean in the real world? Let’s back to the main topic.
Imagine the situation that user opens some web page of online shop because he/she looks for something not important for him, just for some different discounts and so on. Every day hundreds of thousands of the purchases happen exactly in such way. If the interface is simple with properly aligned UI elements – then customer will be concentrated on the searching of the stuff for buying. But if the elements have not proper alignment – background processes of the brain that are responsible for validation of external world will be working in the way to understand and stabilise the perception of the image that user sees at the moment. And at this moment it appears high possibility that user will forget about the main reason why he/she opened the web page.
If to look at the problem from the point of view of QA automation engineer it’s easy to understand that it is not enough to test that elements are presented on the page. And the main importance switches to the validation of how the elements are presented on the page. Kind of validation of perfect pixel.
Powerful framework Automotion is the best solution for Web and mobile automation testing to perform proper visual validation. It allows to validate the alignments of the elements on the page like how user would like to see it. The most powerful feature are extremely fast validation of the page on the different zoom levels of the browser and different page sizes. Validation for correct central alignment of one element or the group of similar elements. It’s a really smart validation of the page.

I hope that this article will help improve the quality of the applications.
Have a good quality!
by ITArray | Nov 30, 2016 | Appium, Automation, Mobile, Selenium, Testing, ui
How many times You had a corrupted design after release?
It’s almost impossible to test manually on a big amount of devices that UI looks fine after some changes. So, let’s do it automatically.
Automotion – simple library for automation testing.
In the latest version was implemented powerful instrument for validation responsive UI on web or mobile pages.