9 most popular technical testing blogs in 2014

Get ready for the 9 most popular technical testing blogs in 2014! This list is published at TestBuffet.com, a place where the most popular software testing blogs are grouped. This ranked list was created by gathering a set of scores for different evaluators and ordering the retrieved scores. In total 18 technical testing blogs participated of which 9 complied with the entry criteria and ranking criteria as explained here.

Don't forget to check out the technical testing feed either through feedburner or on the technical testing category page.
Continue reading

15 most popular performance testing blogs in 2014

Get ready for the 15 most popular performance testing blogs in 2014! This list is published at TestBuffet.com, a place where the most popular software testing blogs are grouped. This ranked list was created by gathering a set of scores for different evaluators and ordering the retrieved scores. In total 27 performance testing blogs participated but only 15 complied with the entry criteria and ranking criteria as explained here.

Don't forget to check out the performance testing feed either through feedburner or on the performance testing category page.
Continue reading

21 Most Popular Test Automation Blogs In 2014

Get ready for the 21 most popular test automation blogs in 2014! This list is published at TestBuffet.com, a place where the most popular software testing blogs are grouped. This ranked list was created by gathering a set of scores for different evaluators and ordering the retrieved scores. In total 33 test automation blogs participated but only 21 complied with the entry criteria and ranking criteria as explained here.

Don't forget to check out the test automation feed either through feedburner or on the test automation category page.
Continue reading

Top 114 Software Testing blogs in 2014


Nearly 5 years after the original top 100 software testing blogs list a new top software testing blogs list is available. Get ready for the Top 114 Software Testing blogs of 2014! This time the list is published at www.testbuffet.com, a place where more software testing related lists will be published in the future.

Next top list candidates will be:
- Top x test automation blogs
- Top x performance testing blogs

Continue reading

Automatially opening PuTTY sessions with PuttyCM

A while ago I posted a script to automatically open a series of PuTTY sessions. What I didn't know at that time is that several tools exist to achieve the same result. One of these tools is PuttyCM.

Putty Connection Manager (PuttyCM) is a tool that lets you easily open several PuTTY sessions, logon to them and execute post-login commands. Nowadays I use PuttyCM on a daily basis to stream the content of logfiles on linux servers to my local windows machine.
I then use Hoo Wintail to easily filter and highlight specific log file entries. Read more about that in the Hoo Wintail log monitoring article.

PuTTYCM features

A PuttyCM connection is able to logon automatically to an existing PuTTY session. Redefining the connection details in PuttyCM is not needed.
PuttyCM connections

Every PuttyCM connection can have up to 5 post-login commands. This means that PuttyCM opens the PuTTY session, logs on with the specified username and password, and executes the list of commands.
PuttyCM post-login commands

PuttyCM connections can be stored in a database. It's possible to have the database file encrypted too.
PuttyCM database creation

FAQ on PuttyCM

I encountered some problems when using PuttyCM. Here's a list of the problems and solutions:

Q1: When minimizing PuttyCM, the windows remains minimized/on the background and I'm not able to display the PuttyCM window anymore.
  • On the options screen, in the 'General' section, uncheck the 'Hide when minimized' checkbox.
    PuttyCM general options
Q2: After having updated the PuttyCM configuration in the options screen, some changes did not have effect.
  • Click the 'apply' button before clicking the 'ok' button on the options screen.
Q3: When opening a PuttyCM connection, the connection window remains empty and an external PuTTY session window is created which is not attached to PuttyCM on the options screen
  • In the 'PuTTY' section, check the 'Enable additional timing for PuTTY capture(s)' option, and set a value of 2000.
    PuttyCM PuTTY options

Continue reading

How to define good locators for GUI elements

One of the important pillars of a successful test automation project is the robustness of your code. If the GUI of the application under test changes and your automation code is sensitive to GUI changes, you'll lose valuable time fixing the code. Good element locators greatly contribute to the maintainability of your automation project. But what is a 'good' element locator?

A good element locator:
  • is as precise as possible to indicate the GUI element
  • will continue working when GUI elements around the GUI element change
  • will continue working when properties of the GUI element change

Let's have a closer look at these statements and show some examples.

A GUI element locator should be as precise as possible


In a perfect world, each webelement has an html id. Finding an element by html id is the most precise way to define an element, since the id is usually the property that's less likely to change.

For the following html code:
This could be the element locator in Selenium Webdriver:
By.id("createCustomer")
By.xpath("//div[@id='createCustomerButton']")
By.xpath("//*[@id='createCustomerButton']")

Sometimes elements have an html id which is partially fixed. The html contains contains both a fixed and variable part, for instance the timestamp of the build. In the following example, we search for the fixed part of the html id by using the xpath contains function.

