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

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

Chrome leaves the autocorrect underline when tapping on different elements in a content editable element

I found this weird bug in Chrome for Android: in a content editable, using a keyboard with autocorrect capabilities such as the Google Keyboard or SwyftKey etc, the marking of the current word, made with an underline is left behind when the user taps different elements.
Continue reading Chrome leaves the autocorrect underline when tapping on different elements in a content editable element