Selenium waits: isn’t it time to move on?

How do you make Selenium WebDriver wait for page to load. There’s an important difference between a human tester and an automated UI testing tool. This difference comes down to patience: humans are capable of it, and machines aren’t. When processing a test, an automation tool expects to obtain some result, like a button click. If the button is missing, the test fails, which is what we pretty much expect from it If the button takes too long to load, though, the test will also fail, which is certainly not the result we’re counting on. False positives of this sort are the reason why timeouts exist. With timeouts, we can instruct an automated UI testing tool to “wait” for several seconds before trying to click on the button. This, however, introduces new difficulties. Suites of automated tests are typically synchronized with each other. Let’s say there’s a test called A1, and a test called A2 which depends on A1. If running A1 now takes 2x more time, A2 will fail because its pre-conditions are not met. Therefore, A2 requires adding timeouts as well. Naturally, a change to A2 will affect an A3 down the chain, and so on. Having to... More

Selenium locators best practices: helpful tips for UI testers

Following Selenium locators best practices isn’t merely a good thing to do. Given how little it takes for UI testing to crumble into maintenance hell, having a good locator strategy is a must. And just like most things in UI testing, simple, robust Selenium locators aren’t that simple to build. So if you intend to automate UI testing with Selenium, scan through the best practices outlined in this post. While some of the tips we’ll mention are well-known, chances are you’ll discover a couple of new tricks. In fact, let’s start from simple, beginner friendly practices and proceed to more complicated ones. 1. If you can get your developers to add unique IDs, just do it Let’s begin with a quick reminder from Captain Obvious: IDs are (and will probably always be) the most resilient attributes for Selenium locators. A best practice that deserves mentioning in this context is less technical, yet it will save you tons of time. When building locators, it’s easy to forget about the option of asking your developers to add unique IDs to the UI code. So if reaching out to a developer is an option — and if adding unique IDs really makes sense... More

Responsive design testing: tools, challenges, solutions

What’s so challenging about responsive design testing? Or should I say, what’s not challenging about it? We all know that responsive web design testing can get tedious. A dozen of screen sizes, multiplied by the number of supported Webkits and Geckos. Oh, and how about IEs? Okay, I know I’m basically rubbing it in at this point… Still, it’s not just the number of browsers and devices. When testing responsive designs, you get a bunch of tools and tactics to choose from. Yet none of these tools and tactics cover the whole spectrum of requirements posed by responsive design testing of a real-life web app. So what can we do about it? To find the answer, let’s briefly analyze the options we get when testing responsive web designs. Device/screen emulators for responsive design testing Screen size emulators like Responsinator or Viewport Resizer make for a fast and cheap way of responsive design testing. These tools are, essentially, a step up over Chrome’s device toolbar because they target a wider range of screen sizes. One disadvantage of this sort of tools is that they rarely offer anything except for the very basic functionality. All they can do, in a nutshell, is... More

What is Regression Testing? Techniques and best practices

If you’ve been following this blog, you know that we are pretty serious about regression testing best practices. Visual regressions were the arch-enemies of our product AjaxSwing. To overcome them, we’ve even created our own automated regression testing tool. Today, we’d like to talk about this type of testing. We'll cover its key concepts and challenges. Besides, we'll explore regression testing best practices, techniques and tools. Let’s start with addressing some of the basics. What is regression testing? Image credit: 360logica Basically, we're talking about a testing methodology/process that tells you if a previously written and tested code broke after you’ve added an update or a fix. In other words, it helps you notice if you’ve unknowingly introduced bugs to your software while adding new code. New bugs of this kind are called regressions. How to do regression testing? Image credit: DZone Okay, so how exactly do you test for regressions? In a nutshell, you perform regression testing by re-executing the same tests after each update. Passing tests ensure that your code continues to function as expected. Once a test that passed during previous runs fires a failure, you know that you’re dealing with a regression. As a rule, it’s a good... More

How to run tests from Selenium IDE in Chrome

Ever wondered if you could use Selenium IDE for Chrome? You've probably heard that the IDE only runs in Firefox, which means Google’s much-famed browser is out of reach. Actually, there’s a neat little feature that lets you run Selenium IDE in Chrome. The feature is called WebDriver Playback. Here's how you can use it: Launch Selenium IDE. Go to ‘Options’ and select “Options...” in the drop-down menu. In the Options menu, select the “WebDriver” tab. Check the “Enable WebDriver playback” checkbox. Find the “Browser choices” input field right below the checkbox. Below the input field, you will see browser options. These include “android, chrome, firefox, htmlunit, internet explorer, iPhone, iPad”. Substitute “firefox” with “chrome”. Note that both variants are lowercase. Download the Selenium standalone JAR file and ChromeDriver. Add both files to the same folder on your local computer. Use Terminal to navigate to the folder with the downloaded files. Start Selenium server and ChromeDriver server via Terminal: Open Selenium IDE and run the test script. Note that the script will run in one of the more or less recent versions of Chrome. So if you wanted to find out how to run Selenium tests in Chrome, follow the... More

