BreadcrumbHomeResourcesBlog Responsive Web Design Testing Using Selenium April 20, 2017 Responsive Web Design Testing Using SeleniumAutomationBy Eran KinsbrunerSelenium is often used for responsive testing for web design. Here, we cover how to do automated responsive testing using Selenium and why it is important.Related Reading: Selenium Cross-Browser Testing: A Web Testing Tutorial >>Table of ContentsWhy Responsive UI Automation Testing Is ImportantResponsive Web Design Testing Using SeleniumWhat You Need in a Responsive Testing ToolBottom LineTable of Contents1 - Why Responsive UI Automation Testing Is Important2 - Responsive Web Design Testing Using Selenium3 - What You Need in a Responsive Testing Tool4 - Bottom LineBack to topWhy Responsive UI Automation Testing Is ImportantResponsive UI automation testing is an important part of responsive web design. Manually testing across platforms with the UX/performance/visual end-goal in mind is simply not an option.The factors of responsive web design of are:Consistent user experience (UX) and display across platforms (mobile, desktop, tablet, etc.).Easy maintenance of the product — write once, deploy anywhere concept.Cost savings due to specific dev and test skill set and tooling used across the RWD SDLC.Source: https://confengine.com/selenium-conf-2016/proposal/2275/automating-the-responsive-web-design-testingWhat You Need For Responsive UI Automation TestingAutomated responsive testing should ensure a good user experience and better quality. But there's a lot that it needs to cover.For starters, consider the following questions:Does the application look okay (visually)?Are there any bugs due to variation in screen size?Is the site optimized for mobile/tablet/laptop?How is the image size and quality (this impacts UX and performance/load time)?How do the font size and type look across platforms?Are the navigations straightforward (UX/usability wise)?Is there selective content display, and does it work?Does the website perform consistently across browsers (IE/Safari/Edge/Chrome)?Does the RWD site meet the accessibility guidelines?[Related Blog: 3 Tips For Responsive Web Design Testing]Back to topResponsive Web Design Testing Using SeleniumOne tool to consider for responsive web design testing is Selenium.Selenium is the de-facto test automation tool for standard and responsive websites. While Selenium is powerful, you'll need complementary tools, too.Cross-Browser Testing With SeleniumLearn how to test a website using Selenium. Check out our web testing tutorial or watch the webinar below: Back to responsive web design testing. Let’s list a few important requirements that will complement Selenium, using either open-source tools or products.Galen test framework is a great add-on for Selenium. It is especially helpful when targeting RWD testing:It fully supports Selenium-Grid.It provides cross-platform insights. This is through its ability to test the location of objects relative to each other on the page using a special syntax and comprehensive rule set.But that's not all you need in a responsive testing tool.Back to topWhat You Need in a Responsive Testing ToolSo, what do you need in a automated responsive testing tool — that Selenium can't do?Visual validation.Environment-based testing.Accessibility compliance.Quality analysis.1. Visual ValidationsSelenium can't do visual validations. This is where tools like Perfecto and Applitools come into play. They complement Selenium. You can use visual validation within Perfecto using Applitools Eyes to visually test the Geico.com RWD site.2. Environment Condition TestingResponsive sites are aimed to be used by almost any target platform in the market. This includes smartphones and tablets. So, it is important to realize that these platforms are highly sensitive to varying conditions.That's why you need to include environment condition testing. This includes things like:Incoming events.Background apps.Location services.Changing network conditions.This can be the difference between a successful and engaging RWD and a bad one.The cube below represents a test coverage matrix.At its base, it focuses on the:Test cases and test data (e.g., TDD).Target platforms (mobile, desktop, etc.).Personas that represent the environment characteristics as mentioned above (network, location, apps, etc.).3. Accessibility ComplianceAccessibility compliance is another important thing to look for in a responsive testing tool. Most organizations are struggling with such testing and, in most cases, they are running such tests manually.Considering the number of platforms teams need to cover as part of responsive testing, adding manual into the mix is a bad practice. It blocks velocity.For that purpose, there is a very useful tool called WAVE, that allows teams to build their accessibility test steps on top of their selenium suite.Here's a working example of the WAVE tool on top of Selenium. You can reuse this for your responsive site and quite easily gain value and kick-start your accessibility automation branch.You'll get a report that highlights the accessibility issues that the tool (WAVE) detected on your page/s. The 1st visual is within the Perfecto lab in the cloud. The 2nd one (Geico.com) is through the simple web site of WAVE.4. Quality AnalysisAutomated responsive testing covers so many platforms. It's impossible to evaluate each failure, compare the results across platforms, and figure out how to fix them.Selenium-based reports — e.g., executed through testNG — are not as insightful when it comes to quality analysis at scale.That's why Perfecto implemented its DigitalZoom™. This is a tag-based reporting framework. It allows test automation practitioners to put structure into the test code. So, at the end of each cycle, teams can easily see a dashboard, drill down, and carry out a fast root cause analysis. Back to topBottom LineResponsive web design is important. And to get there, you'll need automated responsive testing tools. You can go far in responsive web design testing using Selenium. But you'll still face some challenges.That's why you need Perfecto to solve the challenges you face with Selenium.With Perfecto, you can:Automate more tests.Apply real user conditions to your tests.Scale testing without sacrificing speed.See for yourself what Perfecto can do for your responsive testing plan. Start your free 14-day trial today to see how Perfecto can help your team. STaRT TRIAL Related ContentConsiderations for Selenium Grid in the CloudCypress vs. Selenium: What’s the Right Cross-Browser Testing Solution for You?Limitations of Selenium & How Perfecto Can HelpBack to top
Eran Kinsbruner DevOps Chief Evangelist & Sr. Director at Perforce Software, Perfecto Eran Kinsbruner is a person overflowing with ideas and inspiration, beyond that, he makes them happen. He is a best-selling author, continuous-testing and DevOps thought-leader, patent-holding inventor (test exclusion automated mechanisms for mobile J2ME testing), international speaker, and blogger. With a background of over 20 years of experience in development and testing, Eran empowers clients to create products that their customers love, igniting real results for their companies.