Working with Android Studio means that we need to use gradle projects, however it might happen that some of our old projects were made in pure Java and with Maven, this is actually quite likely.
Converting a project from one format to another is though quite easy to be done through the command line and the
built init plugin.
In particular this tool allows us to convert not just from Maven but also from grails, java and scala.
Anyway, to move from Maven to gradle we just need to:
gradle init --type pom
At this point we can import the project into Android Studio quite easily.
What is a Singleton? A singleton is a class which should only be initialized once, provide a way to allow multiple instances of that class to be used, and finally to be the central point of access for that class.
Typical use cases of a singleton are classes accessing to system resources. In my scenario I want for example to create a singleton for Selendroid, since I really want to create just one instance of Selendroid to run all my tests.
Continue reading Java Design Patterns: Implementing a singleton for Selenium WebDriver
Previously I used the jar libraries for the Selenium/Selendroid project to work fine, however the method is not really ideal. Project dependencies should be imported automatically with a dependency sistem of some sort. Here I am going to add Maven to the project and manage the dependenices through it. Here I am going to add selenium-java and selendroid-standalone, but this is of course valid for any other library.
Continue reading Adding Maven to a project in IntelliJ
If you followed my last post you should be ready to write a very simple test, which purpose is to make sure that all the settings are correct in our testing environment.
Continue reading Writing the fist Selenium Test
Before getting into using Seledroid, it is probably a good idea to see if my old understandings of Selenium still apply. I haven’t used it in ages, so as a first step I will configure an IntelliJ project using Selenium.
Continue reading Getting ready to write our first Selenium Test in IntelliJ
It is always a problem automating testing in the mobile world, because the technologies used in the desktop world are not capable of the same level of testing, therefore we are looking for technologies that will allow us to at least do some level of mobile testing.
The first tool we are going to try is Selendroid, which seems to be the standard tool when it comes to Android mobile testing.
Selendroid uses the JSON Wire protocol, ready for Selenium 3. It makes possible to test native, hybrid applications and the mobile web. In our scenario we’re interested to the last two. Also Selendroid supports simulated devices as well as real ones.
How do you add a library to an Android Studio project?
In my case I need to add Crosswalk-project to the application I am working on (this example is about CrossWalk but it can be applied to any other library). So first of all I download CrossWalk and extracted it.
The next step is to import it into our application.
Continue reading How to add crosswalk project or any library to an Android Studio Project
First of all we have our XWalkView object from the layout in our onCreate method:
mWebView = (XWalkView) findViewById(R.id.activity_main_webview);
The steps a user follows to insert images into the document are:
- Tap on a file input button
- Choose to use the camera roll
- Read the image
- Insert the image into the document.
Continue reading Inserting images from the camera into the document using a WebView