How to view documents using Visual Studio

View documents in Visual Studio with an amazing tool

Xpath Axes

A very useful trick for automation

Review: Spire.DataExport for .NET

A great tool for exporting data in .NET

How to install Arch Linux, step by step, for VMware Workstation (Part I)

First part of a installation tutorial for this beloved OS

How to setup a local repository in Ubuntu

The steps to have a local repo in Ubuntu

Wednesday, March 11, 2015

Quick tip: How to handle modal dialogs in Selenium

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

Installing OpenSSL in Ubuntu

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.

You basically need to install OpenSSL and the shared libraries. To install OpenSSL with apt-get, abre una Terminal e ingresa este comando:

sudo apt-get install openssl

Now enter this to verify if you installed OpenSSL properly:

openssl

You should see something like this:
OpenSSL
To install the OpenSSL shared libraries, follow these steps:

1. Run this command:

sudo apt-cache search libssl | grep SSL

You'll get a short list of libraries. What we are looking for is the SSL shared libraries:
SSL shared libraries
2. Now that you have the name of the libraries, install them with apt-get

sudo apt-get install libssl0.9.8

If you get a different version, install that.

Ok, we have OpenSSL installed in our machine. I'll publish more about OpenSSL soon, but for anything that you might want to do, you need to have this installed first. I hope this is useful!

Monday, March 2, 2015

Graphical package management for Linux

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:

Ubuntu symbol
Then, type 'synaptic'. Just click the first application to open it.
Synaptic app
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.
Synaptic dashboard
But let's install something. In the left menu, select Databases, then in the right list select postgresql.
Installing 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'.
Other packages affected
Click 'Apply'.
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.