Wednesday, March 11, 2015

This is one of those cases that could make you waste time. From time to time, you'll find a page that opens a System modal dialog when you click something or activate certain action. Since this dialog is not part of the browser, you won't be able to access it with the Webdriver.

When I first had this problem, I tried some different solutions (all wrong):

1. Use Sikuli to handle the modal dialog. When I did this, selenium crashed with the same error I had before:

org.openqa.selenium.UnhandledAlertException: Modal dialog present

2. Catch the error with a Try/Catch clause. For some reason, I couldn't catch the error, neither using the specific 'UnhandledAlertException' nor using a generic Exception.

So, the correct way to access these modal dialogs is the following:

Alert alert = driver.switchto().alert();alert.accept()

This simple piece of code will help you with the annoying modal dialog for some pages.

Thursday, March 5, 2015

OpenSSL is a open source SSL/TSL implementation. It allows us to manipulate those well known security protocols. It can be very useful for testing security related issues and some other things. For example, you can use it along with WireShark to test different ways do desencrypt secured traffic. But I'll write about it in another post. Now, I'm in a Linux mood, so I'll use Ubuntu for this article.

Monday, March 2, 2015

Everybody who uses Linux (or at least some Linux distributions) knows the classic apt-get. In fact, I think it's one the tools that makes Linux simple and fun (although there's something similar for Windows). However, I always thought that the greatest problem for Linux to become more popular among regular users is the lack of graphical interfaces. It doesn't matter how simple using commands is, looking at a graphical interface will make the user feel safer, at home.

So, here's a graphical package management for apt: Synaptic. It's not the fanciest tool available for Linux, but I'm always enthusiastic about graphical interfaces for this OS, just because I'd like more people to try it. But let's take a closer look (just in case, I'll be using Ubuntu for this review).

To install Synaptic just use the following command in a Terminal:

sudo apt-get install synaptic

After the installation finishes, click the Ubuntu symbol at the left side of the screen:

Then, type 'synaptic'. Just click the first application to open it.

The first time you open the application, a prompt will tell you to refresh the packages frequently. Close it and you'll see Synaptic dashboard. It's pretty simple and easy to understand.

But let's install something. In the left menu, select Databases, then in the right list select postgresql.

Click the check-box for postgresql and click 'Mark for installation'.

A dialog will be displayed telling you that other packages will be affected. Click 'Mark'.

Click 'Apply'.

In the 'Summary' dialog, click 'Apply'. Now you'll see the download progress.

Once the files are downloaded, you'll see a final dialog. Just click 'Close'. And that's it! A super easy way to install software in Linux, with a graphical interface. The steps for uninstalling software are almost the same. I really like this kind of tools. It will help a lot of people to try Linux.