The Testing Challenges You Face When Your App Goes Mobile

In less than a decade, almost half of the planet has bought a smartphone. Mobility has gone from a novelty to a multi-trillion dollar industry. It is the fastest adopted technology in the history of civilization.

It is the future for your application.

Already companies have created mobile applications as a new form of communication with their customers. They have set up apps to inform, promote, and to sell their products. Businesses are also leveraging mobile technologies to achieve greater productivity, and to offer new ways to serve their markets.

From Dunkin Doughnuts offering delivery service via a mobile app, to large retailers reinventing their inventory process to include tracking by way of mobile devices and customized software, mobile applications are changing things for everyone.

Which is why testing for mobile applications has become a much more important task.

A company can invest millions in developing the perfect mobile application, only to miss in its quality assurance. Bugs go undetected by the company, but are discovered by the end user. The end user will delete the app. They will stop buying anything associated with your brand. If they paid good money for your app, in some cases they will sue.

Mobile testing impacts the bottom line of a business more than ever before.

The Main Challenges for Mobile Testing


  1. Different Devices. Unlike desktop applications which all operate over standard desktop or laptop computers, mobile applications run on phones, tablets, watches, and even in cars, homes, and household appliances. Mobile testing makes your application runs fine over screens of different sizes, and even shapes.
  2. Different Operating Systems. Where 90% of desktops ran on windows, there are four different mobile operating systems a mobile device can run on.
  3. Different coverage Areas. A desktop is immobile. It sits in one area and stay there, more or less, for the life of its use. Connected by wire, the connection is stable and usually fast. A mobile device is, well, mobile. The user is constantly moving from place to place, and from one coverage area to another. You have to make sure that different local connections won’t affect the performance of your mobile application.
  4. Time Constraints. Mobile testing is time consuming process that takes place in a competitive environment which demands that the apps are released to market quickly.


The Solutions


  1. Test automation. To cover such a wide test coverage as fast as possible, you have to automate your mobile testing. A good test automation tool will let you record a test script, and run it over again without having to recode the test.
  2. Parallel execution with cloud testing. Parallel testing is when your mobile testing tool lets you run a test on multiple devices at once. You can plug in a tablet with and Android operating system, and a Samsung with an iOS into your computer and run the tests simultaneously. You can also use mobile cloud testing where you are also connected, by the cloud, to 10, 20, 50 devices all at once, all of them running the same test in tandem.
  3. Network virtualization. To make sure that your user in Tokyo can enjoy the same mobile performance of your app as a user in Toledo you need to simulate any type of mobile connection a user will have anywhere on earth. A mobile tester must run his functional tests over different types of local coverage to guarantee his app works everywhere!


Conclusion

Mobile applications create massive opportunities for any business. They also produce new types of challenges. If you have the right mobile testing strategy and are using the best resources, you will be able to overcome the challenges to enjoy the benefits of a new, and awesome technology.
Continue reading

93 Most Popular Software Testing Blogs In 2015

A new year has started, so it is time to make a new list with the most popular software testing blogs around. The result is a list with the 93 most popular software testing blogs.
As usual this ranked list was created by gathering a set of scores for different evaluators and ordering the retrieved scores. In total 353 software testing blogs participated of which 93 complied with the entry criteria and ranking criteria as explained here.

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

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

Recent Articles

Top Commenters

Recent Comments