Skip to content

Codeless Web Automation Case: Booking a Hotel Room

Claus Topholt

Claus Topholt

Here's an example of how to automate web application testing with Leapwork.

The more people we talk to from small shops to global companies in finance and tech, the more confident we are that our vision for Leapwork is correct: Testers are not programmers. But up until now, testers have been forced into programming with little or no training in order to meet increasing demands for automation because the available tools simply require it.

We're changing that with Leapwork.

And to prove it, here's an example of how Leapwork stacks up against the popular web testing tool Selenium. We're looking at a list of places to stay in Copenhagen on Hotels.com and we want to:

  • Find a room that costs less than 1000 DKK per night (the local currency)
  • It must be closer than 1 mile to the center of the city
  • When found, click the price listed to view the room

hotels0-5Here's how to do that in Leapwork, using our unique building blocks that can get numbers with filters, format rules and scroll-to-find built right in:

hotels1-1-5

That's the whole test case. And as with other Leapwork cases, it's fairly simple to understand what it does just by looking at it:

  • We get all price numbers that are less than 1000 DKK from a certain area of the screen
  • For each number, we offset the position found and use that to get the distance to the city center, which must be less than 1,0
  • If both the price and distance numbers are good, the price is clicked and the case is passed
  • If not, the loop just continues, scrolling down a maximum of 10 times
  • The green wires show the flow between blocks, while the blue wires pass values around

This is a great example of how powerful the visual nature of Leapwork can be -- it took less than 5 minutes to put this automation case together.

The Selenium version, on the other hand, was neither easy nor quick to make, clocking in at 1 hour and 15 minutes because of some complex XPath logic:

 
MicrosoftTeams-image-3
 

Everything you need for web automation

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