Skip to content

How to Use Iteration in Web Automation

Claus Topholt

Claus Topholt

A demonstration of how to iterate through found content with Leapwork's Selenium-based web automation capabilities.

While we're working our way towards our early access launch of Selenium support in Leapwork, I wanted to show off a couple of interesting details. But before I do, let me just preface it by saying that this post is aimed at testers who are familiar with HTML and CSS as well as some of the problems typically faced when working with Selenium.

The new "web" building blocks have been designed to look and feel just like the existing image and text recognition blocks to make you as productive as possible when dealing with Selenium. One similarity is the ability to "Use all occurrences", which is an implicit way of iterating or looping over found content.

In this short demonstration video, I load up the highly popular social networking site reddit.com, where users give articles and comments "karma points" by voting on them. I then find all articles with more than 40.000 karma points and get the title for each one.

 

As you can see, the whole thing took only a few minutes to make from scratch, using six building blocks. It shows how relatively easy it is to fluently navigate hierarchical structures in HTML pages without writing a single line of code.

Download: Automation Tools Comparison

Whether you are already automating test cases, or you are new to the field, it is important to select the right tool. We have made a comparison of the most common tools within the field of test automation:

New call-to-action

Everything you need for codeless web automation

Dig deeper into web automation with the Leapwork guide on everything you need to know to automate web-based tests and processes.