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

Tuesday, October 25, 2016

Tools for API REST testing

Sometimes we have to test some feature on the fly, especially if you are supporting more than one team on QA. I already showed how to test APIs with java and Apache libraries, but you my find yourself in a moment when you don't have your code at hand. Then, what to do?
Fortunately, there are some options for this. I´ll check a couple of them.


Postman is a Chrome and Mac add-in that allows us to work with all kind of API requests. This is a great option for QA, since it has a comprehensive set of options displayed through a nice UI. But let's play a little with a request:

1. Download Postman here.
2. Install it.
3. Open Postman. You should see something like this:

4. For this example, we'll use the pubic API from So, let's make some GET requests: Paste the following in the main text box: (Returns gzip-encoded data). Make sure that the request is a GET, and then press Send. The result should be displayed in JSON format, like this:

Postman is a comprehensive tool with many options. However, these are the features I liked the most:

History: This is especially useful when you do a lot of requests with different URLs. Sometimes it's hard to keep track of the URLs and configurations, but you can check any past request if you need to in the History:
Request history

Multiple tabs: You can open new tabs, each one with the particular set of options you set. This is useful when you need to copy or compare parameters from different requests, like copying an authentication token.
Multiple tabs

Postman is a great tool, with many advanced options that can help both developers and QAs. However, what if you can't install Postman for some reason? Some organizations have the access to the Chrome store blocked, and contacting IT just for a quick fix might not be always the answer.

Online REST test

There are many pages to do simple requests. These do not have many options or advanced configuration, but they might be helpful to some tests on the run. Examples:

REST test test

You can find this tool at To make requests with this tool:

1. Open the page.
2. Select the method. In this case, it's GET.
3. Select the endpoint. We will use the URL we used before (
4. Press Ajax request.
5. You should see the same response than the one you obtained with Postman.

These tools are not uncommon in internet. For example, you can also use this:, which will give you most of common options for these tools (Add authentication, header, parameters, etc.):

Monday, October 24, 2016

CSS selectors for automation: how to use them

One of the most common problems we face when automating is that the elements' locators become obsolete as soon as there is a change in the UI we are testing, and most of the time the options for this are clear: Xpath or  CSS Selectors. I´m not comparing them in this article, since there's some controversy around the question. I found an interesting article that compared Xpath and CSS Selectors in terms of performance and other metrics, you might want to check it out. So, there are many reasons to use CSS Selectors. Now, I´ll show some basic tricks with CSS Selectors with a framework with Java and Selenium in mind.


Select by ID
Select by tag
Select by class
Select nth element


  1. First of all, open Firefox. We will use this page ( for the examples, so open it in a new tab. 
  2. Now, right click on the Testools logo > Inspect Element with Firebug.Inspect logo
  3. Click FirePath.
  4. Click the button at the left of the text box and select CSS. Here we will test our CSS Selectors.CSS text box

Select by ID

First, let's check the HTML structure for the logo:
Logo ID
As you can see, the id for the Logo is Header1_headerimg. In CSS Selectors, IDs are selected using #. So, in this case, we can select the logo with this:


Open the FirePath tab and paste that string, then press Enter. You should see a match:
Selected logo element

Since IDs should be unique, using them is a safe way to select elements for Selenium. However, not all elements have a unique ID, and asking developers to add them is not always an option.

Select by tag

You can select elements by tag, although this is better used in along with classes. However, tags are selected only with the tag name itself. If you'd want to select all the elements with the tag img, like this:
img tag

You'd only need to write this:


And it will match all the elemts with the img tag:
Selection by tag

Select by class

Classes are selected using dots. For example, if we want to select the first post:
Posts inspection
We can do it by typing the class name preceded by a dot:


This will select all the elements with the class wrapfullpost. In this case, 5 elements are selected, since there are 5 posts in the main page:
Select by class

Select nth element

In the example above we had 5 elements selected. But what if we want to select only one of those elements? Let's check another example. Enter the following css:

That will select the menu:

Menu selected

If we expand the selected element, we will see that the four menu elements are represented by 'li' nodes. To select the 3rd element, we can use: li:nth-of-type(3)

3rd element

Note that, to select the first element you should use nth-of-type(1). Unlike most of other syntax, here you start the count in 1.

This will be enough to get you started using css selectors!

Tuesday, October 4, 2016

API testing: Get requests with Java and Apache libraries

API testing is very common nowadays, and it's easy to see why. One of the uses of APIs is to manipulate an application to create pre steps (among a lot of other things) for scenarios without the need of handling the UI, which is good news for all who struggle with locators that change a lot.

In this article I will show how to use Java to perform basic API actions with the Apache HttpComponents. Let's check it out:


1. Open Eclipse and create a new Java Project. Call it 'APITesting'
Project details

2. Right click src > New > Class. Name the new class 'APITesting'. Select 'public static void main(String[] args)' to create the main method snippet. Then click Finish.

Class details

Class created

3. Add the needed libraries. For this, expand the APITesting project and right click JRE System Library > Build Path > Configure Build Path...
4. Click 'Add External JARs'
5. Navigate to httpcomponents-client-4.5.2\lib and select the following libraries:
  • httpClient-4.5.2.jar
  • httpcore-4.4.4.jar
  • commons-logging-1.2.jar
Then press OK.
6. Now that you have all the required libraries, enter the following code into the class. The final result should look like this:

So, basically, you have to perform 3 main actions here:

- Create a httpClient:

HttpClient httpClient = HttpClientBuilder.create().build();

- Create a GET request with proper endpoint and add the header:

HttpGet getRequest = new HttpGet(
getRequest.addHeader("accept", "application/json");

- Execute the request and store the result in a HttpResponse:

HttpResponse response = httpClient.execute(getRequest);

From there on, you can play with the contents of the response and print it, as I did in this example. Click the Play button in Eclipse to run the code. You should see a json text as response in the console:


Thursday, September 8, 2016

Wikileaks, Snowden, Russia and Trump: Who are them and what they want

Organizations like Wikileaks and people like Julian Assange or Edward Snowden often have an image of courage and integrity. This image puts them in a position of influence in the world, and of course, the US elections.

You may have noticed that Wikileaks is very anti-Clinton. They do not endorse Trump in any way, but they are constantly monitoring the Democratic Party and any fact or rumor they can find about Clinton. And why is this? Simple: They are anti system, and Clinton represents this system better than anyone, for better or worse. But is being anti system a good thing per se? Obviously no.

For example, let's take the case of Julian Assange, the interesting founder of Wikileaks. There are some points about him that I don't like at all:

Assange friends

Putin: It does not matter in which side you are on: Putin is a corrupt semi-dictator. I've know Russian personally, and they tell me about an authoritarian and corrupt government. My own country does deals with Russia, and believe me, they ARE corrupt.

Ecuador, Bolivia and the other "21st century socialists": These countries are struggling with economic, political and social problems generated by the populist governments. As Russia, authorities in these countries constantly look for partners in a world that's leaving them behind, and they find friend in any kind of outcasts, no matter if they are good or bad.

Assange and Snowden do not criticize Russia

An important information source such as Wikileaks should at least have some equilibrium when investigating different countries. My country had a lot of problems because of the US, but Russia is by no means better, and I know it because my country has close relations with Russia and there are always problems with bribes and stuff.


In the logic of "our enemy's enemy is our friend", Assange and Snowden have been clearly trying to undermine Clinton's reliability. And this is like a general attack on the establishment. But what about Russia? Here are some words about Russia by Assange himself:

“Every man and his dog is criticizing Russia,” he said. “It’s a bit boring, isn’t it?”

Well, it might be boring but it is definitely important, Julian. And why is this? Just because Russia is against the "American Empire". In my country is the same, people tend to blame "the Empire" for everything. If my girlfriend cheats on me it's because the American Empire convinced her to. The same with Trump. I guess some people do not care if they are indirectly supporting a monster, as long as he is against his current enemies. It's very shortsighted, and dangerous in the sense that, at the end of the day, these "rebellious" people and organizations follow their own agenda as well.

Tuesday, September 6, 2016

Tip: How to match node with no text using XPATH

When automating, there are times when you have to verify that a value was not populated. For example, if you are trying to verify a table, there will be times when a certain cell does not have a value. Sometimes, when an element is null or non existing in a table, developers turn it into a node with no text in HTML. For example, the table at

Node with no text

Let's check the steps to verify this. What you will need (these are not mandatory, but it's what I used to write this article):

1. Right click the empty cell > click 'Inspect Element With Firebug'. With this, we'll get the information to construct the xpath:
Empty cell HTML
2. We will select the table initially, and from there we will "navigate" to the empty element.
HTML tree
3. Click the FirePath tab and enter this xpath: //table[@class = 'w3-table-all notranslate']/tbody/tr/td
All td nodes matched
As you can see, all td nodes are matched by this.

4. Add [not(normalize-space())]. The final xpath should be: //table[@class = 'w3-table-all notranslate']/tbody/tr/td[not(normalize-space())]. Now press enter and the empty cell will be selected.

I hope this is useful for your automation efforts!