Sauce Labs
Blog

Selenium Resources

Selenium Tips: Infinite Loops Take Forever
Posted by Matthew Heusser in Selenium Resources

In Selenium, it's a common for the tool to get ahead of the browser. Thus, the element we want to click on does not exist yet - but it will! We’ll start with a sample html page that pauses four seconds before injecting a link onto the page. In practice, this would probably be a wait for javascript to make a REST API call and push the results into the document. Our naive test for the link [...]

Selenium Tips - Intermediate CSS Selectors in Selenium
Posted by Matthew Heusser in SeleniumSelenium Resources

Following my previous Selenium testing Tip of The Week about Better locators in Selenium, this blog post will show you more CSS rules and how to create pseudo-classes. Not only can this help you move from XPATH to CSS, but it can help you overcome some testability issues. NEXT SIBLING Let’s start with navigating a list of elements. That is, you have one element you can reach, but you [...]

Selenium Tips: Capturing A Larger Screen Area
Posted by Matthew Heusser in Selenium Resources

Capturing screenshots of your tests is one of the most important features you can give to an automation engineer. It's the easiest way to actually understand from a report, why a test failed and how to reproduce it. While our Live Testing will generate videos of the entire test by default, sometimes you just want a screenshot. Selenium supports capturing screenshots on remote machines, as [...]

Selenium Tips: Taking ScreenShots on the Server
Posted by Matthew Heusser in Selenium Resources

Code is fantastic at checking for pre-determined problems - that a calculated output matches an expected result. It’s also rather bad at checking for unanticipated changes. One way to do this is to take a screen capture, store it, and compare it to the current screen - a pixel-by-pixel compare. Or store the screencaptures away and have a human review them, perhaps as thumbnails, perhaps [...]

Selenium Tips: Efficiently Removing Cookies
Posted by Matthew Heusser in Selenium Resources

Let’s say you have a simple SaaS application with a setup that starts a browser and logs in. Towards the end of the test, the cleanup logs the user out, so the next test will run on time. But something goes wrong, and logout does not happen. The next test will go to the wrong screen, a screen with no username, password, or submit button field, causing long delays as the test waits for [...]

Selenium Tips: Working with Multiple Windows
Posted by Matthew Heusser in Selenium Resources

One common Selenium issue is dealing with popup windows. You might also want to create your own new windows to do something in a shared session. For example: To create a new account, the pop back to the original page to see that the javascript has updated to ‘see’ this new ‘friend’ appears on a friends list. For multiple window tasks, Selenium IDE provides the following [...]

WebDriver Moves To A W3C Recommendation

The W3C has officially moved the WebDriver protocol to recommended state, which means it is officially supported and endorsed by W3C. The Selenium Project added stable support for the W3C protocol in Selenium v3.8 through v3.11 and has indicated plans to migrate entirely to the new protocol in all upcoming versions. There are three main advantages to the W3C protocol: There will be an agreed to [...]

Nightwatch.js Makes Software Test Scripts Fun and Easy
Posted by Greg Sypolt in Guest Blog PostsSelenium ResourcesSoftware Development & Testing

Nightwatch.js is a Selenium wrapper that provides several out-of-the-box commands and assertions for performing various operations on the page. The commands and assertions are clean and straightforward, enabling you to develop tests very quickly using Javascript (specifically, Node.js). It allows you to create custom helpers to increase your testing capabilities. In this article, we’ll [...]

Free Trial

Get access to a free 14-day trial version, or contact Sales for more information.