By now, following the previous two posts in this series, you have setup the methods that initialize a Chrome and a Firefox browser. In this post, you will see how to use System properties for easily switching the browser in tests.
Browser unaware Selenium tests. STEP 2: Creating the browser initialization methods for Chrome and Firefox
In this second post of the ‘browser unaware Selenium tests’ series, i will show what the methods that start Chrome and Firefox look like, based on the selected OSs from the previous post.
Browser unaware Selenium tests. STEP 1: Identify OSs on which to run tests + choose browsers to support
In this blog post series, i want to show how i normally set up my browsers and my Selenium code, in order to enable writing ‘cross-OS’, ‘cross-browser’, ‘browser-unaware’ tests. What this means: my tests can run on any OS i set up seamlessly; each test can be run on multiple browsers seamlessly; the tests do… Read More
thewaiter: wait for WebElement attribute. To equal, contain a String, with variations.
An attribute of an HTML tag (or WebElement as you might know it from Selenium) stores valuable information about the state of that element. If we are thinking of checkboxes, a “checked” attribute will signal whether the checkbox is selected or not. For a link, the “href” attribute will tell us what location on the… Read More
Use waits as assertions for your Selenium tests
Selenium tests tend to make a lot of use of assertions, to check that some actions have been performed on the front-end or that some WebElement properties are the expected ones. And by assertions, I mean, mostly: assertEquals or assertTrue, as these are the most commonly used ones. Assertions fail too often due to the… Read More
thewaiter: waiting for a URL in the browser to equal or contain a String, with Selenium
In some tests it is not enough to just wait for a page to fully load, but instead you need to make sure that the URL corresponding to that page is the expected one. Maybe you clicked on a button and need to make sure an expected page/URL opened, or maybe you are opening a… Read More
thewaiter: clicking on an element by using waits with Selenium
One of the most common ways of interacting with a page displayed in a browser, in Selenium tests, is clicking on a WebElement. But many times, due to the timing when the click happens, it will fail, since the WebElement that needs to be clicked is not yet available. This might be because some Javascript… Read More
thewaiter: opening a page and waiting for it to load with Selenium
In this post i will discuss the methods you can find in thewaiter library, for waiting for a page to load completely. I will show the methods you can use from thewaiter that can help you with these waits, and some test examples for each, that you can also find in GitHub.
Introducing thewaiter. A WebDriverWait based library for writing reliable Selenium tests
During my talk at the recent SauceCon conference, i described how you can write reliable Selenium tests by using WebDriverWait based methods to wait for page events to take place. I am now happy to announce that my little project, thewaiter library that i mentioned in the talk, is available to use from the Maven… Read More
Checking whether an image is broken with HttpClient
Let’s say you have a task to check whether a certain image is broken on your page. In case of a broken image, instead of it being rendered properly on the page in your browser, you will see a suggestive icon, like an X or something similar (depending on the browser), suggesting that it’s broken.