For the following code:
This could be the element locator in Selenium Webdriver:
By.xpath("//div[contains(@id, 'createCustomerButton')]")

A GUI element locator should survive changes to its parents


If the element has no html id, we must find other ways to locate the element. You might be tempted to try the 'copy Xpath' action in the developer tools of your browser. This is only a good idea if the source contains html id's, if not, you might get something like:
/html/body/div/div/div/div/div/div[2]/div/div/div/div/div[2]/div/span

It's obvious that this is a bad element locator. If 1 element is added to or removed from this html tree the element locator stops working, or worse, returns a different element.

In order to avoid specifying the complete html tree, you should look for anchor points as close as possible to your element.

Let's have a look at the following html code:
 
Imagine that you need to find the div having the 'button' role in the active menu item. We cannot search directly for the div with the button role, since 2 such divs exist. Instead we need to first find the active menu item and then descend to the div with the button role.

Both are valid element locator implementations in Selenium Webdriver:
By.xpath("//div[contains(@class, 'menu-item-active')]/div/div")
By.xpath("//div[contains(@class, 'menu-item-active')]//div[@role='button']")

A GUI element locator should survive changes to its own properties


If an element has several properties, there's no need to check for all properties. Similarly, if a property (or for instance an attribute in html) has multiple values, you don't need to check for all properties.

Let's have a look at the following code:
    
If you need to get the active menu item, you need to search for the "menu-item-active" value of the class attribute. There's no need to check for the "menu-item" and "accordeon" values in this attribute. Moreover, checking for these additional attributes would make the code brittle. If one of these irrelevant properties changes, the element locator will stop working.

So instead of using this element locator:
By.xpath("//div/[@class='menu-item menu-item-active accordeon']")
You better use the xpath contains function and check only for the relevant attribute value:
By.xpath("//div/[contains(@class, 'menu-item-active')]")

Continue reading

Selecting an item from a Vaadin dropdown with Selenium Webdriver


When we need to select items in a dropdown with Selenium Webdriver, we usually use the Select class. We can then call the selectByVisibleText, selectByIndex and selectByValue methods. Unfortunately this won't work in Vaadin applications. That's because Vaadin doesn't use the select html element, instead it uses it's own implementation.

In order to easily automate the specific Vaadin objects, you could use Vaadin TestBench which is a tool built on Selenium2 but it's not free. As an alternative you could write methods to access the Vaadin specific objects yourself, which is what I did.

Below you'll find the code I use to select an item in a Vaadin dropdown, either by visible text (value) or by index. Both methods start by calling the getMenuItemsFromFilter method that gets the available dropdown items by clicking on the filter arrow next to the dropdown. From each combobox item the WebElement is taken and added to the List which is returned.


