How to change keyboard layout with a keyboard shortcut in OSX

To study Japanese I added to my Mac some extra keyboard layouts. However when I was reviewing my Anki cards I found annoying every time to have to press on the little flag icon and chose the appropriate layout. On OSX (El Captain, but I guess is the same on older ones), you can add a shortcut which I set to ⌥Space to avoid conflicting with Spotlight.

Keyboard-preferences-shortcut

Java Design Patterns: Implementing a singleton for Selenium WebDriver

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

Adding Maven to a project in IntelliJ

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

Accessing an iFrame through Selenium WebDriver

Selenium is great for testing web applications in general, however one of the least used things in this space are iFrames. You might be interested into them because you want to automate logging in, or because you have sandboxed elements into your application.

Fortunately, in Selenium is quite easy to achieve this result: all we need to do is to switch context, which can be done in three separated calls.

  1. Find the iFrame element
  2. Switch the driver to the iFrame
  3. Play with the contents of the iFrame!

Continue reading Accessing an iFrame through Selenium WebDriver

A simple test with Seledroid

So now that we know that Selenium is working as we expect (I am a newbie here), we can try adding Seledroid. If you haven’t used Selendroid before, I strongly recommend you to follow the initial setup guide, available here. Basically you will need to have JAVA_HOME and ANDROID_HOME variables correctly set up in your system.
Continue reading A simple test with Seledroid

Getting ready to write our first Selenium Test in IntelliJ

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

Mobile Testing in Android with selendroid

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.

Selendroid

seledroid-logoThe 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.

Event.isTrusted property from UI Events shipped in Chrome 46

Working on a large JavaScript project is not easy. We need fine tuning in everything we do, and sometimes we need to distinguish between a user-generated event and an event generated by a script.
Why is this important? Because the ability to distinguish between a user initialized action and a scripted one can make the difference to optimize the UI.

Continue reading Event.isTrusted property from UI Events shipped in Chrome 46

Beginners Guide to Landscape Photography

Tips, settings, compositions   Last Light Besides passion & patient, to photograph great landscapes photos, it takes a fair amount of preparation and skill in basic photography technique. This article focuses on some important, but not all, aspects of landscape photography that photographers need to master when photographing landscape. Don’t leave home without them. We are referring to gear other than the obvious two, your camera and lenses.

Continue reading Beginners Guide to Landscape Photography