Cloud-based regression testing platform

My colleague once told me that regression testing is the single best reason why QA automation exists. According to the same person, doing regression testing the right way is a major challenge for most web development projects. So what is so challenging about it? And more importantly, why taking regression testing to the cloud is a good idea? Why do web teams have problems automating regression testing? Two words, “UI testing”. It’s common knowledge that the ROI of automated UI regression testing is low. I’m sure you’re familiar with the culprits of this problem: Even with skilled professionals onboard, most teams struggle with the maintenance of coded UI regression tests. QA automation frameworks often lack efficient collaboration tools. In fact, few solutions will even feature shared integrated portals displaying test statuses. Existing testing environments require manual setup and maintenance. Specifically, frameworks often make you code the fundamentals of the framework itself before you can actually start writing your tests. Take another look at this list, and you’ll see that most of the problems stem from the inherent shortcomings of the tools, not the process. So maybe it’s time we moved on to something different? Taking regression testing to the cloud:... More

Why is manual regression testing still happening in 2017?

Where does manual regression testing fit in the software testing process? In fact, does it even make sense to test software manually, given the sheer number of automated regression testing tools available? I bet you’ve seen people ask similar questions on StackOverflow — as well as a good dozen of articles exploring the topic. So why would you need another post on the same topic? Well, here’s a reason to put my two cents into this same ole discussion. The choice between automation and manual regression testing looks simple on paper. Most manual regression testing tutorials will tell you that the complexity of manual testing grows exponentially as your project scales. Automated tests, on the other hand, help you move faster than manual tests, they reduce the chance of human error, and they are more cost-efficient in the long run. So, on paper, you should always strive to automate everything you can, right? After all, you can always have your developers write unit and API tests, and hire a QA team for everything else... In theory, yes, that’s how things are supposed to work. In real life, however, things get more complicated. The more so if we are talking about... More

Use Invoke Script to optimize your automated testing tool

I’m sure most people reading this blog have at least some experience with automation testing tools for web UIs. And I guess most of us can agree that no matter what testing solution we use, we all follow similar algorithms when doing automated regression testing. These algorithms are, in fact, pretty simple. In most cases, they will include roughly the same series of repeated steps for different test cases. Here’s an example: Open a starting URL (in 99% of cases, this will be the homepage) Log in Navigate to a different page (e.g. a shopping cart page, or blog post) Do something on that page(e.g. click on a button or scroll) Click to check out. Looks familiar, doesn’t it? Now, the exact steps might differ, but you’ll still find yourself repeating the same routine across different test suites. So doesn’t this seem boring and time-consuming? Having dealt with all this boring stuff, nearly any person would either search for some shortcuts or drop UI testing altogether. Sadly, many choose the latter — and this is the reason why relatively few companies do regression testing automation. But there’s actually a way to optimize this process, provided that you have the right... More

Are TDD and automated GUI testing compatible?

Image credit: SoapUI Test-driven development is awesome, unless you’re dealing with automated GUI testing. Sure, test-driven UI development is technically possible, but TDD isn’t exactly ideal for situations requiring full functional tests, and full functional tests are indispensable to GUI testing. For this reason, using TDD for UI borders on overengineering. Choose this path, and you’ll end up working with mock objects or project object models (POM), adding new layers of complexity to your project. And in many cases, you won’t be able to tell if doing this will pay off. Besides, the way automated GUI testing is done for real-life websites and web apps poses another problem. In real life, user interfaces — and web UIs in particular — undergo a lot of tweaking. No matter how well-specked your UI is, once you do a UI prototype and play around with it, changes are always coming. So how do people automate UI testing in a TDD project? The short answer is they don’t. What they do instead is clearly separate concerns between the interface and the underlying logic with MVC, MVP, MVVM, or similar architectural patterns. Basically, the main idea here is to keep the UI logic minimal so... More

UI automation testing with Smart Locators

When it comes to UI test automation for web projects, element locators can become one hell of an issue. But is there anything you can do about it? The thing is, poorly-written locators are just a part of the problem. Writing good locators is, in fact, not that difficult. After all, good locators are merely a matter of either accessing IDs or building robust CSS or XPath selectors. And you can always get your developers to throw in a couple of extra IDs, right? Actually, there’s a whole bunch of other factors to consider. Once these factors come into play, UI test automation turns into a challenge for any QA specialist, no matter how experienced. Let’s look at a couple of scenarios to see what factors can affect the work of your QA team. Scenario 1. Throwing in extra IDs Let’s start with something we all can agree on. An ID-based locator is the best option for 100% of UI test automation cases. But in real life, developers will not put IDs on every element upfront, and any data-driven content (e.g. a table) will have repeated elements that cannot have unique IDs anyway. In cases like this, path-dependant locators will... More
WordPress Image Lightbox Plugin