Both methods take a 'filterParentLocator' of type By as input parameter. Here you should pass a By object which refers to the div with role 'combobox', which is the parent of both the combobox textfield v-filterselect-input and combobox dropdown arrow v-filterselect-button. The By object could be something like: By.xpath(//div[@role='combobox']).

The first method sets the dropdown value according to the item to search for, specified as an input parameter. It loops through the available choices and when it finds a menu item containing the search text, selects it.
protected void selectItemFromFilter(By filterParentLocator, String searchItem) throws DataNotFoundException {
logger.debug("about to select item from filter, searching for item: " + searchItem);

List menuItems = getMenuItemsFromFilter(filterParentLocator);

WebElement menuItemToSelect = null;
for (WebElement menuItem : menuItems) {
if (menuItem.getText().contains(searchItem)) {
menuItemToSelect = menuItem;
break;
}
}

if (menuItemToSelect == null) {
throw new DataNotFoundException("Couldn't find menu item with text: " + searchItem);
}

logger.debug("selecting folowing item from the filter: " + menuItemToSelect.getText());
menuItemToSelect.click();

}

This method sets the dropdown value according to the index, specified as input parameter.
protected void selectItemFromFilter(By filterParentLocator, Integer index) throws DataNotFoundException {
logger.debug("about to select item from filter, index: " + index);

List menuItems = getMenuItemsFromFilter(filterParentLocator);

try {
WebElement menuItem = menuItems.get(index);
logger.debug("selecting folowing item from the filter with index: " + index + " -> and text: " + menuItem.getText());
menuItem.click();

} catch (IndexOutOfBoundsException e) {
throw new DataNotFoundException("Couldn't find menu item with index: " + index);
}

}

This method returns a list of WebElements where each WebElement in the returned list is a row in the dropdown menu that appears after clicking the filter arrow. The 2 previous methods need this method.
private List getMenuItemsFromFilter(By filterParentLocator) {
By suggestMenuDropdownButtonLocator = By.xpath("//div[contains(@class, 'v-filterselect-button')]");
By suggestMenuLocator = By.xpath("//div[contains(@class, 'v-filterselect-suggestmenu')]");
By menuItemLocator = By.xpath("//td[contains(@class, 'gwt-MenuItem')]");

WebElement suggestMenuDropDown = getDriver().findElement(filterParentLocator).findElement(suggestMenuDropdownButtonLocator);

suggestMenuDropDown.click();

return getDriver().findElement((suggestMenuLocator).findElements(menuItemLocator));
}

Note: I found out that this approach doesn't support dropdowns where 'previous' and 'next' buttons are displayed in order to browse through the dropdown items. If you need to support such case, you'll have to take another approach.
Continue reading

Waiting for a page to be loaded (synchronizing) with Selenium Webdriver

An often reoccuring automation problem is the synchronization of web pages. The automation script should only continue if the page is fully loaded. If the automation code tries to continue before the page is fully loaded, some objects might not be visible yet and the script will fail.
In some web development frameworks a loading indicator is used to show that a page is being loaded. The presence of this loading indicator object can be used to determine whether the page is still loading.

How can we implement this in Webdriver? Webdriver has a built-in method to check if an element is visible or not: ExpectedConditions.visibilityOfElementLocated(). We could use this method in combination with the WebDriverWait object in order to wait until the loading indicator is not visible, for instance:
private void waitUntilPageStopsLoading(int timeout) {
By loadingIndicatorLocator = By.xpath("//div[contains(@class,'v-loading-indicator')][contains(@style, 'display: block;')]");
WebDriver driver = getDriver();
WebDriverWait wait = new WebDriverWait(driver, timeout);
wait.until(ExpectedConditions.invisibilityOfElementLocated(loadingIndicatorLocator));
}
However, this approach will not work all the time. Imagine that the application starts loading with a short delay. If the WebDriverWait checks for the presence of the loading indicator before the loading indicator is shown, the script will conclude that loading has finished and will continue, even before the actual loading has started.

Therefore I prefer to first check if the page starts loading, with a timeout of 1 second for instance. This way we'll wait for maximum 1 second for the loading to start. If the loading indicator is still not shown after 1 second, we can be quite sure that the page will not start loading anymore, else we wait until the loading has finished.
Here's a complete example:
public void sync() {
sync(60);
}

public void sync(int checkStopSyncTimeout) {
sync(1, checkStopSyncTimeout);
}

public void sync(int checkStartSyncTimeout, int checkStopSyncTimeout) {

if (pageStartsLoading(checkStartSyncTimeout)) {
waitUntilPageStopsLoading(checkStopSyncTimeout);
}

}

private boolean pageStartsLoading(int timeout) {

WebElement element = null;
try {
By loadingIndicatorLocator = By.xpath("//div[contains(@class,'v-loading-indicator')][contains(@style, 'display: block;')]");

WebDriverWait wait = new WebDriverWait(getDriver(), timeout);
element = wait.until(ExpectedConditions.visibilityOfElementLocated(loadingIndicatorLocator));

} catch (TimeoutException e) {
// Do nothing, if the page doesn't start loading, it probably means that the page doesn't have to start loading and is already synchronized (or is really slow :-))
}

return element != null;
}

private void waitUntilPageStopsLoading(int timeout) {
By loadingIndicatorLocator = By.xpath("//div[contains(@class,'v-loading-indicator')][contains(@style, 'display: block;')]");

WebDriver driver = getDriver();
WebDriverWait wait = new WebDriverWait(driver, timeout);
wait.until(ExpectedConditions.invisibilityOfElementLocated(loadingIndicatorLocator));

}

Continue reading

Call for Software Testing Blogs

It has been a while since I composed the Top 100 Software Testing Blogs. To be more precise, it has been 1 year and a half already. Since software testing blogs change and evolve, just like any other thing in life, a new Top 100 Software Testing Blogs would surely make sense. So let's make a 2011 edition!

This time I count on you to make this edition a success. Submit any software testing blog, that's not yet in the original Top 100 Software Testing Blogs, in the comment section of this post. By doing this you increase the coverage of software testing blogs eligible to this list, so we have less chance of missing any. All new submissions and the ones from the original top 100 will be evaluated together to finally become a new Top 100.

Make sure the blog applies to following criteria:
  1. must be software testing related
  2. can have technical test automation/performance topics but should not be about technical test automation/performance only
  3. must be not present yet in the original Top 100
Deadline for submissions: Wednesday 30th of November at 23:59


Your input is much appreciated. Thanks in advance!
Continue reading

Recent Articles

Top Commenters

Recent Comments